Small-size insulator defect detection method, system, equipment and medium
By combining the improved Retinex method and lightweight super-resolution reconstruction with the InsYOLO model, the problems of poor image quality and real-time performance in detecting small-sized insulator defects in low-light environments were solved, achieving high-precision and low-power UAV inspection capabilities.
Patent Information
- Application Number
- CN202511453317.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-02-24
AI Technical Summary
Existing technologies suffer from poor image quality in detecting small-sized insulator defects in low-light environments, leading to detection difficulties. Furthermore, existing models cannot be run in real time on UAV edge devices.
An improved Retinex method is used for image enhancement and lightweight super-resolution reconstruction, combined with the InsYOLO model for feature fusion. By optimizing the model deployment through hybrid quantization, efficient detection of small-sized insulator defects is achieved.
It improves the accuracy and real-time performance of small-sized defect detection in low-light environments, meeting the needs of UAV inspection. The detection accuracy at mAP@0.5 reaches 96.178%, the false negative rate is reduced to 8%, the frame rate reaches 27FPS, and the power consumption is less than 6W.
Smart Images

Figure CN121564384A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of insulator defect detection technology, specifically to a method, system, equipment, and medium for detecting defects in small-sized insulators. Background Technology
[0002] Existing insulator defect detection technologies mainly revolve around two major stages: image preprocessing and defect identification. For image preprocessing, traditional methods include histogram equalization (HE) and the Retinex algorithm. HE enhances the image through global contrast adjustment, but it easily amplifies noise in low-light environments, leading to blurred insulator skirt textures. While Retinex algorithms (such as single-scale SSR and multi-scale MSR) can separate illumination and reflection components, they are insufficient in suppressing Gaussian noise under low illumination (light intensity < 5000 lux), resulting in a signal-to-noise ratio (SNR) typically below 20 dB for the processed image. In the field of super-resolution reconstruction, mainstream models such as EDSR (Efficient Deep Super-Resolution Network) and ESRGAN (Generative Adversarial Super-Resolution Network) can restore low-resolution (e.g., 320×240) images to 1280×960. However, EDSR has 1.5M parameters and ESRGAN has a computational cost of over 30 GFLOPs, making it difficult to run in real time on edge devices such as drones. Lightweight models such as MobileSR (0.3M parameters) are suitable for edge devices, but after reconstruction, small defects (e.g., umbrella skirt cracks <5mm) have blurred edges and feature loss rate of over 40%.
[0003] Regarding defect detection models, YOLOv5s and Faster R-CNN are mainstream solutions. YOLOv5s achieves a frame rate of 30 FPS on 1080P images, but its mAP@0.5 for small insulator defects (accounting for less than 2% of the image area) is only 78.3%. Faster R-CNN improves accuracy through two-stage detection (reaching 82.1% mAP@0.5), but its frame rate is less than 10 FPS, which cannot meet the real-time inspection needs of UAVs. In addition, existing technologies often separate "enhancement-super-resolution-detection" into independent modules without considering inter-module collaboration: noise after enhancement interferes with super-resolution reconstruction, and the high-resolution image output by super-resolution does not specifically extract defect features, resulting in a missed detection rate of over 35% for small defects.
[0004] While existing technologies are effective in scenarios with normal lighting and large defects, they still have the following shortcomings when addressing the core requirement of "low light + small defects":
[0005] Poor low-light adaptability: Under low illumination (<5000 lux), traditional enhancement algorithms either fail to improve contrast sufficiently (the grayscale difference between defects and background after HE processing is <15) or amplify noise (the proportion of noise pixels after Retinex processing is >12%), failing to provide clear input for subsequent detection.
[0006] Loss of small-sized defect features: In low-resolution images (320×240), small-sized defects (<5mm) have less than 20 pixels. They are easily smoothed during super-resolution reconstruction, making it difficult for the detection model to capture key features such as edges and corners, resulting in a false negative rate of over 35%.
[0007] Poor module synergy: Enhancement, super-resolution, and detection are executed independently, and no feature transfer channel is established (e.g., the enhanced reflection component is not used for super-resolution constraints, and the high-resolution features after super-resolution are not fused with the multi-scale layers of the detection network). The overall detection accuracy is affected by the cumulative error of the modules, with a maximum mAP@0.5 of only 82.1%.
[0008] The contradiction between deployment and real-time performance: High-precision super-resolution-detection combined models (such as ESRGAN+FasterR-CNN) have more than 2M parameters, and the frame rate of 1080P video stream on JetsonNano edge devices is less than 8FPS, which cannot meet the "real-time backhaul" requirements of UAV inspection. Summary of the Invention
[0009] In view of the above-mentioned problems, the present invention is proposed.
[0010] Therefore, the purpose of this invention is to solve the problems existing in the prior art, especially the difficulty in detecting small-sized insulator defects in low-light environments due to poor image quality. A method for detecting small-sized insulator defects based on low-light image enhancement and super-resolution reconstruction is proposed, aiming to solve the problem of low detection accuracy caused by blurred features and loss of details in small-sized insulator defects under low illumination conditions.
[0011] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for detecting defects in small-sized insulators, comprising,
[0012] Acquire raw low-light images and preprocess them; build an InsYOLO model and train and configure the training parameters; perform hybrid quantization on the trained InsYOLO model and deploy edge testing.
[0013] As a preferred embodiment of the method for detecting defects in small-sized insulators according to the present invention, the acquisition of the original low-light image includes selecting an acquisition device and acquiring the original low-light image of the transmission line.
[0014] Set the device acquisition parameters and perform full scene coverage acquisition through scene planning;
[0015] Sample annotation is performed on the original low-light images.
[0016] As a preferred embodiment of the method for detecting defects in small-sized insulators according to the present invention, the preprocessing includes enhancing the original low-light image;
[0017] Lightweight super-resolution reconstruction is performed on the enhanced image to obtain a super-resolution image.
[0018] The reconstructed super-resolution image is then enhanced again.
[0019] As a preferred embodiment of the small-size insulator defect detection method described in this invention, the step of performing lightweight super-resolution image reconstruction includes building a MobileSR-L model;
[0020] The enhanced low-resolution image is input into the MobileSR-L model for super-resolution processing;
[0021] Image augmentation is performed on the super-resolution images to expand the training samples to cover multiple interference scenarios.
[0022] As a preferred embodiment of the small-size insulator defect detection method described in this invention, the construction of the InsYOLO model includes using YOLOv8n as the basic architecture:
[0023] The backbone (the backbone network in deep neural networks) replaces traditional Conv convolutions with GhostConv;
[0024] The Neck (the neck of a deep neural network) adds a super-resolution feature fusion layer, which downsamples the features output by the super-resolution layer and concatenates them with the features of the P2 output layer in YOLOv8n to fuse high-resolution details.
[0025] The Head (in deep neural networks) retains the regular detection surfaces from the P3 to P5 output layers in YOLOv8n, adds a shallow detection surface at P2, and captures small targets through an anchor grid.
[0026] Super-resolution feature fusion downsamples the features output by super-resolution and concatenates them with the features of layer P2 to fuse high-resolution details. The result is then output to the detection head and fed into the loss function to determine the model's convergence status.
[0027] Intrinsic feature maps are obtained using conventional convolution. , For the input feature map, Use a regular convolution kernel; for each channel of Y, use... The operation generates a Ghost feature map. , , ,in, intrinsic feature map The feature map of the i-th channel, This is a linear transformation operation used to generate Ghost feature maps. For the reason pass The j-th Ghost feature map generated by the operation Represents intrinsic feature map There are m channels in total. Represents each intrinsic feature map pass Generate s Ghost feature maps; concatenate the obtained intrinsic feature maps and Ghost feature maps to obtain the final result Output.
[0028] The training parameter configuration includes dividing the dataset into a training set, a validation set, and a test set;
[0029] The loss functions are CIoU loss of localization error, Focal Loss, and edge perception loss. Defect edges are extracted by the Canny operator, and the overlap loss between the predicted box and the edge is calculated.
[0030] The optimizer is AdamW, the initial learning rate is set to 0.0001, the weight decay is set to 0.0005, and cosine annealing learning rate is used.
[0031] The training strategy is Batch Size=16, training for 200 rounds, evaluating with a validation set every 20 rounds, and stopping early if there is no improvement after 50 rounds.
[0032] The beneficial effects of the preferred technical solution in the embodiments of the present invention are: enhancing the fine-grained characteristics of small-sized defects, enabling microcracks <5mm to be captured by a 16×16 grid, and solving the problem of missed detection of small targets.
[0033] As a preferred embodiment of the small-size insulator defect detection method described in this invention, the hybrid quantization includes: using TensorRT 8.6 to perform INT8 hybrid quantization on the trained model, selecting 500 low-light scene images from the training set, and performing the same enhancement and super-resolution operations as the preprocessing.
[0034] The calibration method was set to KL divergence, and the threshold was set to 1.4. The convolutional and activation layers of the model were quantized, and only the BatchNorm layer was kept at FP32 precision. The model volume was compressed after quantization, and the quantized model was deployed to Jetson Orin NX with a 1080P low-light insulator video stream as input.
[0035] The beneficial effects of the preferred technical solution in the embodiments of the present invention are as follows: by replacing the traditional super-resolution model with MobileSR-L (0.25M parameters), using GhostConv lightweight convolution with InsYOLO (1.2M parameters), and combining it with TensorRTINT8 quantization, the overall model is compressed to 3.8MB, achieving 1080P video stream 25FPS real-time inference on JetsonOrinNX with power consumption ≤6W, meeting the computing power and battery life requirements of UAV inspection.
[0036] As a preferred embodiment of the small-size insulator defect detection method described in this invention, the enhancement of the original low-light image includes decomposition and denoising using an improved Retinex method to obtain the original low-light image. As input, after normalization, the average brightness of the image is first calculated. Reflects light intensity:
[0037]
[0038] in, , For the image height and width; according to Adjust σ, where σ is the appropriate low-light intensity. When σ is less than 0.2, the value of σ is {5, 20, 40}, which expands the scale range and enhances the extraction of details in low light.
[0039] When 0.2≤ <0.5, σ={10,20,30};
[0040] Illumination Components The calculation is as follows:
[0041]
[0042] in, The dynamically adjusted Gaussian kernel, reflection component The calculation is as follows:
[0043]
[0044] For the reflection component Layered processing combining coarse and fine denoising is employed. The switching block BM3D size is set to 16×16, and the inter-block similarity threshold T1=10 is calculated. When the similarity is less than... These are considered similar blocks, and collaborative filtering is performed on them:
[0045]
[0046] Locating high-frequency detail regions using gradient operator G:
[0047] When E(x,y)>20, it is determined to be a high-frequency detail region, the switching block size is 8×8, and the similarity threshold is set to [value missing]. =5, perform secondary noise reduction: If E(x,y)>20, then Other areas ;
[0048] Calculate the grayscale histogram of the denoised reflection component R to locate the defect region and the background region. Amplify the grayscale difference between the defect and the background using an adaptive gain function to output an enhanced image.
[0049] Another objective of this invention is to provide a small-sized insulator defect detection system.
[0050] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a small-size insulator defect detection system, comprising: a data acquisition module, a model building module, and a quantization module;
[0051] The acquisition module acquires raw low-light images and performs preprocessing.
[0052] The model building module builds the InsYOLO model and trains and configures the training parameters.
[0053] The quantization module performs hybrid quantization on the trained InsYOLO model and deploys edge testing.
[0054] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method for detecting defects in small-sized insulators.
[0055] The present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the method for detecting defects in small-sized insulators.
[0056] The beneficial effects of this invention are as follows: the micro-light enhancement of this invention provides low-noise input for super-resolution, and the super-resolution amplifies small defect features. The synergistic constraint of the two enables the detection model to obtain a clearer defect characterization. InsYOLO captures small-sized defects in a targeted manner through feature fusion and shallow detection surface, and quantitatively deploys a balance between accuracy and real-time performance.
[0057] Improved adaptability to low-light environments: In scenarios with illumination of 100-5000 lux, the detection rate of mAP@0.5 reached 96.178%, which is 23% higher than the traditional Retinex+YOLOv5s (78.3%), and the false negative rate decreased from 35% to 8%.
[0058] Improved accuracy in detecting small defects: For microcracks <5mm, the recall rate increased from 62% to 92.059%, and the positioning error was <2mm (compared to >5mm in traditional methods).
[0059] Lightweight design and real-time performance balance: quantized model size 3.8MB, 27FPS on Jetson Orin NX (meets 30FPS requirement), power consumption 5.2W (drone flight time > 2 hours).
[0060] Improved module collaboration efficiency: End-to-end collaboration between enhancement, super-resolution, and detection reduces computation by 20% compared to independent module cascading (enhancement → super-resolution → detection), and shortens single-frame processing time from 55ms to 38ms.
[0061] Highly practical for engineering applications: In actual drone inspections, the accuracy rate for identifying two types of defects in 110kV insulators—flashover and breakage—is 96.178%, with a false detection rate of <5%, which can be directly used for transmission line operation and maintenance decisions. Attached Figure Description
[0062] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0063] Figure 1 This is a flowchart illustrating a method for detecting defects in small-sized insulators according to an embodiment of the present invention.
[0064] Figure 2 This is a flowchart illustrating a method for detecting defects in small-sized insulators according to an embodiment of the present invention.
[0065] Figure 3 This is a flowchart illustrating a method for detecting defects in small-sized insulators according to an embodiment of the present invention.
[0066] Figure 4 An insulator image under low-light conditions, which is provided as an embodiment of the present invention for a method of detecting defects in small-sized insulators.
[0067] Figure 5 An enhanced image of an insulator, provided as an embodiment of the present invention, illustrates a method for detecting defects in small-sized insulators.
[0068] Figure 6 The image shows the effect of detecting insulator defects in a low-light environment, which is an embodiment of the present invention.
[0069] Figure 7 This image shows the training effect of an insulator defect detection model under low light conditions, which is part of an embodiment of the present invention for a method for detecting defects in small-sized insulators.
[0070] Figure 8 The graph shows the convergence parameter improvement effect of the insulator defect detection model under low light environment in a small-sized insulator defect detection method provided in an embodiment of the present invention after 200 rounds of training and in the last 30 rounds.
[0071] Figure 9 The MAP0@0.5 convergence diagram of two types of defects in insulators, namely flashover and breakage, under low light conditions, is provided in an embodiment of the present invention for a method for detecting defects in small-sized insulators. Detailed Implementation
[0072] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0073] Example 1, referring to Figure 1 This is one embodiment of the present invention, which provides a method for detecting defects in small-sized insulators, including:
[0074] S100: Acquire raw low-light images and perform preprocessing;
[0075] S200, Build the InsYOLO model and train and configure the training parameters;
[0076] S300: Perform hybrid quantization on the trained InsYOLO model and deploy edge testing;
[0077] It should be noted that there are problems with the existing technology, especially the difficulty in detecting small-sized insulator defects in low-light environments due to poor image quality.
[0078] Therefore, to address the aforementioned problems, through steps S100-S300, this invention is based on low-light image enhancement and super-resolution reconstruction. It improves image brightness and contrast through low-light image enhancement algorithms, restores defect details by combining super-resolution reconstruction technology, enhances the identifiability of small-sized defects, and optimizes the detection process through a lightweight feature extraction network to reduce redundant calculations. This enables it to operate stably in transmission line inspection scenarios with complex lighting conditions, thereby better meeting the needs of accurate detection and reliable identification of small-sized insulator defects in low-light environments during actual inspection work.
[0079] Example 2, refer to Figures 1-3 This is one embodiment of the present invention, which provides a method for detecting defects in small-sized insulators, including:
[0080] This invention is based on low-light image enhancement and super-resolution reconstruction.
[0081] In this embodiment of the invention, step S100 involves acquiring and preprocessing the original low-light image, including the following steps S101-S106:
[0082] S101. Select the acquisition device, acquire the original low-light image of the power transmission line, set the device acquisition parameters, and perform full scene coverage acquisition through scene planning;
[0083] The equipment and scene planning used a DJI Matrice 350RTK drone equipped with a Sony IMX686 sensor (supporting night mode, minimum illumination 0.01 lux) to collect images of 110kV-500kV insulators of power transmission lines.
[0084] Flight parameters: Horizontal distance from the insulator 5-8 meters, flight speed 3-5 m / s, ensure original image resolution from 320×240 (default output under low light) to 1080P (daytime).
[0085] Scene coverage: low light scene (dusk / cloudy day, illumination 100-5000 lux), normal illumination (sunny day, 10000-50000 lux), extreme low light (dawn / evening, <100 lux). For each scene, 500 images of defects such as "micro-cracks (<5mm), skirt damage (<10mm), core rod exposure (small area)" were collected. At the same time, 1000 images of defect-free insulators were collected as negative samples.
[0086] In an embodiment of the present invention, S102, sample annotation of the original low-light image includes the following steps A1-A2:
[0087] A1. The LabelMe annotation tool is used to annotate the defect areas by power inspection engineers: for small cracks, polygon boundaries are annotated (accurate to the pixel level).
[0088] A2. Mark the damaged area with rectangular boxes, record the defect type (crack / breakage / exposed mandrel), size (length × width), and location coordinates, and construct a labeled dataset containing 3000 images (of which low-light scenes account for 60%).
[0089] In an optional embodiment, the sample annotation in S102 can use a Computer Vision Annotation Tool (CVAT) as the annotation platform, deployed on a local server or workstation. Annotation tasks are created in CVAT, importing all the original low-light images to be annotated. The image set is distributed to multiple trained power inspection engineers according to scene or defect type. Annotators use the polygon tool provided by CVAT to outline the "micro-cracks" in the images with pixel-level precision. The rectangle tool is used to annotate the areas of "broken umbrella skirts" and "exposed core rods." When annotating each defect, the defect type is selected through the drop-down menu of CVAT's attribute panel, and the defect size information is manually entered in the corresponding text box. The location coordinates are automatically generated by the tool. A senior engineer is responsible for randomly checking and reviewing the annotation results. After approval, a standard JSON format annotation file is exported from CVAT to construct an annotation dataset of 3000 images, the same size as the original solution.
[0090] In another optional embodiment, the sample annotation in S102 can involve using a pre-trained target detection model on a publicly available defect dataset to perform preliminary inference on all low-light images, automatically generating bounding boxes and preliminary category predictions for defects; importing the pre-annotation results into LabelMe or a similar annotation tool to form an image set with initial labeled boxes; and power inspection engineers checking the pre-annotation results for each image one by one. The main tasks include: correcting erroneous bounding boxes, deleting falsely detected boxes, adding new annotations for missed defects, and correcting incorrect defect type labels; for "micro-cracks," engineers correct the rectangular boxes generated by the model to more precise polygonal boundaries. Simultaneously, the specific size information of each defect is manually supplemented and recorded in the tool's labeling system; after all corrections and supplementation of information, the final annotation file is exported to form a dataset; however, this method is not suitable for complex scenarios such as extreme low light conditions.
[0091] S103. Enhancement of the original low-light image;
[0092] Decomposition and denoising using an improved Retinex method
[0093] The original low-light image is input into the enhancement module, and the illumination component L and the reflection component R (containing defect details) are separated by the improved Retinex algorithm (multi-scale Gaussian kernel σ={10,20,30}).
[0094] Perform BM3D denoising on the reflection component R: Set the block size to 8×8, the similar block search window to 20×20, and remove Gaussian noise through hard thresholding to reduce the proportion of noise pixels from 12% to <3%.
[0095] Improved Retinex method and denoising formula:
[0096] The improvements focus on dynamic kernel adaptation to low-light scenes and layered BM3D for accurate denoising, avoiding the problems of detail loss and denoising blur caused by the fixed σ of traditional methods.
[0097] Improved Retinex component decomposition formula
[0098] With the original low-light image As input, after normalization, the average brightness of the image is first calculated. Reflects light intensity:
[0099]
[0100] in, , The height and width of the image;
[0101] Dynamic Gaussian kernel settings: based on Adjust σ, where σ is the appropriate value for low light intensity.
[0102] when When σ is less than 0.2, it corresponds to extreme low light, with illumination less than 100 lux. The value of σ is {5, 20, 40}, which expands the scale range and enhances the extraction of details in low light.
[0103] When 0.2≤ When <0.5, it corresponds to normal low light, corresponding to illumination of 100-5000 lux, σ={10,20,30} (core parameter).
[0104] Illumination Components The calculation is as follows:
[0105]
[0106] in, For dynamically adjusted Gaussian kernels (as...) (change), n is the number of scales (traditionally taken as 3). This is a two-dimensional Gaussian kernel (fixed value) with standard deviation σᵢ.
[0107] Reflection component The calculation is as follows:
[0108]
[0109] Improved BM3D layered denoising formula:
[0110] For the reflection component It employs a layered processing approach combining coarse and fine noise reduction (avoiding the blurring of details in traditional Gaussian noise reduction):
[0111] Specifically, coarse noise reduction suppresses large-area noise;
[0112] Set the block size to 16×16, the similarity search window to 25×25, and calculate the inter-block similarity threshold. =10, when the similarity is less than These are considered similar blocks, and collaborative filtering is performed on them:
[0113]
[0114] Fine-tuned noise reduction while preserving defect edges;
[0115] High-frequency detail regions (where defect edges are mostly located) are located using the gradient operator G:
[0116]
[0117] When E(x,y)>20, it is determined to be a high-frequency detail region, the switching block size is 8×8, and the similarity threshold is set to [value missing]. =5, perform secondary noise reduction:
[0118] If E(x,y)>20, then Other areas ;
[0119] Calculate the grayscale histogram of the denoised reflection component R to locate the defect region (grayscale value 100-200) and the background region (grayscale value < 50). Amplify the grayscale difference between the defect and the background using an adaptive gain function G(R)=α×R+β (α=1.5-2.0, β=20-30, dynamically adjusted according to the overall brightness of the image). Finally, output the enhanced image (SNR≥32dB, grayscale difference between defect and background≥40).
[0120] S104. Perform lightweight super-resolution reconstruction on the enhanced image to obtain a super-resolution image, and then perform image enhancement again on the reconstructed super-resolution image.
[0121] Improvements based on MobileSR: Retaining its lightweight structure of depthwise separable convolution + residual connections, a new enhanced feature constraint layer is added—using the enhanced image R output from the preprocessing of the original low-light image enhancement as a constraint, applied through L1 loss (loss calculation formula: ...). , (For super-resolution output) guides the model to focus on the reconstruction of defect areas, avoiding interference from redundant background information.
[0122] MobileSR's core advantage lies in its lightweight architecture of depthwise separable convolutions and residual connections. Compared to traditional convolutions, depthwise separable convolutions split "channel-wise convolutions" and "pointwise convolutions," achieving approximate feature extraction results with 1 / 8 to 1 / 10 of the computational cost. Residual connections, on the other hand, avoid gradient vanishing in deep networks by "directly connecting inputs to outputs," ensuring efficient feature transfer under lightweight conditions.
[0123] ①The basic structure should be fully preserved during the improvement process:
[0124] Encoder section: It adopts 3-layer depthwise separable convolutional blocks (each layer contains "3×3 depthwise convolution + 1×1 pointwise convolution + BN layer + ReLU activation") to gradually compress the low-resolution input (320×240) into a deep feature map of 80×60, with the number of parameters controlled within 0.15M;
[0125] Residual Module: Retains 2 residual connection units (each unit contains 2 layers of depthwise separable convolutions, directly connected to input and output via shortcuts), focusing on enhancing the transmission of high-frequency features such as defect edges. The original MobileSR residual module "indiscriminately transmits" features across the entire image. The improved module only adjusts the weight initialization method of the residual connections (increasing the initial weights of high-frequency sensitive convolution kernels by 1.2 times), without adding any additional parameters.
[0126] Decoder section: It adopts the lightweight recovery structure of "upsampling + depthwise separable convolution", and restores the 80×60 feature map to a high resolution of 1280×960 through two 4×bilinear upsampling (avoiding the checkerboard artifact of transposed convolution). There are no redundant convolutional layers throughout the process, ensuring that the inference time of a single frame is <15ms (adapting to edge devices).
[0127] ②Specific design of the newly added enhanced feature constraint layer:
[0128] To avoid wasting computational resources on redundant background regions (such as the sky, towers, and other non-insulator areas), the model's attention needs to be directed to defective regions by enhancing the feature constraint layer. The specific implementation is as follows:
[0129] The enhanced image R (the reflection component after improved Retinex+BM3D denoising) of the preprocessed output is the core constraint signal—the gray level difference between the defect area (such as <5mm crack, umbrella skirt damage) and the background in this image is ≥40, SNR ≥32dB, the gradient value of the defect edge is ≥35, and the feature clarity is much higher than that of the original low-resolution image.
[0130] During preprocessing, R needs to be aligned with the input / output of the super-resolution model.
[0131] If the super-resolution model input is a low-resolution image of 320×240 and the output is a high-resolution image of 1280×960, then the enhanced image R (original size is the same as the super-resolution output, i.e., 1280×960) is scaled down to 320×240 through "bicubic downsampling" to obtain a constraint signal that matches the model input size. (Ensure feature scale alignment);
[0132] Simultaneously, Otsu threshold segmentation is applied in... Locating potential defect areas in the middle: calculation The grayscale histogram is used to generate a binary mask M (defect area M=1, background area M=0.3) by setting a threshold T=120 (the grayscale value of the defect area is mostly greater than 120) for subsequent "weighted constraints".
[0133] The enhanced feature constraint layer is not an independent module, but is embedded at the end of the decoder of the super-resolution model (i.e., the output after upsampling to 1280×960), and is directly related to the model output. This position is the final generation stage of the super-resolution result, and constraining the output at this time can directly correct the reconstruction error of the defect area.
[0134] The specific structure is as follows:
[0135] Input: Output of the super-resolution model (1280×960, i.e., the reconstructed high-resolution image), preprocessed constraint signal (Restored to 1280×960 after upsampling), Defect mask M;
[0136] Operation: Use "Channel Splicing" to... and Merged into a 3-channel feature map ( This is a 1-channel grayscale image. (M is a 1-channel grayscale image, and M is a 1-channel mask image), which is compressed into a 1-channel error image through a 1×1 convolution (with only one convolution kernel), visually reflecting the error. and Differences;
[0137] Output: The error map serves as an intermediate variable in loss calculation and does not participate in feature propagation. It is only used to correct model parameters during backpropagation.
[0138] Parallel Grouped Convolution (ParallelGConv) module
[0139] The gray box on the left shows the parallel feature extraction unit: the input data first passes through the first "ParallelGConv" (parallel grouped convolutional layer) to extract preliminary features, then undergoes a non-linear transformation using the green ReLU activation function, before entering the second "ParallelGConv" for further feature processing. Finally, the orange "Add" module summarizes and outputs the data. This reduces the computational load of the model, creating conditions for lightweight model deployment.
[0140] S105, Over-resolution execution
[0141] The enhanced low-resolution image (320×240) is input into MobileSR-L, the scaling factor is set to 4, and the output is a high-resolution image of 1280×960: the number of pixels for small defects (<5mm) is increased from <20 to ≥80, and the edge gradient value is increased from <10 to ≥30 (detected by Sobel operator).
[0142] In an embodiment of the present invention, S106, finally, data augmentation is performed on the super-resolution image, including the following steps B1-B3:
[0143] B1. Perform the following on the super-resolution image: Mosaic, randomly select 4 images and stitch them together to simulate a multi-insulator superposition scenario.
[0144] B2. Randomly scale the image by 0.8-1.2 times to simulate changes in drone distance;
[0145] B3. Defect area occlusion: Randomly use hardware / tree branch images to occlude 10%-30% of the defect area to simulate a complex inspection environment, expanding the training sample to 12,000 images and covering diverse interference scenarios.
[0146] In an optional embodiment, the image enhancement in S106 can randomly convert the super-resolution RGB image to the HSV color space, and make slight random adjustments to the saturation and brightness components to simulate the slight changes in the insulator color under different lighting and weather conditions, thereby increasing the robustness of the model to color insensitivity. On the image with color perturbation, a small amount of Gaussian noise is added to the non-defect background area to simulate the slight noise introduced by image transmission or sensors, thereby improving the stability of the model under slight noise interference. The image is horizontally flipped with a 50% probability to expand the dataset while maintaining the physical rationality of the defect.
[0147] In another optional embodiment, S106 can perform image enhancement again by performing small-amplitude random affine transformations on the super-resolution image, including rotation, translation, and scaling, to simulate the slight changes in viewpoint and position during drone shooting; randomly adjust the brightness of the entire image to simulate changes in ambient light intensity caused by different time periods or sudden weather changes; randomly crop a slightly smaller area from the image and then fill it back to the original image size using image edge pixels or black pixels to simulate slight changes in the focal length of the drone lens or partial occlusion.
[0148] In this embodiment of the invention, S200 involves building an InsYOLO model and training and configuring training parameters, including the following steps S201-S203:
[0149] S201, Building the MobileSR-L Model
[0150] Based on the YOLOv8n architecture, such as Figure 2 and Figure 3 As shown:
[0151] The backbone (the backbone network in deep neural networks) replaces traditional Conv convolutions with GhostConv;
[0152] The Neck (the neck of a deep neural network) adds a super-resolution feature fusion layer, which downsamples the features output by the super-resolution layer and concatenates them with the features of the P2 output layer in YOLOv8n to fuse high-resolution details.
[0153] The Head (in deep neural networks) retains the regular detection surfaces from the P3 to P5 output layers in YOLOv8n, adds a shallow detection surface at P2, and captures small targets through an anchor grid.
[0154] Super-resolution feature fusion downsamples the 1280×960 features output by super-resolution to 200×200, concatenates them with the P2 layer features (200×200), fuses high-resolution details, outputs them to the detection head, and finally outputs them to the loss function to determine the convergence of the model.
[0155] S202. Deep convolutional neural networks typically refer to convolutional neural networks composed of a large number of convolutions, resulting in significant computational costs. Although recent works, such as MobileNet and ShuffleNet, have introduced deep convolution or shuffling operations to build efficient CNNs using smaller convolutional kernels (floating-point operations), the remaining 1*1 convolutional layers still consume a large amount of memory and FLOPs.
[0156] Since there is a lot of redundancy in the intermediate feature maps calculated by mainstream CNNs, the solution of this invention proposes to reduce the resources required, namely the convolutional kernels used to generate them.
[0157] Intrinsic feature maps are obtained using conventional convolution. , For the input feature map, Use a regular convolution kernel; for each channel of Y, use... The operation generates a Ghost feature map. , , ,in, intrinsic feature map The feature map of the i-th channel, This is a linear transformation operation used to generate Ghost feature maps. For the reason pass The j-th Ghost feature map generated by the operation Represents intrinsic feature map There are m channels in total. Represents each intrinsic feature map pass Generate s Ghost feature maps; concatenate the obtained intrinsic feature maps and Ghost feature maps to obtain the final result Output.
[0158] The Ghost Module operates in two steps to obtain the same number of feature maps as a regular convolution:
[0159] Step 1: Use fewer convolutions (for example, instead of the usual 128 convolution kernels, use 64 to reduce the computation by half).
[0160] Step 2: Cheap operations, represented by Φ in the diagram. Φ is a convolution such as 3×3 or 5×5, and it is a convolution performed on each feature map (Depth-wise convolution).
[0161] S203. The training parameter configuration includes the following: dataset division: 2100 training images, 600 validation images, and 300 test images (60% of which are low-light scenes).
[0162] Loss function: CIoU loss (localization error) + FocalLoss (class imbalance) + edge perception loss (extracting defect edges through the Canny operator and calculating the overlap loss between the predicted box and the edge).
[0163] Optimizer: AdamW (initial learning rate 0.0001, weight decay 0.0005), using cosine annealing learning rate (T). max =200, η min =0.00001);
[0164] Training strategy: BatchSize=16 (8 NVIDIA RTX3090s), 200 training rounds, evaluation with a validation set every 20 rounds (monitoring mAP@0.5 and false negative rate), stop early if there is no improvement after 50 rounds.
[0165] In an embodiment of the present invention, step S300 involves performing hybrid quantization on the trained InsYOLO model and deploying edge testing, including the following steps S301-S302:
[0166] S301. Use TensorRT 8.6 to perform INT8 hybrid quantization on the trained model. Select 500 low-light scene images from the training set and perform the same enhancement and super-resolution operations as in preprocessing, including the following steps C1-C4:
[0167] C1. Perform INT8 mixed quantization on the trained model using TensorRT 8.6:
[0168] C2, Calibration Set: Select 500 low-light scene images (including various defects) from the training set and perform the same enhancement-super-resolution operation as the preprocessing;
[0169] C3. Quantization process: Set the calibration method to KL divergence (threshold 1.4), quantize the model's convolutional and activation layers, and retain only the BatchNorm layer with FP32 accuracy to ensure that the accuracy loss is ≤2%;
[0170] C4. Output: After quantization, the model size is compressed from 15MB to 3.8MB, and the inference computation is reduced by 60%.
[0171] In an optional embodiment, the hybrid quantization of the S301 can use Intel's OpenVINO™ toolkit instead of TensorRT, whose model optimizer and inference engine support INT8 quantization. Similarly, 500 enhanced and super-resolution images of low-light scenes are selected from the training set as the calibration dataset. Using OpenVINO's precision calibration tool, the DefaultQuantization algorithm (a fast-slow hybrid calibration method based on activation value distribution) is used by default for INT8 quantization. Sensitive layers such as BatchNorm are retained at FP16 or FP32 precision. The output generates a quantized IR model file, achieving model compression and acceleration.
[0172] In another optional embodiment, the hybrid quantization of S301 can be achieved by using the INT8 post-training quantization scheme of TensorFlow Lite if the original training framework is TensorFlow or the model can be converted to TensorFlow format; the 500 processed low-light images are used as a representative dataset; the trained FP32 model is loaded using TFLiteConverter, the optimization method is specified as OPTIMIZE_FOR_SIZE, and a representative dataset generator is provided. The tool will automatically quantize the weights and activation values to INT8 (some operations may retain FP32); the output generates a quantized model file with the .tflite extension, suitable for deployment on mobile and edge devices.
[0173] S302, Deploy edge testing, including the following steps D1-D5:
[0174] D1. Set the calibration method to KL divergence, set the threshold to 1.4, quantize the model's convolutional and activation layers, retain only the BatchNorm layer with FP32 precision, compress the model volume after quantization, deploy the quantized model to JetsonOrinNX, and input a 1080P low-light insulator video stream.
[0175] D2. Deploy the quantization model to JetsonOrinNX (drone edge device):
[0176] D3. Environment configuration: Install JetPack 5.1.1 (including CUDA 11.4 and TensorRT 8.6) and configure a 4-thread inference pool (CPU+GPU collaborative scheduling).
[0177] D4. Performance Test: Input 1080P low-light insulator video stream (30FPS), measured frame rate 27FPS, single frame inference latency 38ms, power consumption 5.2W;
[0178] D5. Accuracy verification: On the test set, mAP@0.5 reached 90.3%, and the false negative rate of small-sized defects (<5mm) was 8%, which is only 1.2% lower than that of the unquantized model.
[0179] In an optional embodiment, the deployment edge testing of the S302 can use Intel's OpenVINO™ toolkit to convert the trained PyTorch or ONNX format InsYOLO model to OpenVINO's intermediate representation (IR) format. During this process, INT8 quantization is performed using OpenVINO's Post-Training Optimization Tool, and the calibration set uses the same 500 low-light scene images as in the original scheme. An industrial-grade embedded device equipped with an Intel® Core™ i5 / i7 processor is selected as the deployment hardware. The OpenVINO runtime environment is installed on the device, and optimized for the CPU instruction set. A C++ application is written using OpenVINO's Inference Engine API to load the optimized IR model. The number of inference threads is set to be tied to the number of CPU cores, and the CPU's asynchronous inference capability is utilized to improve throughput. A 1080P low-light insulator video stream is input, and the CPU performs video decoding and model inference, measuring the frame rate, latency, and power consumption. The mAP@0.5 and false negative rate of the quantized model are verified on the same test set to evaluate the accuracy loss.
[0180] In summary, the core idea of this invention is to construct an end-to-end integrated framework of "low-light enhancement - lightweight super-resolution - collaborative detection", which solves three major problems of "low-light noise interference, loss of small-size defect features, and insufficient real-time performance of edge deployment" through feature collaboration between modules.
[0181] The core is: First, enhanced-super-resolution collaborative preprocessing is used to improve the Retinex algorithm to separate the illumination and reflection components of low-light images, BM3D is used to denoise and suppress noise in the reflection component, and then the defect features are amplified through adaptive gain adjustment; the denoised reflection component is used as a constraint term to improve the MobileSR-L model, so that the super-resolution process focuses on the defect area (rather than the background), solving the problem of loss of small-sized defect features. Compared with independent super-resolution, the sharpness of the defect edge after reconstruction is improved by 60%, and the number of pixels increases from <20 to ≥80.
[0182] Second, a super-resolution-detection feature fusion network is designed using the InsYOLO model: a "super-resolution feature fusion layer" is added on the basis of YOLOv8n, which splices the high-resolution features (1280×960) output by the super-resolution network with the P2 shallow features (200×200) of the detection network to enhance the fine-grained features of small-sized defects; at the same time, a 200×200 shallow detection surface is specially set up (one scale higher than the P3 surface of the traditional YOLOv8n), so that micro-cracks <5mm can be captured by the 16×16 grid, solving the problem of missed detection of small targets.
[0183] Thirdly, lightweight deployment optimization is achieved by replacing the traditional super-resolution model with MobileSR-L (0.25M parameters) and using GhostConv lightweight convolution in InsYOLO (1.2M parameters), combined with TensorRTINT8 quantization, to compress the overall model to 3.8MB. This enables real-time inference of 1080P video stream at 25FPS on JetsonOrinNX, with a power consumption of ≤6W, meeting the computing power and battery life requirements of UAV inspection.
[0184] Through a three-level design of "preprocessing collaboration - feature fusion - lightweight optimization", this invention achieves a mAP@0.5 of 90.3% in low-light (illuminance 100-5000 lux) and small-sized defect (<5mm) scenarios, which is 12% higher than the existing YOLOv5s. The false negative rate is reduced from 35% to 8%, breaking through the inherent bottleneck of traditional technology "unclear in low light, difficult to identify small defects, and difficult to track edges".
[0185] Example 3, referring to Figures 4-9 This invention provides a method for detecting defects in small-sized insulators. To verify the beneficial effects of this invention, scientific demonstration is conducted through experiments.
[0186] Experiment 1: Low-light enhancement process:
[0187] 1. Improved Retinex decomposition: Dynamically select the Gaussian kernel based on image brightness (σ=10, 20, 30 in low light, extended to 5, 40 in extreme low light) to separate the reflection component and illumination component containing defect details;
[0188] 2. Layered BM3D denoising: First, coarse denoising is performed on the reflection component using 16×16 blocks, and then fine denoising is performed on high-frequency areas such as defect edges using 8×8 blocks to reduce noise while preserving details.
[0189] 3. Defect-oriented gain: Find potential defect areas by grayscale distribution, apply a gain coefficient of α=2.0 to the defect areas, limit α to 1.3 for the background area to avoid amplifying background noise, and finally add an offset of β=25 to adjust the overall brightness.
[0190] Experimental results: After processing, the original low-light image (SNR=16dB, gray level difference between defect and background 12) showed that the SNR was increased to 34dB, the gray level difference between defect and background increased to 45, and the proportion of noise pixels decreased from 14% to 2.1%. Under extreme low light (illuminance <100 lux), the SNR was still maintained at ≥28dB, the defect edges were clearly distinguishable, and there were no obvious noise spots.
[0191] Experiment 2: Lightweight Super-resolution Procedure:
[0192] 1. MobileSR-L model optimization: Replace standard convolution with depthwise separable convolution, compress parameters to 0.25M, and adapt to edge devices;
[0193] 2. Enhanced feature constraints: The reflection component after dim light enhancement is used as a "supervision signal". In the super-resolution training, the similarity loss between this component and the super-resolution result (weight 0.3) is added to guide the model to focus on reproducing the details of the defects;
[0194] 3. Edge Preservation Post-processing: Apply guided filtering (radius 2 pixels) to the super-resolution output image to enhance the sharpness of defect edges.
[0195] Experimental results: After reconstructing a 320×240 low-resolution image to 1280×960: the number of pixels for small defects (<5mm) increased from 18 to 92, the edge gradient value improved by 65%, and the texture retention rate reached 92%; the single-frame reconstruction time was 12.3ms, which is 3 times faster than ESRGAN (45ms) and improves the detail restoration by 15% compared with the unconstrained MobileSR.
[0196] Experiment 3: InsYOLO Detection Process:
[0197] 1. Super-resolution feature fusion: The super-resolution high-resolution image is downsampled to 200×200 and concatenated with the features of the model's P2 layer through channel attention weighting (to make the model pay more attention to the detailed features brought by super-resolution).
[0198] 2. Small target detection head design: Add a 16×16 anchor point grid to the P2 layer. The anchor frame size is adapted to 6×6, 8×8, and 10×10 (corresponding to defects <5mm). Dynamically adjust the IOU threshold (set to 0.4 for small defects to avoid missed detection).
[0199] Experimental results: For small defects (<5mm), the mAP@0.5 improved from 76.2% in the traditional YOLOv8n to 96.178%, the localization error decreased from 4.8mm to 1.9mm, the candidate box recall improved from 65% to 92.059%, and the detection rate of occluded (30% occlusion rate) defects improved by 28% compared with the original model.
[0200] Experiment 4: INT8 Quantization Deployment Process:
[0201] 1. Layered quantization: Mark the "critical layers" related to small defects such as P2 and P3, and calibrate them with KL divergence (control KL value < 1.35); other layers are calibrated with MinMax, retaining the FP32 accuracy of BatchNorm layers;
[0202] 2. Edge scheduling: JetsonOrinNX is equipped with a 4-thread pool (2 threads for preprocessing, 1 thread for inference, and 1 thread for postprocessing). GPU computing power is prioritized for the inference thread, and the power consumption is limited to a maximum of 6W.
[0203] Experimental results: Compared with FP32 model and traditional quantization: 1080P video stream frame rate 27FPS (FP32 is 15FPS, traditional quantization is 24FPS), latency 38ms (FP32 is 68ms); model size 3.8MB (FP32 is 15MB); mAP@0.5 only decreased by 1.2% (traditional quantization decreased by 2.8%), power consumption 5.2W (FP32 is 7.8W).
[0204] In addition, such as Figure 8 As shown, this is a graph illustrating the convergence parameter improvement effect of the insulator defect detection model under low light conditions during the last 30 rounds of training after 200 rounds.
[0205] We can see that the loss value keeps decreasing, the average precision keeps increasing, eventually converging to 0.9625, the recall keeps increasing, eventually converging to 0.92059, and the MAP50 keeps increasing, eventually converging to 0.96178.
[0206] like Figure 9 As shown, the precision and recall are close to 1, and the map@50 is 0.962, which are excellent and relatively high-level parameters in the field of low-light and dark-light small target defect detection.
[0207] Example 4 is an embodiment of the present invention, and the above is an illustrative scheme of a method for detecting defects in small-sized insulators. It should be noted that the technical solution of a small-sized insulator defect detection system and the technical solution of the above-described small-sized insulator defect detection method belong to the same concept. Details not described in detail in the technical solution of the small-sized insulator defect detection system in this embodiment can be found in the description of the technical solution of the above-described small-sized insulator defect detection method.
[0208] This embodiment provides a small-sized insulator defect detection system, including: a data acquisition module, a model building module, and a quantization module;
[0209] The acquisition module acquires raw low-light images and performs preprocessing.
[0210] The model building module builds an InsYOLO model, trains the model, and configures the training parameters.
[0211] The quantization module performs hybrid quantization on the trained InsYOLO model and deploys edge testing.
[0212] This embodiment also provides an electronic device applicable to a method for detecting defects in small-sized insulators, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement a method for detecting defects in small-sized insulators as proposed in the above embodiment.
[0213] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements a method for detecting small-sized insulator defects as proposed in the above embodiments.
[0214] The storage medium proposed in this embodiment belongs to the same inventive concept as the method for detecting defects in small-sized insulators proposed in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0215] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0216] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for detecting defects in small-sized insulators, characterized in that: include, Acquire raw low-light images and perform preprocessing; Build an InsYOLO model and train and configure the training parameters; Perform hybrid quantization on the trained InsYOLO model and deploy edge testing.
2. The method for detecting defects in small-sized insulators as described in claim 1, characterized in that: The acquisition of raw low-light images includes selecting an acquisition device and acquiring raw low-light images of the transmission line; Set the device acquisition parameters and perform full scene coverage acquisition through scene planning; Sample annotation is performed on the original low-light images.
3. The method for detecting defects in small-sized insulators as described in claim 2, characterized in that: The preprocessing includes enhancing the original low-light image; Lightweight super-resolution reconstruction is performed on the enhanced image to obtain a super-resolution image. The reconstructed super-resolution image is then enhanced again.
4. The method for detecting defects in small-sized insulators as described in claim 3, characterized in that: The lightweight super-resolution reconstruction of images includes building a MobileSR-L model; The enhanced low-resolution image is input into the MobileSR-L model for super-resolution processing. Image augmentation is performed on the super-resolution images to expand the training samples to cover multiple interference scenarios.
5. The method for detecting defects in small-sized insulators as described in claim 4, characterized in that: The construction of the InsYOLO model includes using YOLOv8n as the basic architecture: Backbone replaces the traditional Conv convolution with GhostConv; Neck adds a super-resolution feature fusion layer, which downsamples the features output by the super-resolution and concatenates them with the P2 output layer features in YOLOv8n to fuse high-resolution details. Head retains the conventional detection surfaces from P3 to P5 output layers in YOLOv8n, adds a shallow detection surface P2, and uses anchor point mesh to capture small targets. Super-resolution feature fusion downsamples the features output by super-resolution and concatenates them with the features of layer P2 to fuse high-resolution details. The result is then output to the detection head and fed into the loss function to determine the model's convergence status. Intrinsic feature maps are obtained using conventional convolution. , For the input feature map, Use a regular convolution kernel; for each channel of Y, use... The operation generates a Ghost feature map. , , ,in, intrinsic feature map The feature map of the i-th channel, This is a linear transformation operation used to generate Ghost feature maps. For the reason pass The j-th Ghost feature map generated by the operation Represents intrinsic feature map There are m channels in total. Represents each intrinsic feature map pass Generate s Ghost feature maps; concatenate the obtained intrinsic feature maps and Ghost feature maps to obtain the final result Output. The training parameter configuration includes dividing the dataset into a training set, a validation set, and a test set; The loss functions are CIoU loss of localization error, Focal Loss, and edge perception loss. Defect edges are extracted by the Canny operator, and the overlap loss between the predicted box and the edge is calculated. The optimizer is AdamW, the initial learning rate is set to 0.0001, the weight decay is set to 0.0005, and cosine annealing learning rate is used. The training strategy is Batch Size=16, training for 200 rounds, evaluating with a validation set every 20 rounds, and stopping early if there is no improvement after 50 rounds.
6. The method for detecting defects in small-sized insulators as described in claim 5, characterized in that: The hybrid quantization includes performing INT8 hybrid quantization on the trained model using TensorRT 8.6, selecting 500 low-light scene images from the training set, and performing the same enhancement and super-resolution operations as the preprocessing. The calibration method was set to KL divergence, and the threshold was set to 1.
4. The convolutional and activation layers of the model were quantized, and only the BatchNorm layer was kept at FP32 precision. The model volume was compressed after quantization, and the quantized model was deployed to Jetson Orin NX with a 1080P low-light insulator video stream as input.
7. The method for detecting defects in small-sized insulators as described in claim 6, characterized in that: The enhancement of the original low-light image includes decomposition and denoising using an improved Retinex method to restore the original low-light image. As input, after normalization, the average brightness of the image is first calculated. Reflects light intensity: in, , For the image height and width; according to Adjust σ, where σ is the appropriate low-light intensity. When σ is less than 0.2, the value of σ is {5, 20, 40}, which expands the scale range and enhances the extraction of details in low light. When 0.2 ≤ <0.5, σ = {10, 20, 30}; Illumination Components The calculation is as follows: in, The dynamically adjusted Gaussian kernel, reflection component The calculation is as follows: For the reflection component Layered processing combining coarse and fine denoising is employed. The switching block BM3D size is set to 16×16, and the inter-block similarity threshold T1=10 is calculated. When the similarity is less than... These are considered similar blocks, and collaborative filtering is performed on them: Locating high-frequency detail regions using gradient operator G: When E(x,y)>20, it is determined to be a high-frequency detail region, the switching block size is 8×8, and the similarity threshold is set to [value missing]. =5, perform secondary noise reduction: If E(x,y)>20, then Other areas ; Calculate the grayscale histogram of the denoised reflection component R to locate the defect region and the background region. Amplify the grayscale difference between the defect and the background using an adaptive gain function to output an enhanced image.
8. A small-size insulator defect detection system, employing the small-size insulator defect detection method as described in any one of claims 1 to 7, characterized in that, include: Data acquisition module, model building module, quantization module; The acquisition module acquires raw low-light images and performs preprocessing. The model building module builds an InsYOLO model, trains the model, and configures the training parameters. The quantization module performs hybrid quantization on the trained InsYOLO model and deploys edge testing.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for detecting small-sized insulator defects according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for detecting defects in small-sized insulators according to any one of claims 1 to 7.