Self-adaptive data distillation method and system for electrical equipment component detection
Through the adaptive data distillation method, the core image set is screened and pseudo-labels are generated. Combined with the labeling data, the student network is optimized, and the problems of high data labeling cost and limited model performance improvement in power equipment component detection are solved, and efficient model training and detection accuracy are achieved. promote.
Patent Information
- Application Number
- CN202411373064.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-29
AI Technical Summary
Existing power equipment component detection methods require a large amount of manual labeling data for training, and the growth rate of unlabeled data is fast, resulting in high data labeling costs and limited improvement in model performance.
Adaptive data distillation method is adopted to filter the core image set without labels, generate pseudo-labels, and use pseudo-labels to train students' networks, combine the annotated data for iterative optimization, dynamically adjust the anchor box to adapt to goals of different scales, and improve model detection Accuracy and generalization capability.
It significantly reduces the dependence on manual labeled data, improves model training efficiency and detection accuracy, and realizes efficient management of data resources and optimization of model performance.
Smart Images

Figure CN119206403A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power equipment, and in particular to an adaptive data distillation method and system for detecting electric power equipment components. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Most current power equipment component detection methods are based on deep learning, using convolutional neural networks or Transformer networks to achieve accurate and efficient equipment component detection, providing a basis for subsequent defect detection and fault analysis. However, existing models require a large amount of manually annotated data for training. On the one hand, the collection and organization of power equipment annotated data requires the annotator to have professional knowledge of power equipment, making it difficult to increase the amount of high-quality annotated data on a large scale. On the other hand, with the increase in daily inspections such as drones, robots and manual inspections, the original unlabeled power equipment monitoring data has exploded. How to efficiently organize unlabeled raw data, reduce storage requirements, and at the same time use limited labeled data and stored unlabeled data to improve the performance of power equipment component detection models is a major technical problem faced in power equipment data management and model training. Summary of the invention
[0004] In order to solve the technical problems existing in the above-mentioned background technology, such as the bottleneck of high existing data annotation cost and limited model performance improvement, the present invention provides an adaptive data distillation method and system for power equipment component detection. The present invention uses an adaptive screening and dynamic distillation mechanism to more intelligently utilize limited labeled data and fully mine the potential information of unlabeled data. While improving the detection accuracy and generalization ability of the model, it realizes efficient management and optimal configuration of data resources, greatly reduces dependence on manual annotation, and improves the training efficiency of the model and the feasibility of application promotion.
[0005] In order to achieve the above object, the present invention adopts the following technical solution:
[0006] A first aspect of the present invention provides an adaptive data distillation method for power equipment component detection.
[0007] An adaptive data distillation method for power equipment component detection, comprising:
[0008] An improved teacher network is trained using a set of images labeled with power equipment components;
[0009] Selecting an unlabeled core image set from an unlabeled image set of power equipment parts;
[0010] A self-ensemble data distillation method is used to generate pseudo labels for the unlabeled core image set;
[0011] The improved student network is trained using a core set of pseudo-labeled images;
[0012] The core image set is fused with the image set of labeled power equipment components to obtain a fused image set; the fused image set is used to retrain the improved teacher network and the improved student network to obtain a trained student model for inspecting power equipment components in new images;
[0013] Among them, both the improved teacher network and the improved student network introduce a dynamic anchor point mechanism in the YOLOv8 network to dynamically adjust the anchor frame according to the size ratio distribution of power equipment components; the decoding head is divided into multiple levels to process anchor frames of different scales separately.
[0014] Furthermore, according to the size ratio distribution of the power equipment components, the anchor frame is dynamically adjusted, which is expressed by the following formula:
[0015] Aspect Ratio(C i )=W i / H i
[0016] A w =f(W i )
[0017] A h =f(H i )
[0018] Among them, C i Indicates the type of power equipment components, W i represents the width of the target bounding box, H i Indicates the height of the target bounding box, Aspect Ratio (C i ) represents the size ratio distribution of power equipment components, A w represents the width of the anchor frame after dynamic adjustment, f() represents the function designed according to the scale change of the power equipment components, A h Indicates the height of the anchor box after dynamic adjustment.
[0019] Furthermore, the method for selecting an unlabeled core image set from an image set of unlabeled power equipment components includes: based on the image set of unlabeled power equipment components, using a visual feature extractor to extract image features of each image to obtain an image feature set; using a clustering method to cluster the image feature set to obtain cluster compactness; and dynamically adjusting the sampling ratio of center samples and boundary samples according to the cluster compactness to construct an unlabeled core image set.
[0020] Furthermore, the clustering method is used to cluster the image feature set to obtain the cluster compactness, and the method includes: dynamically adjusting the neighborhood radius according to the local density distribution of the image feature set to perform preliminary clustering; analyzing the preliminary clustering results, dividing the clusters whose internal distance is greater than a first set threshold, and merging the clusters whose average threshold between clusters is less than a second set threshold.
[0021] Furthermore, the central sample is defined as:
[0022]
[0023] Among them, center(C i ) is cluster C i the center of;
[0024] The boundary samples are defined as:
[0025] boundary(C i )={x∈C i |distance(x,neighbor(C i )) <threshold}
[0026] Among them, neighbor(C i ) is the cluster C i Other adjacent clusters, distance(x,neighbor(C i )) represents the distance between the sample and the adjacent cluster.
[0027] Furthermore, the sampling ratio of the center sample and the boundary sample is dynamically adjusted according to the compactness of the cluster, which is expressed by the following formula:
[0028]
[0029] Among them, p center is the sampling probability of the center sample, λ is the adjustment factor, μ is the density threshold, density(C i ) represents the average distance within the cluster, which is defined as the compactness.
[0030] Furthermore, a self-integrated data distillation method is used to generate pseudo labels for the unlabeled core image set, and the method includes: performing multiple random transformations on each image in the unlabeled core image set, and inputting the transformed image into an improved teacher network, so that each image obtains multiple detection results; based on the multiple detection results of each image, the uncertainty of the target box is measured; if the uncertainty of the target box is greater than a third set threshold, the weight of the target box is reduced, and the confidence is set according to the weight of the target box, and a pseudo label for the image is generated according to the confidence and the detection result.
[0031] Furthermore, the uncertainty of the target frame is expressed by the following formula:
[0032]
[0033] Among them, U(x) is the uncertainty of the target box on image x, p t (x) is the confidence of the teacher network on the target box after the tth transformation, and T is the number of transformations.
[0034] Furthermore, the confidence is expressed by the following formula:
[0035]
[0036] Among them, σ and is the adjustment coefficient, and U(x) is the uncertainty of the target box on image x.
[0037] Furthermore, after the pseudo-label is generated, the pseudo-label is also optimized: the intersection-over-union ratio is used to measure the position overlap of the target frame; the features of the target frame are semantically analyzed, and the cosine similarity is used to measure the similarity of the semantic features of the target frame; according to the position overlap of the target frame and the similarity of the semantic features of the target frame, a fusion weight is assigned to each target frame, and the pseudo-label is optimized using the fusion weight.
[0038] Furthermore, the fusion weight is expressed by the following formula:
[0039] γ(x)=β·IoU(B1,B2)+(1-β)·Semantic_Sim(x1,x2)
[0040] Among them, β is a balance factor, which is used to adjust the weight of IoU and semantic similarity in fusion; IoU(B1, B2) represents the degree of position overlap of the target box, and Semantic_Sim(x1, x2) represents the similarity of the semantic features of the target box.
[0041] A second aspect of the present invention provides an adaptive data distillation system for power equipment component detection.
[0042] An adaptive data distillation system for power equipment component detection, comprising:
[0043] A teacher network training module, which is configured to: train an improved teacher network using an image set labeled with power equipment components;
[0044] A screening module is configured to: screen an unlabeled core image set from an unlabeled image set of power equipment components;
[0045] A pseudo-label generation module, configured to: generate pseudo-labels for an unlabeled core image set using a self-ensemble data distillation method;
[0046] A student network training module, which is configured to: train an improved student network using a core image set with pseudo labels;
[0047] The detection module is configured to: fuse the core image set with the image set annotated with the power equipment components to obtain a fused image set; retrain the improved teacher network and the improved student network using the fused image set to obtain a trained student model for inspecting the power equipment components in the new image;
[0048] Among them, both the improved teacher network and the improved student network introduce a dynamic anchor point mechanism in the YOLOv8 network to dynamically adjust the anchor frame according to the size ratio distribution of power equipment components; the decoding head is divided into multiple levels to process anchor frames of different scales separately.
[0049] A third aspect of the present invention provides a computer-readable storage medium.
[0050] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the adaptive data distillation method for power equipment component detection as described in the first aspect above.
[0051] A fourth aspect of the present invention provides a computer device.
[0052] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the adaptive data distillation method for power equipment component detection as described in the first aspect above are implemented.
[0053] A fifth aspect of the present invention provides a computer device.
[0054] The present invention provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the adaptive data distillation method for power equipment component detection as described in the first aspect above.
[0055] Compared with the prior art, the present invention has the following beneficial effects:
[0056] The data screening method based on feature clustering proposed in this invention can effectively screen out representative and diverse samples from large-scale unlabeled original power equipment images. Through this method, huge data sets can be condensed, significantly reducing storage space requirements, while retaining the core data with the most information value, improving the efficiency and effect of subsequent model training.
[0057] The model learning method based on data distillation proposed in this invention makes full use of the strategy of combining unlabeled data with limited labeled data to effectively train the power equipment component detection model. This method not only significantly reduces the demand for labeled data and training resources, but also can obtain a high-performance power equipment component detection model on this basis, achieving dual optimization of resource efficiency and model accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0059] Figure 1 It is a framework diagram of an adaptive data distillation method for power equipment component detection shown in the present invention;
[0060] Figure 2 is a flow chart of an adaptive data distillation method for power equipment component detection shown in the present invention;
[0061] Figure 3 It is a framework diagram of data distillation shown in the present invention;
[0062] Figure 4 It is a structural diagram of an adaptive data distillation system for power equipment component detection shown in the present invention. DETAILED DESCRIPTION
[0063] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0064] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0065] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0066] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and systems according to various embodiments of the present disclosure. It should be noted that each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code may include one or more executable instructions for implementing the logical functions specified in each embodiment. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the flowchart and / or block diagram, and the combination of boxes in the flowchart and / or block diagram can be implemented using a dedicated hardware-based system that performs a specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0067] Embodiment 1
[0068] like Figure 1 As shown, this embodiment provides an adaptive data distillation method for power equipment component detection. This embodiment uses the method applied to a server as an example for illustration. It can be understood that the method can also be applied to a terminal, and can also be applied to a terminal, a server, and a system, and is implemented through the interaction between the terminal and the server. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network servers, cloud communications, middleware services, domain name services, security services CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. In this embodiment, the method includes the following steps:
[0069] An improved teacher network is trained using a set of images labeled with power equipment components;
[0070] Selecting an unlabeled core image set from an unlabeled image set of power equipment parts;
[0071] A self-ensemble data distillation method is used to generate pseudo labels for the unlabeled core image set;
[0072] The improved student network is trained using a core set of pseudo-labeled images;
[0073] The core image set is fused with the image set of labeled power equipment components to obtain a fused image set; the fused image set is used to retrain the improved teacher network and the improved student network to obtain a trained student model for inspecting power equipment components in new images;
[0074] Among them, both the improved teacher network and the improved student network introduce a dynamic anchor point mechanism in the YOLOv8 network to dynamically adjust the anchor frame according to the size ratio distribution of power equipment components; the decoding head is divided into multiple levels to process anchor frames of different scales separately.
[0075] The present invention constructs a teacher network model for power equipment component detection based on the YOLOv8 model with a dynamic anchor mechanism, and uses limited labeled data for preliminary training; on this basis, it innovatively introduces an adaptive core data set screening algorithm based on pre-trained large model feature extraction and clustering to automatically identify the most representative core samples from large-scale unlabeled data. Then, through the self-ensemble data distillation technology, more accurate pseudo-labels are generated for these core samples, and these pseudo-labels are used to train a student network model with optimized performance.
[0076] The present embodiment is described in detail below with reference to the accompanying drawings. Figure 1 , Figure 2 As shown:
[0077] Step (1): Use limited labeled data to train a YOLOv8 power equipment component detection teacher network model that introduces a dynamic anchor mechanism;
[0078] Step (2): Use the feature extraction and feature clustering method based on the pre-trained large model to automatically cluster the large-scale unlabeled data with adaptive parameters, and use a hybrid sampling strategy to screen and obtain the unlabeled core data set;
[0079] Step (3): Use the self-ensemble data distillation technique to adaptively optimize and integrate multiple prediction results of the teacher network to obtain the pseudo label of each image in the unlabeled core set;
[0080] Step (4): Use the generated pseudo-label data to train a new YOLOv8 power equipment component detection student network model based on a dynamic anchor mechanism;
[0081] Step (5): Alternately iterate the dataset update and model training to obtain a concentrated dataset after distillation and a high-performance detection model to achieve efficient management of data resources.
[0082] In some embodiments, in step (1), the YOLOv8 model pre-trained in the general target detection dataset is selected as the basic model, and the model is improved according to the categories and characteristics of the power equipment components. Specifically, considering the various shapes and sizes of power equipment components, the YOLOv8 model decoding head based on the fixed anchor mechanism is replaced.
[0083] First, after modifying and adapting the classification head, a dynamic anchor mechanism is introduced to automatically adjust the size and proportion of the anchor according to the actual detection results of the power equipment components, thereby improving the model's adaptability to targets of different shapes and sizes. Specifically, during the training process, the model will calculate the width W and height H of the target bounding box and their ratio (W / H) based on the size distribution of the actual target, and generate the corresponding anchor. This enables the anchor to automatically adapt to different targets in the detection task, not limited to the preset fixed anchor box.
[0084] For each target category C i The target bounding box that appears in the training set is counted to obtain the scale distribution of the bounding box of this category in the training set. Assume that the target bounding box is (W i ,H i ), the scale ratio distribution of the target can be calculated:
[0085] Aspect Ratio(C i )=W i / H i
[0086] Based on this distribution, the dynamic anchor mechanism adjusts the scale of the anchor box through the formula (A w ,A h ):
[0087] A w =f(W i )
[0088] A h =f(H i )
[0089] The function f() is designed based on the scale changes of the bounding boxes in the training set, ensuring that the generated anchors can better adapt to the actual sizes of different categories of objects. The dynamic anchor mechanism will also be adjusted in real time based on the detection results in each image to ensure that the model can efficiently capture objects in different scenarios.
[0090] Secondly, the decoding head is divided into multiple layers to process objects of different scales separately. The dynamic anchor mechanism and layered decoding strategy are used to improve the adaptability of the model to objects of different shapes and sizes. The improved teacher network model is trained and tuned in a limited-scale labeled power equipment image dataset.
[0091] In some embodiments, in step (2), the visual encoder of the pre-trained large model CLIP is first used to extract the features of each image in the large-scale unlabeled raw data. Then, the image features are clustered by the DBSCAN automatic clustering method, and an adaptive clustering optimization strategy is introduced to automatically adjust the DBSCAN parameters (neighborhood radius eps) according to the data distribution to ensure that the clustering can be adaptively adjusted, thereby improving the stability of the clustering, reducing the number of isolated points (noise), and enhancing the representativeness of the core samples.
[0092] The specific automatic parameter adjustment strategy is as follows. Dynamically adjust the neighborhood radius eps based on the local density distribution of the data set. First calculate the K nearest neighbor distances of the image feature (for example, K = 5) and analyze the distribution of the distances. Dynamically set eps based on the local density estimate, that is:
[0093] eps=α·mean(d k )
[0094] Among them, mean(d k ) is the mean of the Kth nearest neighbor distances, and α is an adjustment factor that is adjusted according to the sparsity of the data.
[0095] After the initial clustering, the hierarchical clustering algorithm is used to further segment or merge the clustering results so that each cluster can more accurately reflect the internal structure of the data. The preliminary DBSCAN clustering results are analyzed. If the density changes within some clusters are large, these clusters can be further segmented through hierarchical clustering. On the contrary, if the boundaries between some clusters are not clear, they can be merged. The segmentation criterion is that for areas with significant changes in density gradients, a hierarchical segmentation algorithm that aggregates hierarchical clustering from bottom to top is used.
[0096] The specific formula is:
[0097]
[0098] Among them, D(C i ,C j ) is cluster C i and C j The average distance between them, distance(x,y) is the distance between samples. i ,C j) is less than the set threshold, clustering is performed; if the internal distance is too large, segmentation is performed.
[0099] Finally, a hybrid sampling strategy is adopted, combining the central sample sampling and the boundary sample sampling methods, and the sampling ratio is dynamically adjusted according to the compactness of the cluster. In tight clustering, more emphasis is placed on selecting boundary samples; in loose clustering, the central samples are given priority. This method can ensure that different types of data are reasonably covered, and the most representative and information-rich samples are selected while ensuring sample diversity, thereby concentrating the original data set, reducing storage space and subsequently reducing the training time of the model.
[0100] The center sample is defined as:
[0101]
[0102] Among them, center(C i ) is cluster C i The point with the smallest distance to other points represents the center of the cluster.
[0103] The boundary samples are defined as:
[0104] boundary(C i )={x∈C i |distance(x,neighbor(C i )) <threshold}
[0105] Among them, neighbor(C i ) is the same as C i Other adjacent clusters, distance(x,neighbor(C i )) represents the distance between the sample and the adjacent cluster.
[0106] The sampling ratio of the center sample and the boundary sample is dynamically adjusted according to the density of the cluster. Assume that the density is defined as the average distance density (C i ), the following rules can be used to adjust the sampling ratio:
[0107]
[0108] Among them, p center is the sampling probability of the center sample, λ is the adjustment factor, and μ is the density threshold. For dense clustering, density(C i ) is larger, the sampling probability of the center sample is lower, and the sampling probability of the boundary sample is higher. For loose clustering, the sampling probability of the center sample increases.
[0109] In some embodiments, in step (3), a self-integrated data distillation method is used to generate pseudo labels for images in the unlabeled core dataset. Figure 3 As shown in the figure, the specific method is to randomly rotate, crop and change the color of any image, then input it into the trained teacher network for inference, and fuse the detection results of different transformed images. A dynamic uncertainty evaluation mechanism is introduced to calculate the prediction uncertainty of the teacher network on different transformed images, and the pseudo labels in high uncertainty areas are downgraded, or their confidence is improved through multiple inferences, thereby reducing the misleading in pseudo labels and improving the model accuracy.
[0110] Among them, the calculation of uncertainty, for each image, after multiple random transformations (such as rotation, cropping, color change), the teacher network infers each transformed image segment and obtains multiple detection results. If the results after different transformations are very different, it means that there is a high uncertainty in this area. The uncertainty can be measured by the following formula:
[0111]
[0112] Among them, U(x) is the uncertainty of the target box on image x, p t (x) is the confidence of the teacher network for the target box after the tth transformation, T is the number of transformations. If the uncertainty U(x) is high, it means that the prediction of the target box is relatively unstable.
[0113] For target boxes with high uncertainty, dynamically reduce their weights to reduce their impact on pseudo-label generation. Set the confidence to α(x), which is dynamically adjusted according to the uncertainty:
[0114]
[0115] Among them, σ and is the adjustment coefficient. For regions with higher uncertainty, α(x) tends to decrease, thereby reducing the impact of pseudo labels.
[0116] In addition, an adaptive pseudo-label optimization strategy is proposed, which not only considers the intersection-over-union ratio, but also introduces a semantic consistency metric to judge the reliability of the target box by comparing the semantic features of the components detected in different transformed images. Target boxes with high semantic consistency will be given higher weights, while target boxes with inconsistent semantics need to be re-evaluated.
[0117] Among them, the intersection over union (IoU) is used to measure the degree of position overlap of the target box. The specific formula is:
[0118]
[0119] Among them, B1 and B2 are target boxes generated after different transformations. If the intersection over union ratio is high, it means that the positions of the target boxes are highly overlapped and the reliability is high. Based on IoU, it can be determined whether to retain or modify certain detection boxes.
[0120] In addition to the overlap of the target frame positions, their semantic consistency must also be considered. Even if the target frames are close in position, if their semantic features are inconsistent, it means that the detection result may be wrong. The present invention performs semantic analysis based on the features of the target frame and uses cosine similarity to measure the similarity of the semantic features of the detection frame:
[0121]
[0122] Among them, v(x1) and v(x2) are the semantic feature vectors of the target box in different transformed images. If the semantic similarity metric value is high, it means that the semantic consistency of the target box is high and the detection box is more reliable.
[0123] When generating pseudo labels, the IoU and semantic similarity of the target box are considered at the same time to comprehensively measure the reliability of the target box. A fusion weight γ(x) is assigned to each target box, and the formula is:
[0124] γ(x)=β·IoU(B1,B2)+(1-β)·Semantic_Sim(x1,x2)
[0125] Among them, β is a balancing factor, which is used to adjust the weight of IoU and semantic similarity in fusion. When the position and semantic features of the target box are highly consistent, γ(x) is high, and the target box will be given a higher confidence, otherwise it needs to be re-evaluated.
[0126] Through dynamic uncertainty assessment and adaptive pseudo-label optimization, the problem of missed detection can be effectively alleviated, misleading information can be reduced, the accuracy of detection boxes can be improved, and the training of models on unlabeled datasets can be made more efficient and reliable.
[0127] In some embodiments, in step (4), a new YOLOv8 network based on a dynamic anchor mechanism is trained using the core dataset and pseudo labels generated by distillation as a newly trained student network.
[0128] In some embodiments, in step (5), the core data set is fused with the labeled data set to obtain an updated data set, and the teacher network is retrained with the data set, and then subsequent steps are performed to finally generate a concentrated data set and an updated student network as the final model for power equipment component detection. Through multiple rounds of iterative optimization, the teacher network is retrained after each round of iteration to generate updated pseudo labels, and the core data set is further refined, so that the performance of the teacher network and the student network is gradually improved, and finally converges to a high-precision model. This strategy can fully tap the potential of the data set, significantly improve the generalization ability of the model, and screen out a representative core data set to achieve efficient management of data resources.
[0129] The present invention adopts a dynamic iteration strategy, that is, through the alternating iteration of data set update and model training, the core data set and the detection model are optimized together. In each iteration, the model can not only obtain more accurate feature information from the new core data set, but also gradually optimize the screening algorithm through the feedback mechanism, thereby further improving the utilization efficiency of unlabeled data and the final performance of the model.
[0130] The present invention can generate an efficient condensed data set under the environment of limited labeled data and a large amount of unlabeled data, and train a detection model for power equipment components with better performance, greatly improving the accuracy and stability of detection, and optimizing the efficient management of data resources, and has broad practical application value.
[0131] Embodiment 2
[0132] This embodiment provides an adaptive data distillation system for power equipment component detection.
[0133] like Figure 4 As shown, an adaptive data distillation system for power equipment component detection includes:
[0134] A teacher network training module, which is configured to: train an improved teacher network using an image set labeled with power equipment components;
[0135] A screening module is configured to: screen an unlabeled core image set from an unlabeled image set of power equipment components;
[0136] A pseudo-label generation module, configured to: generate pseudo-labels for an unlabeled core image set using a self-ensemble data distillation method;
[0137] A student network training module, which is configured to: train an improved student network using a core image set with pseudo labels;
[0138] The detection module is configured to: fuse the core image set with the image set annotated with the power equipment components to obtain a fused image set; retrain the improved teacher network and the improved student network using the fused image set to obtain a trained student model for inspecting the power equipment components in the new image;
[0139] Among them, both the improved teacher network and the improved student network introduce a dynamic anchor point mechanism in the YOLOv8 network to dynamically adjust the anchor frame according to the size ratio distribution of power equipment components; the decoding head is divided into multiple levels to process anchor frames of different scales separately.
[0140] In some embodiments, the anchor frame is dynamically adjusted according to the size ratio distribution of the power equipment components, which is expressed by the following formula:
[0141] Aspect Ratio(C i )=W i / H i
[0142] A w =f(W i )
[0143] A h =f(H i )
[0144] Among them, C i Indicates the type of power equipment components, W i represents the width of the target bounding box, H i Indicates the height of the target bounding box, Aspect Ratio (C i ) represents the size ratio distribution of power equipment components, A w represents the width of the anchor frame after dynamic adjustment, f() represents the function designed according to the scale change of the power equipment components, A h Indicates the height of the anchor box after dynamic adjustment.
[0145] In some embodiments, the screening module is further configured to: based on the image set of unlabeled power equipment components, use a visual feature extractor to extract image features of each image to obtain an image feature set; use a clustering method to cluster the image feature set to obtain the density of the clusters; dynamically adjust the sampling ratio of the center sample and the boundary sample according to the density of the clusters to construct an unlabeled core image set.
[0146] In some embodiments, the screening module is further configured to: dynamically adjust the neighborhood radius to perform preliminary clustering according to the local density distribution of the image feature set; analyze the preliminary clustering results, split the clusters whose internal distance is greater than a first set threshold, and merge the clusters whose average threshold between clusters is less than a second set threshold.
[0147] In some embodiments, the central sample is defined as:
[0148]
[0149] Among them, center(C i ) is cluster C i the center of;
[0150] The boundary samples are defined as:
[0151] boundary(C i )={x∈C i |distance(x,neighbor(C i )) <threshold}
[0152] Among them, neighbor(C i ) is the cluster C i Other adjacent clusters, distance(x,neighbor(C i )) represents the distance between the sample and the adjacent cluster.
[0153] In some embodiments, the dynamic adjustment of the sampling ratio of the center sample and the boundary sample according to the compactness of the cluster is expressed by the following formula:
[0154]
[0155] Among them, p center is the sampling probability of the center sample, λ is the adjustment factor, μ is the density threshold, density(C i ) represents the average distance within the cluster, which is defined as the compactness.
[0156] In some embodiments, the pseudo-label generation module is further configured to: perform multiple random transformations on each image in the unlabeled core image set, and input the transformed images into the improved teacher network, so that each image obtains multiple detection results; based on the multiple detection results of each image, measure the uncertainty of the target box; if the uncertainty of the target box is greater than a third set threshold, reduce the weight of the target box, set the confidence level according to the weight of the target box, and generate a pseudo-label for the image according to the confidence level and the detection result.
[0157] In some embodiments, the uncertainty of the measured target frame is expressed by the following formula:
[0158]
[0159] Among them, U(x) is the uncertainty of the target box on image x, p t(x) is the confidence of the teacher network on the target box after the tth transformation, and T is the number of transformations.
[0160] In some embodiments, the confidence level is expressed by the following formula:
[0161]
[0162] Among them, σ and is the adjustment coefficient, and U(x) is the uncertainty of the target box on image x.
[0163] In some embodiments, the pseudo-label generation module is further configured to: use the intersection-over-union ratio to measure the degree of position overlap of the target frames; perform semantic analysis on the features of the target frames, and use cosine similarity to measure the similarity of the semantic features of the target frames; assign a fusion weight to each target frame based on the degree of position overlap of the target frames and the similarity of the semantic features of the target frames, and use the fusion weight to optimize the pseudo-label.
[0164] In some embodiments, the fusion weight is expressed by the following formula:
[0165] γ(x)=β·IoU(B1,B2)+(1-β)·Semantic_Sim(x1,x2)
[0166] Among them, β is a balance factor, which is used to adjust the weight of IoU and semantic similarity in fusion; IoU(B1, B2) represents the degree of position overlap of the target box, and Semantic_Sim(x1, x2) represents the similarity of the semantic features of the target box.
[0167] Embodiment 3
[0168] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the adaptive data distillation method for power equipment component detection as described in the above-mentioned embodiment 1 are implemented.
[0169] Embodiment 4
[0170] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the adaptive data distillation method for power equipment component detection as described in the above-mentioned embodiment 1 are implemented.
[0171] Embodiment 5
[0172] This embodiment provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned adaptive data distillation method for power equipment component detection.
[0173] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0174] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0177] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0178] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An adaptive data distillation method for power equipment component detection, characterized in that: include: An improved teacher network is trained using a set of images labeled with power equipment components; Selecting an unlabeled core image set from an unlabeled image set of power equipment parts; A self-ensemble data distillation method is used to generate pseudo labels for the unlabeled core image set; The improved student network is trained using a core set of pseudo-labeled images; The core image set is fused with the image set annotated with the power equipment components to obtain a fused image set; The improved teacher network and the improved student network are retrained using the fused image set to obtain a trained student model for inspecting power equipment components in new images; Among them, both the improved teacher network and the improved student network introduce a dynamic anchor point mechanism in the YOLOv8 network to dynamically adjust the anchor frame according to the size ratio distribution of power equipment components; the decoding head is divided into multiple levels to process anchor frames of different scales separately.
2. The adaptive data distillation method for power equipment component detection according to claim 1, characterized in that: According to the size ratio distribution of power equipment components, the anchor frame is dynamically adjusted, which is expressed by the following formula: Aspect Ratio(C i )=W i / H i A w =f(W i ) A h =f(H i ) Among them, C i Indicates the type of power equipment components, W i represents the width of the target bounding box, H i Indicates the height of the target bounding box, Aspect Ratio (C i ) represents the size ratio distribution of power equipment components, A w represents the width of the anchor frame after dynamic adjustment, f() represents the function designed according to the scale change of the power equipment components, A h Indicates the height of the anchor box after dynamic adjustment.
3. The adaptive data distillation method for power equipment component detection according to claim 1, characterized in that: The method for selecting an unlabeled core image set from an image set of unlabeled power equipment components includes: based on the image set of unlabeled power equipment components, using a visual feature extractor to extract image features of each image to obtain an image feature set; using a clustering method to cluster the image feature set to obtain the compactness of the clusters; and dynamically adjusting the sampling ratio of center samples and boundary samples according to the compactness of the clusters to construct an unlabeled core image set.
4. The adaptive data distillation method for power equipment component detection according to claim 3, characterized in that: The clustering method is used to cluster the image feature set to obtain the compactness of the cluster, and the method includes: dynamically adjusting the neighborhood radius according to the local density distribution of the image feature set to perform preliminary clustering; analyzing the preliminary clustering results, dividing the clusters whose internal distance is greater than a first set threshold, and merging the clusters whose average threshold between clusters is less than a second set threshold.
5. The adaptive data distillation method for power equipment component detection according to claim 3, characterized in that: The central sample is defined as: Among them, center(C i ) is cluster C i the center of; The boundary samples are defined as: boundary(C i )={x∈C i |distance(x,neighbor(C i ))<threshold} Among them, neighbor(C i ) is the cluster C i Other adjacent clusters, distance(x,neighbor(C i )) represents the distance between the sample and the adjacent cluster; Alternatively, the sampling ratio of the center sample and the boundary sample is dynamically adjusted according to the compactness of the cluster, which is expressed by the following formula: Among them, p center is the sampling probability of the center sample, λ is the adjustment factor, μ is the density threshold, density(C i ) represents the average distance within the cluster, which is defined as the compactness.
6. The adaptive data distillation method for power equipment component detection according to claim 1, characterized in that: A self-integrated data distillation method is used to generate pseudo labels for an unlabeled core image set, the method comprising: performing multiple random transformations on each image in the unlabeled core image set and inputting the transformed image into an improved teacher network, so that each image obtains multiple detection results; based on the multiple detection results of each image, the uncertainty of the target box is measured; if the uncertainty of the target box is greater than a third set threshold, the weight of the target box is reduced, a confidence level is set according to the weight of the target box, and a pseudo label of the image is generated according to the confidence level and the detection result; Or, the uncertainty of the target frame is expressed by the following formula: Among them, U(x) is the uncertainty of the target box on image x, p t (x) is the confidence of the teacher network on the target box after the tth transformation, where T is the number of transformations; Or, the confidence level is expressed by the following formula: Among them, σ and is the adjustment coefficient, U(x) is the uncertainty of the target box on image x; Or, after the pseudo-label is generated, the pseudo-label is optimized: the intersection-over-union ratio is used to measure the position overlap of the target frame; semantic analysis is performed on the features of the target frame, and the cosine similarity is used to measure the similarity of the semantic features of the target frame; a fusion weight is assigned to each target frame according to the position overlap of the target frame and the similarity of the semantic features of the target frame, and the pseudo-label is optimized using the fusion weight; Or, the fusion weight is expressed by the following formula: γ(x)=β·IoU(B1,B2)+(1-β)·Semantic_Sim(x1,x2) Among them, β is a balance factor, which is used to adjust the weight of IoU and semantic similarity in fusion; IoU(B1, B2) represents the degree of position overlap of the target box, and Semantic_Sim(x1, x2) represents the similarity of the semantic features of the target box.
7. An adaptive data distillation system for power equipment component detection, characterized in that: include: A teacher network training module, which is configured to: train an improved teacher network using an image set labeled with power equipment components; A screening module is configured to: screen an unlabeled core image set from an unlabeled image set of power equipment components; A pseudo-label generation module, configured to: generate pseudo-labels for an unlabeled core image set using a self-ensemble data distillation method; A student network training module, which is configured to: train an improved student network using a core image set with pseudo labels; A detection module is configured to: fuse the core image set with the image set annotated with the power equipment components to obtain a fused image set; The improved teacher network and the improved student network are retrained using the fused image set to obtain a trained student model for inspecting power equipment components in new images; Among them, both the improved teacher network and the improved student network introduce a dynamic anchor point mechanism in the YOLOv8 network to dynamically adjust the anchor frame according to the size ratio distribution of power equipment components; the decoding head is divided into multiple levels to process anchor frames of different scales separately.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the adaptive data distillation method for power equipment component detection as described in any one of claims 1 to 6 are implemented.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the adaptive data distillation method for power equipment component detection as described in any one of claims 1-6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the steps in the adaptive data distillation method for power equipment component detection as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Semi-supervised learning power equipment target detection model training method, detection method and device
CN116091858A
SAR (Synthetic Aperture Radar) image nearshore ship target detection method based on semi-soft label
CN116563697A
Pump equipment operation fault diagnosis method and device based on small samples
CN117056678A
Semi-supervised 3D target detection method, system and equipment based on digital twinning
CN117649515A
Power transmission line defect and target detection bionic model based on cascade distillation
CN117853412A
