Insulation rod defect detection method, device, equipment and medium
By automatically generating defect categories and grade labels, the problem of low detection efficiency of insulating rods was solved, and efficient defect detection was achieved.
Patent Information
- Application Number
- CN202611124603.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-11-20
AI Technical Summary
Existing technologies for detecting defects in insulating rods are inefficient and cannot meet the needs of large-scale rapid detection. This is mainly due to the complexity of the labeling process for defect categories and levels, which requires a high degree of human intervention.
By identifying insulating rod sample images, candidate defect features are generated, and defect category and level labels are automatically generated using pseudo-labeling technology. Combined with a pre-set defect type feature library, hierarchical feature extraction is performed to train the insulating rod defect detection model, and the defect category and level are directly output.
This reduces repetitive manual labeling processes, improves the efficiency of insulating rod defect detection, simplifies the detection process, and increases detection efficiency.
Smart Images

Figure CN123141304A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power equipment testing technology, and in particular to a method, device, equipment and medium for detecting defects in insulating rods. Background Technology
[0002] Insulating poles are commonly used safety tools in electrical work, and their insulation performance and appearance directly affect operational safety. During long-term use, transportation, and storage, the surface and joints of insulating poles are prone to defects such as cracks, damage, dirt, burning, moisture, and aging. If these defects are not detected in time, they may affect the insulation and mechanical properties of the insulating pole; therefore, defect detection of insulating poles is necessary.
[0003] In existing technologies, defect detection in insulating rods typically relies on manually labeling a large number of samples and combining this with manually defined defect categories and levels for model training or detection analysis. Because the grading standards for different types of defects vary—for example, crack defects usually require grading based on crack length, width, and continuity; contamination defects usually require grading based on the extent of contamination coverage, color intensity, and distribution continuity; and ablation defects usually require grading based on the ablation area, degree of carbonization, and extent of surface texture damage—these are all important considerations.
[0004] Therefore, defect categories and defect levels often need to be labeled and confirmed separately, which leads to a complex data preparation process, a high degree of human involvement, and a long time-consuming model training and detection process. As a result, the efficiency of insulation rod defect detection is low, making it difficult to meet the application requirements of rapid detection of large-scale insulation rods. Summary of the Invention
[0005] This invention provides a method, apparatus, equipment, and medium for detecting defects in insulating rods, which can solve the technical problem of low efficiency in detecting defects in insulating rods in the prior art.
[0006] In a first aspect, embodiments of the present invention provide a method for detecting defects in an insulating rod, comprising: The acquired images of insulating rod samples are identified to obtain the features of each candidate defect; Label mapping is performed on each of the candidate defect features to obtain pseudo-labels for each defect category; For each of the defect category pseudo-labels, the corresponding grading indicators are called from the preset defect type feature library, and the candidate defect features are extracted based on each of the grading indicators to obtain the defect grading features corresponding to each defect category pseudo-label. Perform level mapping on each defect classification feature corresponding to each defect category pseudo-label to obtain each defect level pseudo-label. Based on the pseudo-labels of each defect category and each defect level, an insulating rod defect detection model is trained to output the defect category and defect level in the image of the insulating rod to be detected.
[0007] Secondly, embodiments of the present invention provide an insulating rod defect detection device, comprising: The defect identification module is used to identify the acquired insulating rod sample images and obtain the features of each candidate defect; The label mapping module is used to perform label mapping on each of the candidate defect features to obtain pseudo-labels for each defect category. The hierarchical feature extraction module is used to call up the hierarchical indicators corresponding to the defect category pseudo-labels from the preset defect type feature library for each defect category pseudo-label, and perform hierarchical feature extraction on the candidate defect features based on each hierarchical indicator to obtain the defect hierarchical features corresponding to each defect category pseudo-label. The grade mapping module is used to perform grade mapping on each defect grade feature corresponding to each defect category pseudo-label to obtain each defect grade pseudo-label. The detection module is used to train an insulating rod defect detection model based on the pseudo-labels of each defect category and each defect level, so as to output the defect category and defect level in the image of the insulating rod to be detected through the trained insulating rod defect detection model.
[0008] Thirdly, embodiments of the present invention also provide a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in any one of the embodiments of the present invention.
[0009] Fourthly, embodiments of the present invention also provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the method described in any one of the embodiments of the present invention.
[0010] The present invention first identifies candidate defect features from the sample image of the insulating rod, then maps these features to generate pseudo-labels for each defect category. This eliminates the need for extensive manual labeling of defect categories during model training. Furthermore, for each pseudo-label, corresponding grading indicators are retrieved from a pre-defined defect type feature library, and defect grading features are extracted according to these indicators. This allows different defect categories to generate pseudo-labels for their respective defect morphologies, further reducing the need for extensive manual labeling. Finally, the insulating rod defect detection model is trained using the pseudo-labels for each defect category and each defect level. The trained model can then directly output the defect category and defect level from the image of the insulating rod to be detected. Therefore, this invention reduces the repetitive processing of labeling and judging defect categories and levels separately, lowers the level of manual intervention, simplifies the insulating rod defect detection process, and improves the efficiency of insulating rod defect detection.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of the invention. Wherein: Figure 1 This is a flowchart of an embodiment of the method for detecting defects in insulating rods according to the present invention; Figure 2 This is a structural block diagram of an insulating rod defect detection device according to an embodiment of the present invention; Figure 3 This is a schematic block diagram of a computer device used to implement the methods of the embodiments of the present invention. Detailed Implementation
[0013] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0014] This invention provides a method, apparatus, device, and medium for detecting defects in insulating rods. The entity executing this method can be the insulating rod defect detection device provided in this invention, or a computer device integrating the insulating rod defect detection device. The insulating rod defect detection device can be implemented in hardware or software, and the computer device can be a terminal or a server.
[0015] In a specific application scenario, power equipment operation and maintenance companies or departments need to conduct visual defect inspections on a batch of insulating poles before they are put into storage. This method is applied to the company's or department's insulating pole inspection and management platform. First, sample images of multiple insulating poles are acquired using image acquisition equipment. The sample images include image areas such as the pole surface, end connectors, and gripping areas. Subsequently, the insulating pole sample images are identified to extract candidate defect features suspected of having cracks, dirt, ablation, or damage.
[0016] Next, label mapping is performed on each candidate defect feature to obtain the corresponding defect category pseudo-labels. For example, candidate defect features with thin, elongated linear texture features are mapped to crack-type defect pseudo-labels, candidate defect features with local dark carbonization textures are mapped to ablation-type defect pseudo-labels, and candidate defect features with patchy color differences and coverage distribution features are mapped to dirt-type defect pseudo-labels.
[0017] After obtaining the pseudo-labels for defect categories, corresponding grading indicators are retrieved from a pre-defined defect type feature library for each pseudo-label. For example, for crack-type defect pseudo-labels, grading indicators such as crack length, crack width, and crack continuity are retrieved; for ablation-type defect pseudo-labels, grading indicators such as ablation area, carbonization color characteristics, and texture damage degree are retrieved; and for contamination-type defect pseudo-labels, grading indicators such as contamination coverage, color difference, and distribution continuity are retrieved. Then, based on each grading indicator, grading feature extraction is performed on the candidate defect features to obtain the defect grading features corresponding to each type of defect.
[0018] Furthermore, a grade mapping is performed on the defect grading features under the same defect category pseudo-label to obtain defect grade pseudo-labels. For example, candidate defects with short crack lengths and low continuity are mapped to a minor grade, while candidate defects with large ablation areas and obvious carbonization textures are mapped to a severe grade. Finally, the defect category pseudo-labels and defect grade pseudo-labels are used to train the insulation rod defect detection model. The image of the insulation rod to be detected is used as the input to the trained insulation rod defect detection model, and the model outputs the defect category and defect grade in the image of the insulation rod to be detected. Subsequently, power equipment operation and maintenance companies or departments can classify, manage, accept, and make maintenance and replacement decisions for insulation rods based on the output defect category and defect grade. For example, insulation rods with a detection result of minor contamination defects can be cleaned and put back into use; insulation rods with a detection result of severe cracks or severe ablation defects can be directly identified as unqualified products and scrapped or reworked, thereby reducing the workload of manual item-by-item analysis and grade determination, and improving the efficiency of insulation rod defect detection and operation and maintenance management.
[0019] Figure 1 This is a flowchart of an embodiment of the method for detecting defects in insulating rods according to the present invention.
[0020] like Figure 1 As shown, the method for detecting defects in an insulating rod may include: S110: Identify the acquired insulating rod sample image to obtain the features of each candidate defect.
[0021] For example, candidate defect features refer to image features extracted from image regions in an image of an insulating rod sample that are suspected of having defects. Candidate defect features may include color features, texture features, edge features, morphological features, and depth semantic features. For instance, when thin, dark lines appear on the surface of the insulating rod, crack candidate defect features can be extracted from that region; when localized black carbonization marks appear on the surface of the insulating rod, ablation candidate defect features can be extracted from that region.
[0022] In this example, images of the insulating rod sample can be acquired using an industrial camera, a mobile inspection terminal, a fixed image acquisition device, or an inspection robot. During image acquisition, the insulating rod can be positioned within a preset shooting area, and images of the rod's surface, end connectors, gripping area, and marking area can be captured. The acquired images can be normalized in size, corrected for brightness, suppressed for noise, and cropped to obtain an insulating rod sample image suitable for subsequent recognition processing.
[0023] In this example, candidate defect features can be obtained through the following methods: Specifically, object detection based on convolutional neural networks: using a trained detection model (such as Faster R-CNN (Faster Region-based Convolutional Neural Network) or YOLO (You Only Look Once) series), the defect region is located by bounding boxes and its high-dimensional semantic features are extracted. Attention mapping based on visual transformers: using a self-attention mechanism to capture the global correlation of the image and extracting features of abnormal regions with significant attention weights. Traditional morphological extraction based on image edge and texture analysis: using Gabor filters to perform multi-scale texture analysis on the image and extract irregular texture pattern features. Mask extraction based on semantic segmentation: extracting defect mask regions through pixel-level segmentation networks (such as DeepLab (Deep Labeling) or U-Net (U-shaped Network)) and mapping them to spatial feature vectors.
[0024] In one implementation, the acquired image of the insulating rod sample is identified to obtain various candidate defect features, including: The pre-trained teacher network extracts features from the insulating rod sample images to obtain the first sample features, and the pre-trained student network extracts features from the insulating rod sample images to obtain the second sample features. Based on the similarity values between each first sample feature and each second sample feature, anomaly screening is performed on each second sample feature to obtain each anomalous sample feature; Anomaly response maps corresponding to insulating rod sample images are generated based on the features of each anomaly sample. By filtering the abnormal response map, candidate defect regions are obtained. Based on each candidate defect region, the features of each candidate defect are extracted from the insulating rod sample image.
[0025] For example, the teacher network refers to the feature extraction network used to extract reference features from the sample image of the insulating rod. The student network refers to the feature extraction network used to learn the feature representation of a normal insulating rod image. The teacher network can employ a convolutional neural network, a visual Transformer network, or a self-supervised visual network pre-trained on large-scale image data; the student network can employ the same or different feature extraction structure as the teacher network and be trained using normal insulating rod sample images, enabling the student network to learn the feature distribution corresponding to the surface of a normal insulating rod.
[0026] In this example, the teacher network may include an input layer, a feature encoding layer, and a multi-scale feature output layer. The input layer receives a normalized image of the insulating rod sample; the feature encoding layer extracts visual features such as rod texture, edges, and color variations; and the multi-scale feature output layer outputs image features at different scales. The student network may include an input layer, a feature encoding layer, and a feature reconstruction layer. The feature reconstruction layer outputs student features that match the scale of the teacher network. When training the student network, normal insulating rod sample images can be input into both the teacher and student networks, and the features output by the student network are constrained to be close to those output by the teacher network. After training, when abnormal areas such as cracks, ablation, or dirt exist in the input image, the student network's feature representation of these abnormal areas will differ from the reference features output by the teacher network. This difference can be used to locate candidate defect areas.
[0027] For example, the first sample feature refers to the reference image features obtained by the teacher network from the feature extraction of the insulating rod sample image. The second sample feature refers to the image features to be compared obtained by the student network from the feature extraction of the same insulating rod sample image. The first and second sample features can be local feature vectors in a multi-scale feature map, or they can be pixel-level or block-level features corresponding to different locations within the main body region of the insulating rod.
[0028] In this example, the insulating rod sample image can first be adjusted to a preset input size (e.g., 224×224, 256×256, or 512×512) and input into the teacher network to obtain the first sample features of the insulating rod sample image at different feature layers. Simultaneously, the same insulating rod sample image is input into the student network to obtain the second sample features corresponding to each of the first sample features. Then, the first and second sample features at the same image location or the same feature block location are correlated. For example, for a certain region in the middle of the insulating rod, the teacher network outputs the reference texture features of that region, and the student network outputs the texture features to be compared in that region; both are used for subsequent similarity calculations.
[0029] For example, anomaly sample features refer to second sample features that differ from the appearance features of normal insulating rods. Anomaly sample features typically correspond to image areas in insulating rod sample images that appear to have cracks, damage, dirt, ablation, dampness, aging, or abnormal connections.
[0030] In this example, the similarity value between each first sample feature and its corresponding second sample feature can be calculated. The similarity value can be calculated using cosine similarity, Euclidean distance transformed similarity, Manhattan distance transformed similarity, or feature dot product similarity. For example, the first and second sample features corresponding to the same image location can be normalized, and the cosine similarity between the normalized first and second sample features can be calculated as the similarity value for that image location.
[0031] Anomaly screening of the second sample features is performed based on similarity values. When the similarity value between the first and second sample features corresponding to a certain image location meets a preset anomaly condition, the second sample feature corresponding to that location is identified as an anomalous sample feature. For example, the first and second sample features of a normal insulating rod body area have relatively consistent similarity, while the second sample feature of a cracked area shows a significant difference from the reference feature output by the teacher network due to abrupt texture changes. Therefore, the second sample feature corresponding to this cracked area can be screened as an anomalous sample feature.
[0032] In this example, preset abnormal conditions are set, such as the similarity value being less than the preset similarity threshold (e.g., a value of 0.85); or the difference score corresponding to the similarity value being greater than the preset difference threshold (e.g., a value of 0.82).
[0033] For example, an anomaly response map refers to an image or feature map used to represent the degree of abnormal response at each image location in an image of an insulating rod sample. The anomaly response map can be generated from the similarity difference value, feature distance value, or anomaly score corresponding to each image location, with the area containing the abnormal response value corresponding to a suspected defect area.
[0034] In this example, the anomaly scores corresponding to the features of each abnormal sample can be mapped back to the spatial location of the insulating rod sample image to generate an anomaly response map. Subsequently, the anomaly response map is used for region filtering to obtain candidate defect regions. Region filtering can include response value filtering, connected component analysis, bounding box generation, and region merging. For example, when a continuous response region extending along the rod's axial direction exists in the anomaly response map, it can be identified as a candidate crack region through connected component analysis; when a localized blocky anomaly response region exists near the end connector, it can be identified as a candidate ablation region or a candidate connection anomaly region.
[0035] In this example, candidate defect features are extracted from the insulating rod sample image based on each candidate defect region. Specifically, the insulating rod sample image can be cropped according to the position of the candidate defect region in the insulating rod sample image to obtain candidate defect image blocks; texture, color, edge, and morphological features are extracted from the candidate defect image blocks to obtain candidate defect features; or the candidate defect image blocks can be input into a feature extraction network to obtain depth features, and then the extracted features can be used as candidate defect features. For example, for candidate crack regions, linear edge features, gray-scale abrupt change features, and elongated morphological features can be extracted; for candidate contamination regions, color difference features, coverage area features, and texture distribution features can be extracted; for candidate ablation regions, dark carbonization features, local texture destruction features, and region boundary diffusion features can be extracted.
[0036] According to the above implementation method, feature extraction is performed on the insulating rod sample image through both teacher and student networks, and an anomaly response map is generated using the feature differences between the two. This allows for the localization of suspected defect areas when manual labeling of defect categories is insufficient. Furthermore, candidate defect features are extracted from the candidate defect areas, converting the entire insulating rod sample image into a local feature representation focused on the defect areas. This provides a data foundation for subsequent generation of defect category pseudo-labels, defect classification feature extraction, and defect level pseudo-label generation. This process reduces the reliance on manual labeling of defect areas and defect categories, thus improving the training and detection efficiency of the insulating rod defect detection model.
[0037] S120: Label mapping is performed on each candidate defect feature to obtain pseudo-labels for each defect category.
[0038] For example, a defect category pseudo-label refers to a defect category label automatically generated based on the matching relationship between candidate defect features and preset category features. These pseudo-labels are not manually labeled one by one, but rather obtained through feature clustering and label mapping. For instance, defect category pseudo-labels may include pseudo-labels for cracks, dirt, ablation, damage, dampness, aging, and abnormal connections.
[0039] In one implementation, label mapping is performed on each candidate defect feature to obtain pseudo-labels for each defect category, including: Clustering is performed on each candidate defect feature to obtain each candidate defect feature cluster; For each candidate defect feature cluster, the candidate defect features in the cluster are normalized, and the cluster center features of the candidate defect feature cluster are determined based on the mean of the normalized candidate defect features. The similarity between the cluster center features and the pre-defined prototype features of each category is calculated to obtain various similarity values; The category label associated with the category prototype feature corresponding to the maximum value among each similarity value is determined as the defect category pseudo label corresponding to the candidate defect feature cluster, so as to obtain the pseudo label of each defect category.
[0040] For example, a candidate defect feature cluster refers to a set of features composed of candidate defect features that are similar in appearance, color distribution, texture variation, or depth semantic expression. For instance, multiple candidate defect features with elongated linear textures and abrupt edge changes can form a crack candidate defect feature cluster; multiple candidate defect features with flaky color differences and coverage distribution can form a dirt candidate defect feature cluster; and multiple candidate defect features with dark carbonized textures and local texture destruction can form an ablation candidate defect feature cluster.
[0041] For example, K-means clustering, density clustering, hierarchical clustering, or Gaussian mixture clustering can be used to cluster the various candidate defect features.
[0042] This example uses K-means clustering as an example. Specifically, firstly, each candidate defect feature is vectorized, representing each candidate defect feature as a feature vector of uniform dimension. Then, the number of cluster categories is set, which can be determined based on the preset number of defect categories, such as cracks, dirt, ablation, damage, dampness, aging, and abnormal joints. Subsequently, cluster centers are initialized from each candidate defect feature, and each candidate defect feature is assigned to its corresponding cluster center based on the distance between each candidate defect feature and the cluster center. Then, the cluster centers are updated based on the candidate defect features corresponding to each cluster center until the cluster centers meet the convergence condition, resulting in each cluster of candidate defect features.
[0043] For example, for any candidate defect feature cluster, firstly, the individual candidate defect features within the cluster are read; then, each candidate defect feature is normalized to ensure that features of different dimensions are within a uniform value range; finally, the mean of each normalized candidate defect feature is calculated according to its feature dimension to obtain the cluster center feature of the candidate defect feature cluster. The cluster center feature is used to characterize the overall appearance features of the candidate defect feature cluster. For example, for a crack candidate defect feature cluster, the cluster center feature can reflect common features of this type of candidate defect, such as elongated edges, abrupt changes in grayscale, and linear textures.
[0044] For example, category prototype features refer to category reference features pre-constructed for various types of insulation rod defects. Category prototype features can originate from the feature mean of a small number of typical defect samples, manually defined defect category descriptive features, or category reference features extracted by a pre-trained visual model. For instance, crack category prototype features may include features such as elongated linear edges, local grayscale abrupt changes, and directional continuity; dirt category prototype features may include features such as sheet-like coverage, color shift, and surface texture occlusion; ablation category prototype features may include features such as dark carbonized areas, edge diffusion, and local texture destruction; and damage category prototype features may include features such as notched edges, local material loss, and irregular contours.
[0045] In this example, the pre-defined prototype features for each category can be stored in a category prototype library. The category prototype library can include a category label field and a category prototype feature field. The category label field can include labels such as crack, dirt, ablation, damage, dampness, aging, and abnormal connection. The category prototype feature field is used to store the category prototype feature vector for the corresponding category.
[0046] In this example, prototype features for each category are first read from the category prototype library. Then, the cluster center feature of the candidate defect feature cluster is compared with the prototype features of each category to calculate the similarity value between the cluster center feature and each category prototype feature. Similarity calculation can be performed using methods such as cosine similarity, Euclidean distance transformed similarity, or correlation coefficient similarity.
[0047] Understandably, when the cluster center feature has obvious elongated linear texture features, its similarity value with the prototype feature of the crack category is usually greater than its similarity value with the prototype feature of the dirt category or the ablation category.
[0048] For example, for any candidate defect feature cluster, the similarity values calculated between its cluster center feature and each category prototype feature are sorted to determine the category prototype feature with the largest similarity value; then the category label associated with the category prototype feature in the category prototype library is read, and the category label is used as the defect category pseudo label corresponding to the candidate defect feature cluster; finally, the defect category pseudo label is assigned to each candidate defect feature in the candidate defect feature cluster.
[0049] For example, let's take the candidate defect features from a batch of insulating rod sample images as an example. Assume that 12 candidate defect features are extracted in step S110, denoted as F1-F12, each a 512-dimensional feature vector. F1-F5 originate from abnormal areas with elongated linear textures on the insulating rod surface, F6-F8 from locally dark carbonized areas, and F9-F12 from areas covered with sheet-like dirt. Subsequently, the candidate defect features are clustered, for example using K-Means clustering, based on the Euclidean distance between them, resulting in three candidate defect feature clusters: C1={F1, F2, F3, F4, F5}, C2={F6, F7, F8}, and C3={F9, F10, F11, F12}. Then, L2 normalization is performed on each candidate defect feature in each candidate defect feature cluster, and the mean of each normalized candidate defect feature is calculated to obtain the cluster center features Center1, Center2 and Center3 corresponding to each candidate defect feature cluster.
[0050] A category prototype feature library is pre-established, storing category prototype features corresponding to defect categories such as cracks, ablation, fouling, and damage. Then, cosine similarity is calculated between each cluster center feature and each category prototype feature. For example, the similarity values between cluster center feature Center1 and the corresponding category prototype features for cracks, ablation, fouling, and damage are 0.94, 0.31, 0.27, and 0.46, respectively. Therefore, the category label corresponding to the crack category, with the highest similarity, is determined as the pseudo-label for the candidate defect feature cluster C1. Similarly, the cluster center feature Center2 has the highest similarity value with the ablation category prototype feature, for example, 0.92, so the ablation category is determined as the pseudo-label for the candidate defect feature cluster C2. The cluster center feature Center3 has the highest similarity value with the fouling category prototype feature, for example, 0.90, so the fouling category is determined as the pseudo-label for the candidate defect feature cluster C3. Finally, candidate defect feature clusters C1, C2, and C3 are obtained, corresponding to crack, ablation, and contamination defect pseudo-labels, respectively. Each defect category pseudo-label is used as the basis for subsequent calls to the corresponding grading index in the defect type feature library and for extracting defect grading features.
[0051] According to the above implementation method, without manually labeling each candidate defect region individually, a pseudo-label for the defect category can be automatically generated based on the clustering results between candidate defect features and the matching relationship between category prototype features, providing a category basis for subsequent calls to corresponding grading indicators and generation of pseudo-labels for defect levels.
[0052] S130: For each defect category pseudo-label, call the corresponding grading indicators from the preset defect type feature library, and extract grading features from the candidate defect features based on each grading indicator to obtain the grading features of each defect corresponding to the defect category pseudo-label.
[0053] For example, the defect type feature library stores information such as defect categories, grading indicators, indicator codes, feature extraction rules, and grading mapping rules. The defect type feature library can be stored in the form of tables, databases, key-value files, or configuration files. For example, the defect type feature library may include the following grading indicator content: Crack-related defects: crack length, crack width, crack continuity, crack direction; Defects related to soiling: area covered by soiling, color differences, continuity of distribution, and degree of boundary diffusion; Ablation defects: ablation area, carbonization color characteristics, degree of texture damage, and edge diffusion range; Damage defects include: damaged area, notch outline, degree of edge irregularity, and degree of local material loss. Defects related to moisture: extent of water stains, color changes, spot density, and regional distribution characteristics; Aging defects: degree of surface discoloration, chalking texture, gloss change, and texture roughness; Defects in connection areas include: rust range, abnormal edges of connectors, and location of end areas.
[0054] For example, a grading index refers to a characteristic indicator used to characterize the severity of a defect category. Different defect categories correspond to different grading indices. For instance, the grading indices for crack defects may include crack length and crack continuity; the grading indices for contamination defects may include contamination coverage area and color difference; and the grading indices for ablation defects may include ablation area, carbonization color characteristics, and texture damage degree.
[0055] In this example, the defect category pseudo-label can be used to index and retrieve data from the defect type feature library. Specifically, the defect category pseudo-label corresponding to the current candidate defect feature is first read; then, using this defect category pseudo-label as the search key, the corresponding defect category record is found in the defect type feature library; and then, the corresponding grading indicators and feature extraction rules corresponding to each grading indicator are read from the defect category record. For example, when the defect category pseudo-label is a crack, grading indicators such as crack length, crack width, crack continuity, and crack direction are retrieved from the defect type feature library; when the defect category pseudo-label is an ablation pseudo-label, grading indicators such as ablation area, carbonization color features, texture damage degree, and edge diffusion range are retrieved from the defect type feature library.
[0056] For example, defect grading features refer to features extracted from candidate defect features to characterize the severity of defects according to the grading index corresponding to the defect category pseudo-label. Defect grading features may include morphological grading features, color grading features, texture grading features, and location grading features. For example, defect grading features corresponding to crack-type defects may include elongated edge response, width variation response, and continuity response; defect grading features corresponding to ablation-type defects may include dark carbonization response, texture damage response, and area diffusion response.
[0057] In one implementation, hierarchical feature extraction is performed on candidate defect features based on various hierarchical indicators to obtain various defect hierarchical features corresponding to the defect category pseudo-labels, including: The candidate defect features are mapped to the feature space to obtain the initial spatial features; Each hierarchical indicator is coded to obtain the coding characteristics of each indicator. Generate channel weights corresponding to the initial spatial features based on the coding features of each indicator; The initial spatial features are weighted by each channel weight to obtain each weighted spatial feature. By performing nonlinear mapping on each weighted spatial feature using a preset nonlinear activation function, the various defect classification features are obtained.
[0058] For example, the initial spatial features refer to the feature representation obtained after mapping the candidate defect features to a unified feature space. Since different candidate defect features may come from different scales, different regions, or different feature extraction methods, feature space mapping is required first to give them a unified dimension and a unified semantic expression.
[0059] In this example, candidate defect features can be mapped to a feature space using fully connected mapping layers, convolutional mapping layers, or multilayer perceptron mapping layers to obtain initial spatial features. For example, when the candidate defect feature is a depth feature vector corresponding to the candidate defect region, this feature vector can be input into a pre-defined fully connected mapping layer (which may include linear transformation layers, normalization layers, and activation layers) to output initial spatial features of a uniform dimension. When the candidate defect feature is a local feature map corresponding to the candidate defect region, this local feature map can be input into a pre-defined convolutional mapping layer (which may include convolutional layers, batch normalization layers, and activation layers) to output the corresponding initial spatial features. Through the above processing, candidate defect features from different sources can be converted into a unified expression that facilitates subsequent channel weighting and hierarchical feature extraction, reducing the impact of different image scales and different defect region sizes on hierarchical feature extraction.
[0060] For example, various grading indicators can be encoded using one-hot encoding, embedded encoding, text encoding, or rule encoding. For instance, grading indicators such as crack length, crack width, and crack continuity can be converted into corresponding indicator encoding vectors; similarly, grading indicators such as ablation area, carbonization color characteristics, and texture damage degree can also be converted into corresponding indicator encoding vectors.
[0061] This example illustrates the encoding process for each grading indicator using embedding encoding. Specifically, each grading indicator in the defect type feature library is first assigned a corresponding indicator identifier. Then, this identifier is input into a pre-defined feature embedding mapping layer (built based on a learnable embedding matrix to map each indicator identifier to a semantic encoding vector with the same feature dimension), resulting in the corresponding indicator encoding feature. For example, crack length corresponds to one indicator encoding feature, crack continuity to another, and ablation area to yet another. Through embedding encoding, the model can distinguish the feature focus directions corresponding to different grading indicators.
[0062] For example, channel weights corresponding to the initial spatial features are generated based on the encoding features of each indicator. Specifically, the encoding features of each indicator can be input into a preset weight generation network (e.g., a lightweight network including fully connected layers, normalization layers, and sigmoid activation layers) to obtain channel weights corresponding to each channel of the initial spatial features. The channel weights are used to represent the importance of different feature channels under the current classification indicator.
[0063] For example, the initial spatial features are weighted by channel weights to obtain weighted spatial features. Specifically, for any channel weight corresponding to a grading index, the channel weight is weighted with the feature value of the corresponding channel in the initial spatial features to obtain the weighted spatial features corresponding to that grading index. In other words, different grading indices correspond to different channel weights, so the same candidate defect feature can form different weighted spatial features under different grading indices.
[0064] This can be understood as follows: for the same crack candidate defect feature, the weighted spatial feature generated under the crack length index focuses more on linear extension information, the weighted spatial feature generated under the crack width index focuses more on local edge spacing information, and the weighted spatial feature generated under the crack continuity index focuses more on discontinuous distribution information.
[0065] For example, the preset nonlinear activation function can be ReLU (Rectified Linear Unit), Sigmoid, Tanh (Hyperbolic Tangent Function), or GELU (Gaussian Error Linear Unit). By performing nonlinear mapping on each weighted spatial feature using the preset nonlinear activation function, various defect classification features are obtained.
[0066] In this example, each weighted spatial feature can be input into a predefined nonlinear mapping layer (e.g., including a fully connected layer and a ReLU function, or including a convolutional layer and a GELU function) to enhance the nonlinear expression related to defect grading in the weighted spatial features and output the corresponding defect grading features. For example, when processing ablation candidate defect features, the defect grading features obtained after nonlinear mapping can simultaneously characterize the combination relationship between ablation area, carbonization color, and texture destruction; when processing fouling candidate defect features, the defect grading features obtained after nonlinear mapping can characterize the combination relationship between fouling coverage, color difference, and distribution continuity.
[0067] According to the above implementation method, corresponding grading indicators can be invoked for different defect category pseudo-labels, and the grading indicators can be used to guide the channel weighting and nonlinear mapping of candidate defect features, so that the obtained defect grading features match the grading criteria of the current defect category. Compared with extracting general grading features uniformly for all defects, this method enables different defects such as cracks, dirt, ablation, and damage to form grading features according to their respective grading indicators, providing a clearer feature basis for subsequent grading mapping to generate defect grading pseudo-labels.
[0068] S140, perform level mapping on each defect classification feature corresponding to each defect category pseudo-label to obtain each defect level pseudo-label.
[0069] For example, a defect severity pseudo-label refers to a label automatically generated based on defect classification features, clustering results, and classification mapping rules. These pseudo-labels are not manually labeled one by one, but are automatically mapped from defect classification features. For instance, defect severity pseudo-labels may include minor, moderate, and severe labels; they may also include Level 1, Level 2, and Level 3 defect pseudo-labels.
[0070] In one implementation, a level mapping is performed on the defect classification features corresponding to each defect category pseudo-label to obtain each defect level pseudo-label, including: For each defect classification feature corresponding to each defect category pseudo-label, calculate the Euclidean distance between each defect classification feature, and construct a distance matrix based on each Euclidean distance. Based on the distance matrix, density clustering is performed on each defect classification feature to obtain the clustering results; The centroid features of each clustering result are calculated separately, and each centroid feature is converted into a rank score using a linear projection function; Read the level threshold range corresponding to the defect category pseudo-label from the defect type feature library; Each level score is mapped to a level threshold range, and initial level pseudo-labels are assigned to each clustering result based on the mapping results. Each initial level pseudo-label is verified, and each initial level pseudo-label that passes the verification is determined as the corresponding defect level pseudo-label.
[0071] For example, firstly, the defect classification features are grouped according to the defect category pseudo-label, so that the defect classification features corresponding to the same defect category pseudo-label are in the same group; then, within each group, the Euclidean distance between any two defect classification features is calculated; then, the calculated Euclidean distances are filled into the matrix according to the feature index position to obtain the distance matrix corresponding to the defect category pseudo-label.
[0072] The distance matrix is used to represent the differences in hierarchical features between different defect samples within the same defect category. For example, for pseudo-labels of crack-type defects, the Euclidean distance can be calculated based on the defect hierarchical features corresponding to crack length, crack width, and crack continuity; for pseudo-labels of contamination-type defects, the Euclidean distance can be calculated based on the defect hierarchical features corresponding to contamination coverage, color difference, and distribution continuity. By constructing the distance matrix, the similarity relationships between defect hierarchical features can be explicitly expressed, providing an input basis for subsequent density clustering.
[0073] It should be noted that a pseudo-label for the same defect category usually includes multiple candidate defect samples. Each candidate defect sample can be used to extract corresponding defect classification features. Therefore, a one-to-many correspondence is formed between a pseudo-label for a defect category and multiple defect classification features.
[0074] For example, a preset density clustering algorithm (such as DBSCAN (Density-Based Spatial Clustering of Applications with Noise), HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise), or OPTICS (Ordering Points To Identify the Clustering Structure)) can be used to cluster the distance matrix.
[0075] Taking DBSCAN as an example, first, set the neighborhood radius parameter and the minimum sample number parameter. The neighborhood radius parameter is used to limit whether samples belong to the same neighborhood, and the minimum sample number parameter is used to determine the core samples. Then, determine the neighborhood samples of each defect classification feature based on the distance matrix; then, expand the clusters starting from the core samples, grouping defect classification features with achievable density into the same cluster result. Through density clustering, samples with similar classification features under the same defect category can be aggregated into the same cluster result without pre-fixing the number of level clusters, while samples with greater dispersion are treated as samples to be verified.
[0076] For example, centroid features can be calculated using the mean, weighted mean, or median. Centroid features refer to the central features used to represent the overall hierarchical level of a clustering result.
[0077] In this example, using a weighted average calculation method, the centroid features of each clustering result are calculated, and each centroid feature is converted into a grade score using a linear projection function. Specifically, for any clustering result, the defect grading features contained in the clustering result are first read; then, based on the distance between each defect grading feature and the center of the clustering result or the abnormal response intensity corresponding to each defect grading feature, weights are assigned to each defect grading feature; then, a weighted average is calculated for each defect grading feature to obtain the centroid feature corresponding to the clustering result. Subsequently, the centroid feature is input into a preset linear projection function (e.g., a linear mapping function composed of a preset weight vector and a bias term, or a linear mapping layer implemented by a fully connected layer) to obtain the grade score. By converting the centroid feature into a grade score, the multidimensional defect grading features can be converted into a one-dimensional grade representation that is easy to compare with the grade threshold range.
[0078] For example, a defect category pseudo-label can be used as the search key to find the corresponding defect type record in the defect type feature library, and the grade threshold range can be read from the defect type record. The grade threshold range can include the scoring range corresponding to multiple defect levels. For example, for crack-type defects, the grade threshold range can include a minor crack range, a general crack range, and a severe crack range; for ablation-type defects, the grade threshold range can include a minor ablation range, a general ablation range, and a severe ablation range; for contamination-type defects, the grade threshold range can include a minor contamination range, a general contamination range, and a severe contamination range. The grade threshold ranges corresponding to different defect categories can be different to adapt to the grading criteria of different defect categories.
[0079] For example, for any clustering result, the grade score corresponding to the clustering result is read, and the grade score is compared with each grade threshold interval corresponding to the current defect category pseudo-label; when the grade score falls into a certain grade threshold interval, the grade label associated with the grade threshold interval is determined as the initial grade pseudo-label corresponding to the clustering result; then the initial grade pseudo-label is assigned to each candidate defect feature in the clustering result.
[0080] For example, if the grade score corresponding to a cluster result of crack-type defects falls into the general crack range, then the general grade pseudo-label is assigned to each crack candidate defect feature in that cluster result; similarly, if the grade score corresponding to a cluster result of ablation-type defects falls into the severe ablation range, then the severe grade pseudo-label is assigned to each ablation candidate defect feature in that cluster result. Through this mapping method, different cluster results under the same defect category can correspond to different defect grades.
[0081] For example, verification rules corresponding to the pseudo-label of the current defect category can be read from the defect type feature library. These verification rules may include hierarchical index consistency rules, clustering stability rules, sample boundary integrity rules, and enhancement consistency rules. For instance, the hierarchical index consistency rule verifies whether the initial hierarchical pseudo-label is consistent with the key hierarchical index corresponding to the current defect category; the clustering stability rule verifies whether the hierarchical results of samples are consistent after multiple clusterings or perturbations; the sample boundary integrity rule verifies whether candidate defect regions have complete boundaries; and the enhancement consistency rule verifies whether the hierarchical results of the same candidate defect region are consistent before and after image enhancement.
[0082] During the verification process, for any initial grade pseudo-label, if it meets the verification rules corresponding to the current defect category pseudo-label, then the initial grade pseudo-label is determined as a defect grade pseudo-label; if it does not meet the verification rules, it can be marked as a grade pseudo-label to be confirmed, or it can be excluded from the current training round. Through verification processing, the impact of abnormal clustering results, incomplete boundary regions, or unstable feature samples on the generation of defect grade pseudo-labels can be reduced.
[0083] According to the above implementation method, clustering can be performed first on the defect classification features under the same defect category, and then the clustering results can be mapped to defect classification pseudo-labels using centroid features and classification threshold ranges, so that the generation process of defect classification pseudo-labels corresponds to the classification feature distribution of the same type of defects; at the same time, by filtering out unstable initial classification pseudo-labels through verification processing, more stable classification supervision information can be provided for the subsequent training of the insulation rod defect detection model.
[0084] S150, based on pseudo-labels for each defect category and pseudo-labels for each defect level, trains an insulation rod defect detection model to output the defect category and defect level in the image of the insulation rod to be detected.
[0085] For example, an insulating rod defect detection model refers to a neural network model used to identify defects and determine the defect level in images of insulating rods. The insulating rod defect detection model may include a feature extraction network, a defect category output branch, and a defect level output branch. The feature extraction network is used to extract image features from the insulating rod image; the defect category output branch outputs the defect category; and the defect level output branch outputs the defect level. For example, the insulating rod defect detection model can be implemented using a convolutional neural network, a visual Transformer network, an object detection network, or a multi-task learning network.
[0086] In a specific example, the insulation rod defect detection model is implemented using a multi-task convolutional neural network. The feature extraction network uses ResNet-50 (50-layer Residual Network) as the backbone network, and a feature pyramid network is connected after the backbone network to output image features at multiple scales. The defect category output branch includes a global average pooling layer, a fully connected layer, and a Softmax (Softmax Function) classification layer to output the predicted probability corresponding to each defect category. The defect level output branch includes a region feature alignment layer, a fully connected layer, and a Softmax classification layer to output the predicted probability corresponding to each defect level. Defect categories can include cracks, dirt, ablation, breakage, dampness, aging, and connection abnormalities; defect levels can include minor, moderate, and severe levels.
[0087] In another specific example, the input image size of the feature extraction network is set to 640×640 pixels; the feature pyramid network outputs multi-scale feature maps with strides of 8, 16, and 32; the fully connected layers in the defect category output branch have the same output dimension as the number of defect categories; and the fully connected layers in the defect level output branch have the same output dimension as the number of defect levels. For candidate defect regions, a region feature alignment method can be used to extract fixed-size candidate region features from the multi-scale feature maps, and the candidate region features are then input into the defect level output branch.
[0088] For example, images of the insulating rod to be inspected can be acquired using an industrial camera, a mobile inspection terminal, a fixed shooting device, or an inspection robot. During acquisition, images can be taken of the rod's surface, end connection area, gripping area, and marking area. The acquired images of the insulating rod to be inspected can first undergo size normalization, brightness correction, noise suppression, and cropping of the main body area of the insulating rod before being input into a trained insulating rod defect detection model for inspection.
[0089] For example, before training, the insulating rod sample images can be uniformly scaled to 640×640 pixels and pixel normalization processing can be performed on the insulating rod sample images. For each candidate defect feature generated in the aforementioned steps, its corresponding insulating rod sample image identifier, candidate defect region location, defect category pseudo-label, and defect level pseudo-label can be recorded, so that the same candidate defect region can be associated with the corresponding category supervision information and level supervision information during training.
[0090] In one implementation, an insulation rod defect detection model is trained based on pseudo-labels for each defect category and pseudo-labels for each defect level, including: Input the sample image of the insulating rod into the insulating rod defect detection model to obtain the predicted defect category and predicted defect level; A category loss is constructed based on the predicted defect category and the pseudo-label of the defect category. A level loss is constructed based on the predicted defect level and the defect level pseudo-label. Based on preset weight coefficients, category loss, and rank loss, a target loss function is constructed, and the model parameters of the insulation rod defect detection model are updated based on the gradient of the target loss function to train the insulation rod defect detection model.
[0091] For example, an insulating rod sample image can be input into a feature extraction network to obtain insulating rod image features; the insulating rod image features can be input into a defect category output branch to obtain a predicted defect category; the insulating rod image features or the region features corresponding to the candidate defect area can be input into a defect level output branch to obtain a predicted defect level. For instance, for an insulating rod sample image containing a suspected crack area, the defect category output branch can output a predicted crack category, and the defect level output branch can output a predicted level of minor, moderate, or severe.
[0092] During training, if the same insulating rod sample image corresponds to multiple candidate defect regions, the region features corresponding to each candidate defect region are extracted, and the defect category pseudo-label and defect level pseudo-label corresponding to each candidate defect region are used as the supervision information of the candidate defect region. If no candidate defect region is detected in the same insulating rod sample image, it can be used as a normal sample to input into the insulating rod defect detection model to constrain the model output normal category or no defect level.
[0093] For example, the defect category pseudo-labels can be converted into a category label distribution, and the predicted defect categories and category label distributions can be input into a category loss function to obtain the category loss. The category label distribution can be a one-hot label distribution or a soft label distribution.
[0094] For example, defect level pseudo-labels can be converted into level label distributions, and the predicted defect level probability distribution and level label distribution can be input into a level loss function to obtain the level loss. The level label distribution can be a one-hot label distribution or a soft label distribution. For instance, when the defect level pseudo-label is a severity level pseudo-label, the position corresponding to the severity level can be set as the target level position, and the corresponding level label distribution can be generated.
[0095] For example, a target loss function is constructed based on preset weight coefficients, category loss, and rank loss, and the model parameters of the insulation rod defect detection model are updated based on the gradient of the target loss function. The target loss function can be expressed as: ; Where L represents the target loss function; Indicates category loss; Indicates a level of loss; This represents the weight coefficients corresponding to the category loss; This represents the weighting coefficient corresponding to the level loss.
[0096] The category loss can be represented by the cross-entropy loss as follows: in, This indicates the distribution of category labels corresponding to the defect category pseudo-labels. This indicates the predicted defect category output by the insulation rod defect detection model.
[0097] The ranking loss can be represented by the cross-entropy loss as follows: in, This indicates the distribution of level labels corresponding to the defect level pseudo-labels. This indicates the predicted defect level output by the insulation rod defect detection model.
[0098] The weight coefficients can be preset according to training requirements, for example, and You can set all of them to 1, or you can adjust them according to the importance of the category prediction task and the level prediction task. This example does not limit their values.
[0099] For example, when training the insulation rod defect detection model, the Adam (Adaptive Moment Estimation) optimizer can be used, with an initial learning rate of 0.001, a batch size of 16, and 100 training epochs; alternatively, a stochastic gradient descent optimizer can be used, with an initial learning rate of 0.01 and a momentum parameter of 0.9. During training, the accuracy of class prediction and rank prediction can be monitored on the validation set, and training can be stopped when the target loss function converges or the preset number of training epochs is reached.
[0100] According to the above implementation method, a category loss is constructed using defect category pseudo-labels, and a level loss is constructed using defect level pseudo-labels. The automatically generated pseudo-labels can be used to train the insulation rod defect detection model, enabling the model to simultaneously output defect categories and defect levels after training. Since both category and level pseudo-labels can be automatically generated by the aforementioned steps, the workload of manually labeling defect categories and levels can be reduced, and the training and detection efficiency of the insulation rod defect detection model can be improved.
[0101] In one implementation, the specific process by which the trained insulating rod defect detection model outputs the defect category and defect level in the image of the insulating rod to be detected may include: acquiring the image of the insulating rod to be detected, and performing size normalization, brightness correction, and cropping of the main body region of the insulating rod on the image; inputting the processed image of the insulating rod to be detected into the trained insulating rod defect detection model; extracting image features of the image of the insulating rod to be detected through the feature extraction network of the trained insulating rod defect detection model; outputting the defect category through the category output branch of the trained insulating rod defect detection model; and outputting the defect level through the level output branch of the trained insulating rod defect detection model. If there are multiple candidate defect regions in the image of the insulating rod to be detected, the defect category and defect level corresponding to each candidate defect region can be output separately. For example, for a thin, elongated linear region in the image of the insulating rod to be detected, the trained insulating rod defect detection model can output a crack category and a general level; for a locally dark carbonized region, it can output an ablation category and a severe level.
[0102] In this way, the trained insulating rod defect detection model can simultaneously output the defect category and defect level corresponding to each candidate defect region in the image of the insulating rod to be detected during a single inference process, realizing integrated detection of defect category identification and defect level determination. This reduces repeated inference and manual comprehensive analysis, shortens the insulating rod defect detection time, and thus improves the efficiency of insulating rod defect detection. At the same time, the output defect category and defect level can be directly used as a reference for subsequent quality acceptance, repair and maintenance management, improving the practicality of the insulating rod defect detection results.
[0103] In one implementation, after the trained insulating rod defect detection model outputs the defect category and defect level in the image of the insulating rod to be detected, the method further includes: If the grade score corresponding to the defect level is less than the preset grade score threshold, the first maintenance information is retrieved from the preset maintenance knowledge base based on the defect category and defect level, and the first maintenance information is sent to the inspection terminal. If the level score corresponding to the defect level is greater than or equal to the level score threshold, an early warning message is generated, and second maintenance information is retrieved from the preset maintenance knowledge base based on the defect category and defect level, and the early warning message and second maintenance information are sent to the inspection terminal.
[0104] For example, the first maintenance information refers to the routine maintenance prompt information retrieved from the maintenance knowledge base when the level score corresponding to the defect level is less than a preset level score threshold (e.g., the level score threshold is 0.6). The first maintenance information may include the defect category, defect level, inspection suggestion, re-inspection cycle, cleaning suggestion, or routine maintenance method. For example, when the defect category is a dirt defect and the defect level is minor, the first maintenance information may be "clean the surface of the insulating rod and re-inspect it during the next routine inspection"; when the defect category is a minor aging defect, the first maintenance information may be "record the location of the aging area and include it in the key observation range of subsequent inspections".
[0105] In this example, the defect levels output by the trained insulation rod defect detection model can first be converted into level scores. For example, a minor level might have a score of 0.3, a moderate level 0.6, and a severe level 0.9. Then, the level scores are compared with a preset level score threshold (e.g., 0.6). When a level score is lower than the threshold, a matching first maintenance information is retrieved from a preset maintenance knowledge base based on the defect category and level, and this first maintenance information is sent to the inspection terminal. The inspection terminal can be a mobile terminal, a handheld detection terminal, or a back-end inspection management terminal used by inspection personnel.
[0106] For example, the second maintenance information refers to the key maintenance prompt information retrieved from the maintenance knowledge base when the level score corresponding to the defect level is greater than or equal to a preset level score threshold (e.g., the level score threshold is 0.6). The second maintenance information may include defect category, defect level, decommissioning suggestion, replacement suggestion, review requirements, handling priority, or maintenance work order generation information. For example, when the defect category is an ablation defect and the defect level is severe, the second maintenance information may be "Suspend the use of the insulating rod, arrange for review and replacement"; when the defect category is a crack defect and the defect level is general or severe, the second maintenance information may be "Stop circulation and use, submit tool re-inspection, and generate a maintenance work order."
[0107] For example, a warning message refers to a risk alert generated when the level score corresponding to the defect level is greater than or equal to a preset level score threshold (e.g., 0.6). The warning message may include the warning level, defect category, defect level, insulating rod number, image acquisition time, detection location, and handling status. For example, the warning message could be "Insulating rod number A has a severe ablation defect; please review immediately and suspend use"; or it could be "A crack-like defect has been detected, level 'general'; please inspect and confirm."
[0108] In this example, when the rating score is greater than or equal to the rating score threshold, an early warning message can be generated based on the defect category and defect level. Then, a second maintenance message corresponding to the defect category and defect level is retrieved from a pre-set maintenance knowledge base. The early warning message and the second maintenance message are then sent to the inspection terminal, enabling inspection personnel to perform corresponding maintenance procedures based on the inspection results. Sending methods may include mobile application push notifications, SMS notifications, background system pop-ups, or maintenance work orders.
[0109] According to the above implementation method, based on the defect category and defect level output by the trained insulating rod defect detection model, the corresponding maintenance information can be automatically retrieved and a prompt can be sent to the inspection terminal. When the level score corresponding to the defect level is less than the preset level score threshold, routine maintenance information is issued; when the level score corresponding to the defect level is greater than or equal to the level score threshold, early warning information and key maintenance information are issued. Thus, the insulating rod defect detection results can be linked to the subsequent maintenance and handling process, reducing the process of manual judgment and manual relaying of detection results, and improving the processing efficiency of insulating rod defect detection results.
[0110] Figure 2 This is a structural block diagram of an insulating rod defect detection device according to an embodiment of the present invention.
[0111] like Figure 2 As shown, the insulating rod defect detection device may include: The defect identification module 510 is used to identify the acquired insulating rod sample image and obtain the features of each candidate defect; The label mapping module 520 is used to perform label mapping on each of the candidate defect features to obtain pseudo-labels for each defect category. The hierarchical feature extraction module 530 is used to call up the hierarchical indicators corresponding to the defect category pseudo-labels from the preset defect type feature library for each defect category pseudo-label, and perform hierarchical feature extraction on the candidate defect features based on each hierarchical indicator to obtain the defect hierarchical features corresponding to the defect category pseudo-labels. The grade mapping module 540 is used to perform grade mapping on each defect grade feature corresponding to each defect category pseudo-label to obtain each defect grade pseudo-label. The detection module 550 is used to train an insulating rod defect detection model based on each of the defect category pseudo-labels and each of the defect level pseudo-labels, so as to output the defect category and defect level in the image of the insulating rod to be detected through the trained insulating rod defect detection model.
[0112] In one embodiment, the defect identification module includes: The feature extraction unit is used to extract features from the insulating rod sample image through a pre-trained teacher network to obtain each first sample feature, and to extract features from the insulating rod sample image through a pre-trained student network to obtain each second sample feature; An anomaly screening unit is used to perform anomaly screening on each of the second sample features based on the similarity value between each of the first sample features and each of the second sample features, so as to obtain each anomalous sample feature. A generation unit is used to generate an abnormal response map corresponding to the insulating rod sample image based on the features of each of the abnormal samples. The region filtering unit is used to filter the abnormal response map to obtain various candidate defect regions. An extraction unit is used to extract the features of each candidate defect from the insulating rod sample image based on each candidate defect region.
[0113] In one implementation, the step of label mapping for each of the candidate defect features to obtain pseudo-labels for each defect category includes: Clustering unit, used to cluster the candidate defect features to obtain candidate defect feature clusters; The normalization processing unit is used to normalize each candidate defect feature in each candidate defect feature cluster, and determine the cluster center feature of the candidate defect feature cluster based on the mean of each candidate defect feature after normalization. The similarity calculation unit is used to calculate the similarity between the cluster center feature and the preset prototype features of each category to obtain each similarity value; The defect category pseudo-label determination unit is used to determine the category label associated with the category prototype feature corresponding to the maximum value among the various similarity values as the defect category pseudo-label corresponding to the candidate defect feature cluster, so as to obtain the defect category pseudo-label.
[0114] In one embodiment, the hierarchical feature extraction module includes: The feature space mapping unit is used to perform feature space mapping on the candidate defect features to obtain initial spatial features; The encoding processing unit is used to encode each of the hierarchical indicators to obtain the encoding features of each indicator; The channel weight generation unit is used to generate each channel weight corresponding to the initial spatial features based on each of the index coding features; A channel weighting unit is used to perform channel weighting on the initial spatial features based on each of the channel weights to obtain each weighted spatial feature; The nonlinear mapping unit is used to perform nonlinear mapping on each of the weighted space features through a preset nonlinear activation function to obtain each of the defect classification features.
[0115] In one embodiment, the level mapping module includes: The Euclidean distance calculation and matrix construction unit is used to calculate the Euclidean distance between each defect classification feature corresponding to each defect category pseudo-label, and construct a distance matrix based on each Euclidean distance. A density clustering unit is used to perform density clustering on each of the defect classification features based on the distance matrix to obtain each clustering result; The transformation unit is used to calculate the centroid features of each of the clustering results, and convert each of the centroid features into rank scores through a linear projection function; The reading unit is used to read the level threshold range corresponding to the defect category pseudo-label from the defect type feature library; A mapping unit is used to map each of the grade scores to the grade threshold interval, and to assign initial grade pseudo-labels to each of the clustering results according to the mapping results; The verification unit is used to verify each of the initial level pseudo-labels and determine each initial level pseudo-label that passes the verification as the respective defect level pseudo-label.
[0116] In one implementation, training the insulation rod defect detection model based on each defect category pseudo-label and each defect level pseudo-label is specifically used for: The insulating rod sample image is input into the insulating rod defect detection model to obtain the predicted defect category and predicted defect level. Based on the predicted defect category and the pseudo-label of the defect category, a category loss is constructed; Based on the predicted defect level and the defect level pseudo-label, a level loss is constructed; Based on preset weight coefficients, the category loss, and the level loss, a target loss function is constructed, and the model parameters of the insulating rod defect detection model are updated based on the gradient of the target loss function to train the insulating rod defect detection model.
[0117] In one embodiment, after the detection module, the system further includes: The first maintenance module is used to retrieve first maintenance information from a preset maintenance knowledge base based on the defect category and the defect level if the level score corresponding to the defect level is less than a preset level score threshold, and then send the first maintenance information to the inspection terminal. The second maintenance module is used to generate an early warning message and, based on the defect category and the defect level, retrieve second maintenance information from a preset maintenance knowledge base and send the early warning message and the second maintenance information to the inspection terminal if the level score corresponding to the defect level is greater than or equal to the level score threshold.
[0118] The specific functions and examples of each module and submodule of the device in this embodiment can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.
[0119] The acquisition, storage, and application of user personal information involved in the technical solution of this invention all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0120] This invention also provides a computer device, comprising: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method described in any one of the embodiments of the present invention.
[0121] The beneficial effects of the computer equipment in this embodiment of the invention are equivalent to the beneficial effects of the above-described method for detecting defects in insulating rods, and will not be repeated here.
[0122] This invention also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the method described in any one of the embodiments of this invention.
[0123] The beneficial effects of the storage medium of the present invention are equivalent to those of the above-described method for detecting defects in insulating rods, and will not be elaborated upon here.
[0124] Figure 3 A schematic block diagram of an example computer device 800 that can be used to implement embodiments of the present invention is shown. Computer device 800 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Computer device 800 may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0125] like Figure 3As shown, the computer device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the computer device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0126] Multiple components in computer device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows computer device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0127] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the insulating rod defect detection method. For example, in some embodiments, the insulating rod defect detection method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the computer device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the insulating rod defect detection method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the insulating rod defect detection method by any other suitable means (e.g., by means of firmware).
[0128] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0129] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0130] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0131] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0132] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0133] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0134] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this is not limited herein.
[0135] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for detecting defects in an insulating rod, characterized in that, include: The acquired images of insulating rod samples are identified to obtain the features of each candidate defect; Label mapping is performed on each of the candidate defect features to obtain pseudo-labels for each defect category; For each of the defect category pseudo-labels, the corresponding grading indicators are called from the preset defect type feature library, and the candidate defect features are extracted based on each of the grading indicators to obtain the defect grading features corresponding to each defect category pseudo-label. Perform level mapping on each defect classification feature corresponding to each defect category pseudo-label to obtain each defect level pseudo-label. Based on the pseudo-labels of each defect category and each defect level, an insulating rod defect detection model is trained to output the defect category and defect level in the image of the insulating rod to be detected.
2. The method according to claim 1, characterized in that, The process of identifying the acquired insulating rod sample images to obtain the features of each candidate defect includes: The insulating rod sample image is used to extract features through a pre-trained teacher network to obtain each first sample feature, and the insulating rod sample image is used to extract features through a pre-trained student network to obtain each second sample feature. Based on the similarity values between each of the first sample features and each of the second sample features, anomaly screening is performed on each of the second sample features to obtain each anomalous sample feature; An anomaly response map corresponding to the insulating rod sample image is generated based on the features of each of the anomaly samples. The abnormal response map is filtered by region to obtain each candidate defect region; Based on each of the candidate defect regions, the features of each candidate defect are extracted from the insulating rod sample image.
3. The method according to claim 1, characterized in that, The step of mapping labels to each of the candidate defect features to obtain pseudo-labels for each defect category includes: Cluster the candidate defect features to obtain candidate defect feature clusters; For each of the candidate defect feature clusters, each candidate defect feature in the candidate defect feature cluster is normalized, and the cluster center feature of the candidate defect feature cluster is determined based on the mean of each candidate defect feature after normalization. The cluster center features are compared with the preset prototype features of each category to calculate the similarity, and the similarity values are obtained. The category label associated with the category prototype feature corresponding to the maximum value among the various similarity values is determined as the defect category pseudo label corresponding to the candidate defect feature cluster, so as to obtain the defect category pseudo label.
4. The method according to claim 1, characterized in that, The step of extracting graded features from the candidate defect features based on each of the graded indicators to obtain the graded features of each defect corresponding to the defect category pseudo-label includes: The candidate defect features are mapped into a feature space to obtain initial spatial features; Each of the aforementioned hierarchical indicators is encoded to obtain the encoding features of each indicator; Generate channel weights corresponding to the initial spatial features based on the coding features of each of the aforementioned indicators; Based on the channel weights, the initial spatial features are weighted by channels to obtain weighted spatial features. Each of the weighted spatial features is nonlinearly mapped by a preset nonlinear activation function to obtain each of the defect classification features.
5. The method according to claim 1, characterized in that, The step of mapping each defect classification feature corresponding to each defect category pseudo-label to obtain each defect level pseudo-label includes: For each defect classification feature corresponding to each defect category pseudo-label, calculate the Euclidean distance between each defect classification feature, and construct a distance matrix based on each Euclidean distance. Based on the distance matrix, density clustering is performed on each of the defect classification features to obtain each clustering result; The centroid features of each clustering result are calculated, and each centroid feature is converted into a rank score using a linear projection function; Read the level threshold range corresponding to the pseudo-label of the defect category from the defect type feature library; Each of the grade scores is mapped to the grade threshold range, and an initial grade pseudo-label is assigned to each of the clustering results based on the mapping results; Each of the initial grade pseudo-labels is verified, and each initial grade pseudo-label that passes the verification is determined as the defect grade pseudo-label.
6. The method according to claim 1, characterized in that, The step of training an insulation rod defect detection model based on pseudo-labels for each defect category and each defect level includes: The insulating rod sample image is input into the insulating rod defect detection model to obtain the predicted defect category and predicted defect level. Based on the predicted defect category and the pseudo-label of the defect category, a category loss is constructed; Based on the predicted defect level and the defect level pseudo-label, a level loss is constructed; Based on preset weight coefficients, the category loss, and the level loss, a target loss function is constructed, and the model parameters of the insulating rod defect detection model are updated based on the gradient of the target loss function to train the insulating rod defect detection model.
7. The method according to claim 1, characterized in that, After the trained insulating rod defect detection model outputs the defect category and defect level in the image of the insulating rod to be detected, the method further includes: If the grade score corresponding to the defect level is less than the preset grade score threshold, then the first maintenance information is retrieved from the preset maintenance knowledge base based on the defect category and the defect level, and the first maintenance information is sent to the inspection terminal. If the grade score corresponding to the defect level is greater than or equal to the grade score threshold, an early warning message is generated, and second maintenance information is retrieved from the preset maintenance knowledge base based on the defect category and the defect level, and the early warning message and the second maintenance information are sent to the inspection terminal.
8. A defect detection device for insulating rods, characterized in that, include: The defect identification module is used to identify the acquired insulating rod sample images and obtain the features of each candidate defect; The label mapping module is used to perform label mapping on each of the candidate defect features to obtain pseudo-labels for each defect category. The hierarchical feature extraction module is used to call up the hierarchical indicators corresponding to the defect category pseudo-labels from the preset defect type feature library for each defect category pseudo-label, and perform hierarchical feature extraction on the candidate defect features based on each hierarchical indicator to obtain the defect hierarchical features corresponding to each defect category pseudo-label. The grade mapping module is used to perform grade mapping on each defect grade feature corresponding to each defect category pseudo-label to obtain each defect grade pseudo-label. The detection module is used to train an insulating rod defect detection model based on the pseudo-labels of each defect category and each defect level, so as to output the defect category and defect level in the image of the insulating rod to be detected through the trained insulating rod defect detection model.
9. A computer device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.
