Electric power defect identification model construction method and device and computer equipment
By obtaining the feature data set and identification feature data set of the teacher model in the power inspection scenario, and training and optimizing the student model, the problem of insufficient power defect identification performance in the complex power inspection scenario is solved, and efficient and accurate power defects are achieved Identify and ensure the safe and stable operation of the power system.
Patent Information
- Application Number
- CN202411085532.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-19
AI Technical Summary
Existing power inspection technology is difficult to effectively identify power defects in complex power inspection scenarios, especially in environments with large geographical spans, complex terrain, and many changes in seasons and sunshine, resulting in insufficient identification performance and affecting the safe and stable operation of the power system. .
By obtaining the target scene feature data set of the teacher model and identifying the target power defect, knowledge distillation and training the student model, combining the backbone network, detection head network, and auxiliary head network, target classification and coordinate regression loss function and prospect The target loss function and the distance penalty loss function optimize the student model to improve its recognition performance in complex scenarios.
It significantly improves the automation level and efficiency of power inspections, reduces the time and cost of manual inspections, promptly and accurately identify power defects and safety hazards, and ensures the safe and stable operation of the power system.
Smart Images

Figure CN118981682A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electric power inspection technology, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for constructing an electric power defect identification model. Background Art
[0002] With the development of the power industry, the scale of the power grid has expanded rapidly, and people's daily needs for power systems are increasing. Power inspection aims to detect the status of power transmission equipment, discover equipment defects and safety hazards in a timely manner, and plays an important role in ensuring the normal operation of the power system.
[0003] In the field of power inspection, drone intelligent inspection mainly deals with target detection and fault identification tasks. The target detection task is for equipment such as insulators, transmission lines, anti-vibration hammers and spacers, while the fault identification task is for abnormalities such as bird nests on towers, damaged insulators and icing on transmission lines. At present, target detection technology based on deep learning has gradually replaced traditional positioning methods and has been applied to the field of intelligent inspection. Due to the large geographical span of power lines and the complex terrain covered, power lines are long and have a large geographical span. Affected by regional differences, seasonal changes, and changes in sunshine, the power inspection scene collection environment is highly disturbed, and high requirements are placed on the power defect recognition performance of the model.
[0004] Therefore, there is an urgent need for a method, device, computer equipment, computer-readable storage medium and computer program product for constructing a power defect identification model that can construct a power defect identification model for complex power inspection scenarios. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for constructing a power defect identification model for complex power inspection scenarios in response to the above technical problems.
[0006] In a first aspect, the present application provides a method for constructing a power defect identification model, comprising:
[0007] Obtaining a feature data set of a target scenario of a first teacher model and a feature data set of a second teacher model for identifying a target power defect;
[0008] Training a student model according to the feature data set of the target scenario and the feature data set of identifying the target power defect to obtain a student model for identifying the target power defect in the target scenario;
[0009] Acquire a feature dataset for identifying a target power defect in a target scenario;
[0010] The student model is optimized based on a feature data set for identifying a target power defect in the target scenario.
[0011] In one embodiment, before acquiring the feature data set of the target scene of the first teacher model and the feature data set of the second teacher model for identifying the target power defect, the method further includes:
[0012] Obtaining a model building task for identifying a target power defect in a target scenario;
[0013] According to the model building task, a first teacher model suitable for the target scenario and a second teacher model suitable for identifying the target power defect are determined.
[0014] In one of the embodiments, the step of training the student model based on the feature data set of the target scenario and the feature data set for identifying the target power defect to obtain the student model for identifying the target power defect in the target scenario further includes:
[0015] Get pre-trained weights;
[0016] The pre-trained weights are used as initial parameters of the student model, and the initial parameters are utilized to participate in the convergence process of the student model.
[0017] In one embodiment, the student model includes a backbone network, a detection head network, a first auxiliary head network and a second auxiliary head network; wherein the depth of the first auxiliary head network is the same as the depth of the detection head network, and the depth of the second auxiliary head network is half of the depth of the detection head network; the final layer of the backbone network is connected to the first auxiliary head network, and the middle layer of the detection head network is connected to the second auxiliary head network;
[0018] The training of the student model according to the feature data set of the target scenario and the feature data set of identifying the target power defect comprises:
[0019] Outputting the first student feature through the final layer of the backbone network, and outputting the second student feature through the intermediate layer of the detection head network;
[0020] Outputting a first auxiliary feature according to the first student feature and the first auxiliary head network, and outputting a second auxiliary feature according to the second student feature and the second auxiliary head network;
[0021] The student model is trained according to the first auxiliary feature, the second auxiliary feature, the feature data set of the target scene, and the feature data set for identifying the target power defect.
[0022] In one embodiment, the method further comprises:
[0023] In the process of training the student model, the student model is adjusted according to a preset weight formula using a target classification and coordinate regression loss function, a foreground target loss function, and a distance penalty loss function.
[0024] In one embodiment, the student model is adjusted using a distance penalty loss function, including:
[0025] Obtaining a first teacher feature output by the first teacher model and a second teacher feature output by the second teacher model;
[0026] Obtain the Manhattan distance between the first auxiliary feature and the first teacher feature, and the Euclidean distance between the second auxiliary feature and the second teacher feature, and use the Manhattan distance and the Euclidean distance as input parameters of the distance penalty loss function.
[0027] In a second aspect, the present application also provides a device for constructing a power defect identification model, comprising:
[0028] An acquisition module, used to acquire a feature data set of a target scene of a first teacher model and a feature data set of a second teacher model for identifying a target power defect;
[0029] A model training module, used to train a student model according to the characteristic data set of the target scenario and the characteristic data set of identifying the target power defect, so as to obtain a student model for identifying the target power defect in the target scenario;
[0030] The acquisition module is also used to acquire a feature data set for identifying a target power defect in a target scenario;
[0031] A model optimization module is used to optimize the student model according to a feature data set for identifying a target power defect in the target scenario.
[0032] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Obtaining a feature data set of a target scenario of a first teacher model and a feature data set of a second teacher model for identifying a target power defect;
[0034] Training a student model according to the feature data set of the target scenario and the feature data set of identifying the target power defect to obtain a student model for identifying the target power defect in the target scenario;
[0035] Acquire a feature dataset for identifying a target power defect in a target scenario;
[0036] The student model is optimized based on a feature data set for identifying a target power defect in the target scenario.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0038] Obtaining a feature data set of a target scenario of a first teacher model and a feature data set of a second teacher model for identifying a target power defect;
[0039] Training a student model according to the feature data set of the target scenario and the feature data set of identifying the target power defect to obtain a student model for identifying the target power defect in the target scenario;
[0040] Acquire a feature dataset for identifying a target power defect in a target scenario;
[0041] The student model is optimized based on a feature data set for identifying a target power defect in the target scenario.
[0042] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0043] Obtaining a feature data set of a target scenario of a first teacher model and a feature data set of a second teacher model for identifying a target power defect;
[0044] Training a student model according to the feature data set of the target scenario and the feature data set of identifying the target power defect to obtain a student model for identifying the target power defect in the target scenario;
[0045] Acquire a feature dataset for identifying a target power defect in a target scenario;
[0046] The student model is optimized based on a feature data set for identifying a target power defect in the target scenario.
[0047] The above-mentioned power defect recognition model construction method, device, computer equipment, computer-readable storage medium and computer program product obtain the target scene feature data set of the first teacher model and the feature data set of the second teacher model for identifying the target power defect. After knowledge distillation of these data sets, the student model is trained to achieve the purpose of how to identify specific target scenes and power defects from power inspection images; after the initial training of the student model is completed, the feature data set for identifying the target power defect in the target scene is further obtained, and then the student model is optimized based on these data, which can improve the recognition performance of the model. Due to the complexity of the power inspection scene, including large geographical spans, complex terrain, seasonal and sunshine changes, etc., this scheme emphasizes that the model needs to have high recognition performance in these complex environments. Through an automated deep learning model, the efficiency of power inspection can be significantly improved, and the time and cost of manual inspection can be reduced. Timely and accurate identification of power defects and safety hazards will help prevent power accidents and ensure the safe and stable operation of the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 An application environment diagram of a method for building a power defect identification model in an embodiment;
[0050] Figure 2 A schematic diagram of a flow chart of a method for constructing a power defect identification model in one embodiment;
[0051] Figure 3 It is an overall schematic diagram of a method for constructing a power defect identification model in one embodiment;
[0052] Figure 4 A schematic diagram of a flow chart of a method for constructing a power defect identification model in another embodiment;
[0053] Figure 5 A structural block diagram of a device for building a power defect identification model in one embodiment;
[0054] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The power defect recognition model construction method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.
[0057] Server 104 is used to obtain a feature data set of a target scenario for a first teacher model and a feature data set of a second teacher model for identifying a target power defect; train a student model based on the feature data set of the target scenario and the feature data set for identifying the target power defect to obtain a student model for identifying the target power defect in the target scenario; obtain a feature data set for identifying the target power defect in the target scenario; and optimize the student model based on the feature data set for identifying the target power defect in the target scenario.
[0058] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, projection devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0059] In an exemplary embodiment, Figure 2 As shown in the figure, a method for constructing a power defect recognition model is provided, and the method is applied to Figure 1 The server in the example is used to illustrate, including the following steps S202 to S208. Among them:
[0060] Step S202, obtaining a feature data set of a target scene of the first teacher model and a feature data set of a second teacher model for identifying a target power defect.
[0061] The teacher model refers to a trained object detection model that has the ability to identify specific objects or defects in a specific scenario. In this solution, there are two teacher models, each with its own specific task and feature dataset.
[0062] The feature dataset of the first teacher model contains features related to the scenario used when the first teacher model was trained. Figure 3 As shown, if the first teacher model is trained for the recognition of pressure equalizing ring detachment defects in area A, then its feature dataset contains images and features related to the pressure equalizing rings in the area.
[0063] Similar to the first teacher model, the feature dataset of the second teacher model contains the features used in its training, which are related to the identification of power defects. For example, if the second teacher model is trained for the identification of insulator self-explosion defects in region B, its feature dataset contains images and features related to insulator self-explosion.
[0064] The feature dataset contains not only images, but also features extracted by the teacher model from these images. These features are abstract representations learned by the model that capture key information in the image and help identify and classify objects.
[0065] Among them, the student model (the model that identifies the target power defect in the target scenario, such as identifying the insulator self-explosion defect in area A) will be trained using the feature data set of these teacher models. In this way, the student model can obtain supervision information from the features learned by the teacher model and improve its ability to identify the target power defect in the target scenario.
[0066] By integrating features from different teacher models, the student model can obtain richer and more diverse knowledge, which helps to better generalize to new or unseen scenes. Since different teacher models may have learned different feature representations, appropriate transformation and alignment are required when integrating these features to ensure that they can work effectively together in the student model.
[0067] It should be noted that the specific structures of the teacher model and the student model are not fixed and can be selected according to actual conditions, as long as they have the basic framework of the backbone network and the detection head network.
[0068] Step S204 , training the student model according to the feature data set of the target scenario and the feature data set for identifying the target power defect, to obtain the student model for identifying the target power defect in the target scenario.
[0069] Specifically, training the student model includes using the two feature datasets mentioned above to train the model so that it can identify power equipment in the target scene and defects on these equipment. The training process involves forward propagation (model prediction) and back propagation (error back propagation to update model parameters). The student model extracts image features through the backbone network, which captures key information in the image and helps with subsequent defect identification. The detection head network of the student model uses the extracted features to generate the detection box coordinates and defect type of the target. This usually involves classification (determining the defect type) and regression (determining the location of the defect in the image). During the training process, the output of the model is compared with the true value annotation results to calculate the loss function (such as classification loss and coordinate regression loss). The goal of model training is to minimize this loss function.
[0070] An optimization algorithm (such as gradient descent) is used to update the model's parameters based on the results of the loss function to reduce the difference between the prediction and the true annotation. Through training, the student model learns how to identify the target power defect in the target scenario, so that it has the ability to generalize to new data. After training is completed, the performance of the student model is usually evaluated on a validation set or a test set to ensure its effectiveness in practical applications.
[0071] Step S206, obtaining a feature data set for identifying a target power defect in a target scenario.
[0072] Specifically, after the student model is constructed, the student model is used to obtain a feature data set for identifying target power defects in a target scenario. For example, a feature data set for identifying insulator self-explosion defects in region A is obtained.
[0073] Step S208, optimizing the student model according to the feature data set for identifying the target power defect in the target scenario.
[0074] Specifically, the feature data set generated in step S206 is used as training data to further train and optimize the student model. The optimization strategy includes:
[0075] Parameter adjustment: According to the characteristics of the new data set, adjust the parameters of the student model, such as learning rate, regularization coefficient, etc.
[0076] Network structure adjustment: Adjust the network structure of the student model, such as adding or reducing certain layers, to better adapt to the new data set.
[0077] Loss function adjustment: According to the characteristics of the new data set, adjust the weight of the loss function to make it more consistent with the optimization goal.
[0078] Model evaluation: During the optimization process, continuously evaluate the performance of the model to ensure that it can effectively identify defects in the target scenario. This may include evaluation using a validation set or a test set.
[0079] In general, the ultimate goal is to obtain an optimized student model that can accurately identify target power defects in target scenarios and improve the automation level and efficiency of power inspections.
[0080] In the above-mentioned method for constructing a power defect recognition model, the target scene feature data set of the first teacher model and the feature data set for identifying the target power defect of the second teacher model are obtained. After knowledge distillation of these data sets, the student model is trained to achieve the purpose of how to identify specific target scenes and power defects from power inspection images; after the initial training of the student model is completed, the feature data set for identifying the target power defect in the target scene is further obtained, and then the student model is optimized based on these data, which can improve the recognition performance of the model. Due to the complexity of power inspection scenarios, including large geographical spans, complex terrain, seasonal and sunshine changes, etc., this scheme emphasizes that the model needs to have high recognition performance in these complex environments. Through automated deep learning models, the efficiency of power inspections can be significantly improved, and the time and cost of manual inspections can be reduced. Timely and accurate identification of power defects and safety hazards will help prevent power accidents and ensure the safe and stable operation of power systems.
[0081] In an exemplary embodiment, before acquiring the feature data set of the target scene of the first teacher model and the feature data set of the second teacher model for identifying the target power defect, the method further includes:
[0082] Obtaining a model building task for identifying a target power defect in a target scenario;
[0083] According to the model building task, a first teacher model suitable for the target scenario and a second teacher model suitable for identifying the target power defects are determined.
[0084] Specifically, before starting to acquire the data set, we must first clarify the goals and tasks of model building, which means defining the specific tasks that the model needs to complete, such as identifying specific power defects in a specific target scenario.
[0085] The first teacher model is a model trained on the feature dataset of the target scene. This model is able to extract and understand the features of the target scene, such as the features of the power lines and equipment in area A. The second teacher model focuses on identifying the feature dataset of the target power defects. This model is able to identify and classify different power defects, such as insulator self-explosion, tower bird nests, etc.
[0086] When selecting teacher models, it is necessary to consider whether they are suitable for the target scenario and defect identification task. After clarifying the model building task and selecting a suitable teacher model, we start to obtain relevant feature data sets and then train and optimize the student model.
[0087] For example, suppose you need to build a model to identify insulator self-explosion defects in mountainous transmission lines in region A. The task is to identify insulator self-explosion defects in the mountainous transmission line scenario in region A. Select a model trained in region A that can identify the characteristics of transmission lines and other power equipment. Next, select a model that is specifically trained to identify insulator self-explosion defects. This model may have been trained in the plain ecological environment of region B and has a high accuracy in identifying insulator self-explosion.
[0088] After determining the two teacher models, we began to collect image data of power transmission lines in the mountainous area of Region A and labeled data of insulator self-explosion in Region B to form feature data sets. Using these feature data sets, we trained the student model, which combines the first teacher model's ability to understand the target scene and the second teacher model's characteristics for defect recognition. Through training and optimization, the student model will be able to adapt to the specific environment of Region A and accurately identify insulator self-explosion defects.
[0089] In this embodiment, in this way, a deep learning model specifically targeting a specific target scenario and capable of identifying target power defects can be constructed, thereby improving the efficiency and accuracy of power inspections.
[0090] In an exemplary embodiment, the student model is trained according to the feature data set of the target scenario and the feature data set for identifying the target power defect, and before obtaining the student model for identifying the target power defect in the target scenario, the method further includes:
[0091] Obtain pre-trained weights; use the pre-trained weights as initial parameters of the student model, and use the initial parameters to participate in the convergence process of the student model.
[0092] Specifically, pre-trained weights refer to model parameters that have been pre-trained on a large and diverse dataset (such as ImageNet). These weights have learned rich feature representations and can be used as a starting point for new tasks. The main purpose of using pre-trained weights is to use the knowledge learned on a large-scale dataset to improve the learning efficiency and performance of new tasks. These weights contain common feature detectors such as edges, textures, and shapes, which are useful in many visual tasks.
[0093] Before you start training the student model, use the pre-trained weights as the initial parameters of the model. This is equivalent to giving the model a "scratch-start" advantage because it does not need to learn all the features from scratch. When training the student model, the pre-trained weights participate in the optimization process of the model. Through the back-propagation algorithm, the parameters of the model (including the pre-trained weights) are adjusted and optimized based on the data of the new task. In some cases, it may be necessary to fine-tune only certain layers of the pre-trained model while keeping the weights of other layers unchanged. This usually involves freezing the weights of certain layers in the pre-trained model and only training the last few layers of the network or newly added layers.
[0094] In this embodiment, the pre-trained weights are used to initialize the student model, which can accurately identify the target power defects in the target scenario, and the pre-trained weights are used to accelerate the training convergence process of the student model.
[0095] In an exemplary embodiment, the student model includes a backbone network, a detection head network, a first auxiliary head network, and a second auxiliary head network; wherein the depth of the first auxiliary head network is the same as the depth of the detection head network, and the depth of the second auxiliary head network is half of the depth of the detection head network; the final layer of the backbone network is connected to the first auxiliary head network, and the middle layer of the detection head network is connected to the second auxiliary head network;
[0096] like Figure 4 As shown, the student model is trained based on the feature data set of the target scenario and the feature data set for identifying the target power defects, including:
[0097] Step S402, outputting the first student feature through the final layer of the backbone network, and outputting the second student feature through the middle layer of the detection head network;
[0098] Step S404, outputting a first auxiliary feature according to the first student feature and the first auxiliary head network, and outputting a second auxiliary feature according to the second student feature and the second auxiliary head network;
[0099] Step S406, training the student model according to the first auxiliary feature, the second auxiliary feature, the feature data set of the target scene, and the feature data set for identifying the target power defect.
[0100] Specifically, Figure 3As shown in the figure, the backbone network of the student model: the basic part of the network responsible for extracting image features, usually composed of multiple convolutional layers, used to gradually extract and abstract the features of the image. The detection head network of the student model: the part of the network used for target detection based on the features extracted by the backbone network, which may include layers for classification and positioning. The first auxiliary head network: with the same depth as the detection head network, receives features from the final layer of the backbone network of the student model, and is used to extract auxiliary features related to the target scene. The second auxiliary head network: with a depth of half the depth of the detection head network, receives features from the middle layer of the detection head network, and is used to extract more detailed features, which may focus more on local or detail information.
[0101] The first auxiliary head network receives the first student features and outputs the first auxiliary features, which help the model better understand the target scene. The second auxiliary head network receives the second student features and outputs the second auxiliary features, which may help the model capture more detailed defect features. The student model is trained by combining the first auxiliary features and the second auxiliary features, as well as the feature dataset of the target scene and the feature dataset for identifying the target power defects. The auxiliary features are used to provide additional supervision signals to help the student model learn how to identify power defects from features at different levels. The model parameters are optimized through loss functions (which may include classification loss, regression loss, etc.) to make the model's prediction results as close to the true annotation as possible.
[0102] In this embodiment, by combining the features of different levels and the output of the auxiliary network, the student model's ability to identify power defects in the target scenario is improved. The trained student model will be able to more accurately identify power defects in the target scenario, improving the automation and accuracy of power inspections.
[0103] In an exemplary embodiment, during the training of the student model, the student model is adjusted according to a preset weight formula using a target classification and coordinate regression loss function, a foreground target loss function, and a distance penalty loss function.
[0104] Specifically, during the training process, different weights are assigned to different loss functions, which determines the contribution of each loss term to the final loss.
[0105] Among them, target classification loss: cross entropy loss is usually used to measure the difference between the category predicted by the model and the true category. This is crucial to ensure that the model can correctly classify different targets.
[0106] Coordinate regression loss: used to measure the difference between the bounding box coordinates predicted by the model and the true bounding box coordinates. Common loss functions include mean absolute error (MAE) or mean square error (MSE).
[0107] Object Loss: Focuses on the foreground object, which is the object to be detected. It helps the model better distinguish between the foreground object and the background and improves the accuracy of detection.
[0108] Distance Penalty Loss Function: It is used to measure the distance between the features output by the student model and the features output by the teacher model. Common distance metrics include L1 loss, L2 loss or Smooth L1 loss.
[0109] By minimizing this distance, the student model can learn similar feature representations as the teacher model, which helps the student model inherit the knowledge of the teacher model.
[0110] During the training process, it may be necessary to adjust the weights of different loss functions based on the model's performance on the validation set. This helps balance the model's performance in classification, localization, and feature learning. The model's parameters are updated based on the gradients calculated by the loss function through the back-propagation algorithm. This process is iterative, and each iteration aims to reduce the value of the loss function, thereby improving the performance of the model. The ultimate goal is to obtain a student model that performs well in target classification, coordinate regression, and feature learning, enabling it to accurately identify and locate power defects in complex target scenarios.
[0111] In this embodiment, by comprehensively considering multiple loss functions, the student model can not only adapt to the training data, but also improve its generalization ability, that is, it can perform well on unseen data.
[0112] It should be noted that, in this way of adjusting the student model as a whole, the backbone network and part of the detection head network of the student model can be fixed unchanged, and only the rest can be trained. In the process of optimizing the student model, the student model can also be adjusted according to the preset weight formula using the target classification and coordinate regression loss function, the foreground target loss function and the distance penalty loss function.
[0113] In an exemplary embodiment, a first teacher feature output by a first teacher model and a second teacher feature output by a second teacher model are obtained;
[0114] Get the Manhattan distance between the first auxiliary feature and the first teacher feature, and the Euclidean distance between the second auxiliary feature and the second teacher feature, and use the Manhattan distance and the Euclidean distance as input parameters of the distance penalty loss function.
[0115] Specifically, first teacher feature: This refers to the feature obtained from the first teacher model and used to represent the target scene. Second teacher feature: This refers to the feature obtained from the second teacher model and used to represent the power defect.
[0116] Manhattan distance between the first auxiliary feature and the first teacher feature: Manhattan distance (L1 distance) is used to measure the difference between the features output by the first auxiliary head network and the features output by the first teacher model. Manhattan distance simulates the distance of a grid-like path in multidimensional space and is suitable for certain types of data distribution.
[0117] Euclidean distance between the second auxiliary feature and the second teacher feature: Use the Euclidean distance (L2 distance) to measure the difference between the features output by the second auxiliary head network and the features output by the second teacher model. Euclidean distance is the most intuitive distance metric and is suitable for situations where interactions between features need to be considered.
[0118] The calculated Manhattan distance and Euclidean distance are used as input parameters of the distance penalty loss function. The purpose of this loss function is to make the auxiliary features of the student model as close as possible to the features of the teacher model, thereby inheriting the knowledge of the teacher model. This process can be seen as a knowledge distillation technique, in which the knowledge of the teacher model is transferred to the student model. By minimizing the distance between the auxiliary features and the teacher features, the student model can learn useful feature representations of the teacher model.
[0119] When training the student model, in addition to the distance penalty loss, other loss functions such as classification loss, regression loss, etc. may be included to ensure that the student model can achieve good performance in multiple aspects. During the training process, the parameters of the student model are updated by combining the gradients of all loss functions through the back propagation algorithm. The distance penalty term encourages the auxiliary feature network of the student model to produce features similar to those of the teacher model, thereby improving the generalization ability of the model.
[0120] In this way, in this embodiment, the student model not only learns how to accurately identify targets and locate defects, but also learns rich feature representations obtained from the teacher model, which helps to improve the performance of the model in complex scenarios.
[0121] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0122] Based on the same inventive concept, the embodiment of the present application also provides a power defect identification model construction device for implementing the power defect identification model construction method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more power defect identification model construction device embodiments provided below can refer to the limitations of the power defect identification model construction method above, and will not be repeated here.
[0123] In an exemplary embodiment, Figure 5 As shown, a device for constructing a power defect recognition model is provided, including: an acquisition module 502, for acquiring a feature data set of a target scene of a first teacher model, and a feature data set of a second teacher model for identifying a target power defect;
[0124] A model training module 504 is used to train a student model according to the characteristic data set of the target scenario and the characteristic data set of identifying the target power defect, so as to obtain a student model for identifying the target power defect in the target scenario;
[0125] The acquisition module 502 is also used to acquire a feature data set for identifying a target power defect in a target scenario;
[0126] The model optimization module 506 is used to optimize the student model according to the feature data set for identifying the target power defect in the target scenario.
[0127] In an exemplary embodiment, the acquisition module 502 is also used to acquire a model building task for identifying a target power defect in a target scenario; based on the model building task, a first teacher model suitable for the target scenario and a second teacher model suitable for identifying the target power defect are determined.
[0128] In an exemplary embodiment, the model training module 504 is also used to obtain pre-training weights; use the pre-training weights as initial parameters of the student model, and use the initial parameters to participate in the convergence process of the student model.
[0129] In an exemplary embodiment, the student model includes a backbone network, a detection head network, a first auxiliary head network, and a second auxiliary head network; wherein the depth of the first auxiliary head network is the same as the depth of the detection head network, and the depth of the second auxiliary head network is half of the depth of the detection head network; the final layer of the backbone network is connected to the first auxiliary head network, and the middle layer of the detection head network is connected to the second auxiliary head network;
[0130] The model training module 504 is also used to output the first student feature through the final layer of the backbone network, and to output the second student feature through the intermediate layer of the detection head network; output the first auxiliary feature according to the first student feature and the first auxiliary head network, and output the second auxiliary feature according to the second student feature and the second auxiliary head network; and train the student model according to the first auxiliary feature, the second auxiliary feature, the feature data set of the target scene, and the feature data set for identifying the target power defect.
[0131] In an exemplary embodiment, the model optimization module 506 is also used to adjust the student model according to a preset weight formula during the training of the student model by using the target classification and coordinate regression loss function, the foreground target loss function and the distance penalty loss function.
[0132] In an exemplary embodiment, the model optimization module 506 is also used to obtain the first teacher feature output by the first teacher model and the second teacher feature output by the second teacher model; obtain the Manhattan distance between the first auxiliary feature and the first teacher feature, and the Euclidean distance between the second auxiliary feature and the second teacher feature, and use the Manhattan distance and the Euclidean distance as input parameters of the distance penalty loss function.
[0133] Each module in the above-mentioned power defect identification model construction device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0134] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store a feature data set of the target scene of the first teacher model, and a feature data set of the second teacher model for identifying target power defects. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for constructing a power defect identification model is implemented.
[0135] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0136] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0137] Obtaining a feature data set of a target scenario of a first teacher model and a feature data set of a second teacher model for identifying a target power defect;
[0138] The student model is trained according to the feature data set of the target scenario and the feature data set of the target power defect identification to obtain the student model for identifying the target power defect in the target scenario;
[0139] Acquire a feature dataset for identifying a target power defect in a target scenario;
[0140] The student model is optimized based on the feature dataset for identifying the target power defects in the target scenario.
[0141] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0142] Obtaining a model building task for identifying a target power defect in a target scenario;
[0143] According to the model building task, a first teacher model suitable for the target scenario and a second teacher model suitable for identifying the target power defects are determined.
[0144] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0145] Get pre-trained weights;
[0146] The pre-trained weights are used as the initial parameters of the student model, and the initial parameters are used to participate in the convergence process of the student model.
[0147] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0148] The student model includes a backbone network, a detection head network, a first auxiliary head network and a second auxiliary head network; wherein the depth of the first auxiliary head network is the same as the depth of the detection head network, and the depth of the second auxiliary head network is half of the depth of the detection head network; the final layer of the backbone network is connected to the first auxiliary head network, and the middle layer of the detection head network is connected to the second auxiliary head network;
[0149] Output the first student features through the final layer of the backbone network, and output the second student features through the intermediate layer of the detection head network;
[0150] Outputting a first auxiliary feature according to the first student feature and the first auxiliary head network, and outputting a second auxiliary feature according to the second student feature and the second auxiliary head network;
[0151] The student model is trained based on the first auxiliary feature, the second auxiliary feature, the feature data set of the target scene, and the feature data set for identifying the target power defect.
[0152] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0153] In the process of training the student model, the student model is adjusted according to the preset weight formula using the target classification and coordinate regression loss function, the foreground target loss function and the distance penalty loss function.
[0154] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0155] Obtaining a first teacher feature output by the first teacher model and a second teacher feature output by the second teacher model;
[0156] Get the Manhattan distance between the first auxiliary feature and the first teacher feature, and the Euclidean distance between the second auxiliary feature and the second teacher feature, and use the Manhattan distance and the Euclidean distance as input parameters of the distance penalty loss function.
[0157] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0158] Obtaining a feature data set of a target scenario of a first teacher model and a feature data set of a second teacher model for identifying a target power defect;
[0159] The student model is trained according to the feature data set of the target scenario and the feature data set of the target power defect identification to obtain the student model for identifying the target power defect in the target scenario;
[0160] Acquire a feature dataset for identifying a target power defect in a target scenario;
[0161] The student model is optimized based on the feature dataset for identifying the target power defects in the target scenario.
[0162] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0163] Obtaining a model building task for identifying a target power defect in a target scenario;
[0164] According to the model building task, a first teacher model suitable for the target scenario and a second teacher model suitable for identifying the target power defects are determined.
[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0166] Get pre-trained weights;
[0167] The pre-trained weights are used as the initial parameters of the student model, and the initial parameters are used to participate in the convergence process of the student model.
[0168] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0169] The student model includes a backbone network, a detection head network, a first auxiliary head network and a second auxiliary head network; wherein the depth of the first auxiliary head network is the same as the depth of the detection head network, and the depth of the second auxiliary head network is half of the depth of the detection head network; the final layer of the backbone network is connected to the first auxiliary head network, and the middle layer of the detection head network is connected to the second auxiliary head network;
[0170] Output the first student features through the final layer of the backbone network, and output the second student features through the intermediate layer of the detection head network;
[0171] Outputting a first auxiliary feature according to the first student feature and the first auxiliary head network, and outputting a second auxiliary feature according to the second student feature and the second auxiliary head network;
[0172] The student model is trained based on the first auxiliary feature, the second auxiliary feature, the feature data set of the target scene, and the feature data set for identifying the target power defect.
[0173] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0174] In the process of training the student model, the student model is adjusted according to the preset weight formula using the target classification and coordinate regression loss function, the foreground target loss function and the distance penalty loss function.
[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0176] Obtaining a first teacher feature output by the first teacher model and a second teacher feature output by the second teacher model;
[0177] Get the Manhattan distance between the first auxiliary feature and the first teacher feature, and the Euclidean distance between the second auxiliary feature and the second teacher feature, and use the Manhattan distance and the Euclidean distance as input parameters of the distance penalty loss function.
[0178] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0179] Obtaining a feature data set of a target scenario of a first teacher model and a feature data set of a second teacher model for identifying a target power defect;
[0180] The student model is trained according to the feature data set of the target scenario and the feature data set of the target power defect identification to obtain the student model for identifying the target power defect in the target scenario;
[0181] Acquire a feature dataset for identifying a target power defect in a target scenario;
[0182] The student model is optimized based on the feature dataset for identifying the target power defects in the target scenario.
[0183] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0184] Obtaining a model building task for identifying a target power defect in a target scenario;
[0185] According to the model building task, a first teacher model suitable for the target scenario and a second teacher model suitable for identifying the target power defects are determined.
[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0187] Get pre-trained weights;
[0188] The pre-trained weights are used as the initial parameters of the student model, and the initial parameters are used to participate in the convergence process of the student model.
[0189] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0190] The student model includes a backbone network, a detection head network, a first auxiliary head network and a second auxiliary head network; wherein the depth of the first auxiliary head network is the same as the depth of the detection head network, and the depth of the second auxiliary head network is half of the depth of the detection head network; the final layer of the backbone network is connected to the first auxiliary head network, and the middle layer of the detection head network is connected to the second auxiliary head network;
[0191] Output the first student features through the final layer of the backbone network, and output the second student features through the intermediate layer of the detection head network;
[0192] Outputting a first auxiliary feature according to the first student feature and the first auxiliary head network, and outputting a second auxiliary feature according to the second student feature and the second auxiliary head network;
[0193] The student model is trained based on the first auxiliary feature, the second auxiliary feature, the feature data set of the target scene, and the feature data set for identifying the target power defect.
[0194] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0195] In the process of training the student model, the student model is adjusted according to the preset weight formula using the target classification and coordinate regression loss function, the foreground target loss function and the distance penalty loss function.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0197] Obtaining a first teacher feature output by the first teacher model and a second teacher feature output by the second teacher model;
[0198] Get the Manhattan distance between the first auxiliary feature and the first teacher feature, and the Euclidean distance between the second auxiliary feature and the second teacher feature, and use the Manhattan distance and the Euclidean distance as input parameters of the distance penalty loss function.
[0199] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0200] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0201] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0202] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for constructing a power defect identification model, characterized in that: The method comprises: Obtaining a feature data set of a target scenario of a first teacher model and a feature data set of a second teacher model for identifying a target power defect; Training a student model according to the feature data set of the target scenario and the feature data set for identifying the target power defect, to obtain a student model for identifying the target power defect in the target scenario; Acquire a feature dataset for identifying a target power defect in a target scenario; The student model is optimized based on a feature data set for identifying a target power defect in the target scenario.
2. The method according to claim 1, characterized in that Before obtaining the feature data set of the target scene of the first teacher model and the feature data set of the second teacher model for identifying the target power defect, the method further includes: Obtaining a model building task for identifying a target power defect in a target scenario; According to the model building task, a first teacher model suitable for the target scenario and a second teacher model suitable for identifying the target power defect are determined.
3. The method according to claim 1, characterized in that: Before training the student model according to the feature data set of the target scenario and the feature data set for identifying the target power defect to obtain the student model for identifying the target power defect in the target scenario, the method further includes: Get pre-trained weights; The pre-trained weights are used as initial parameters of the student model, and the initial parameters are utilized to participate in the convergence process of the student model.
4. The method according to claim 1, characterized in that The student model includes a backbone network, a detection head network, a first auxiliary head network and a second auxiliary head network; wherein the depth of the first auxiliary head network is the same as the depth of the detection head network, and the depth of the second auxiliary head network is half of the depth of the detection head network; the final layer of the backbone network is connected to the first auxiliary head network, and the middle layer of the detection head network is connected to the second auxiliary head network; The training of the student model according to the feature data set of the target scenario and the feature data set of identifying the target power defect comprises: Outputting the first student feature through the final layer of the backbone network, and outputting the second student feature through the intermediate layer of the detection head network; Outputting a first auxiliary feature according to the first student feature and the first auxiliary head network, and outputting a second auxiliary feature according to the second student feature and the second auxiliary head network; The student model is trained according to the first auxiliary feature, the second auxiliary feature, the feature data set of the target scene, and the feature data set for identifying the target power defect.
5. The method according to claim 4, characterized in that The method further comprises: In the process of training the student model, the student model is adjusted according to a preset weight formula using a target classification and coordinate regression loss function, a foreground target loss function, and a distance penalty loss function.
6. The method according to claim 5, characterized in that The student model is adjusted using a distance penalty loss function, including: Obtaining a first teacher feature output by the first teacher model and a second teacher feature output by the second teacher model; Obtain the Manhattan distance between the first auxiliary feature and the first teacher feature, and the Euclidean distance between the second auxiliary feature and the second teacher feature, and use the Manhattan distance and the Euclidean distance as input parameters of the distance penalty loss function.
7. A device for constructing a power defect identification model, characterized in that: The device comprises: An acquisition module, used to acquire a feature data set of a target scene of a first teacher model and a feature data set of a second teacher model for identifying a target power defect; A model training module, used to train a student model according to the characteristic data set of the target scenario and the characteristic data set of identifying the target power defect, so as to obtain a student model for identifying the target power defect in the target scenario; The acquisition module is also used to acquire a feature data set for identifying a target power defect in a target scenario; A model optimization module is used to optimize the student model according to a feature data set for identifying a target power defect in the target scenario.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Label screening method and device
CN114021720A
Power transmission overhead line defect identification method and device, equipment and storage medium
CN116188998A
Complex scene power equipment defect identification method and device and computer equipment
CN116343132A
Multi-source domain adaptive EEG emotional state classification method based on knowledge distillation
CN116821764A
Knowledge distillation method and device for image mask pre-training
CN116894995A
