Power defect detection model training method and device, computer device and medium

Through patent applications for power defect detection models, it is possible to realize power quantification models of power systems and to perform distillation processing on power distillation models, thereby solving the problem of low accuracy of power defect detection models on mobile terminals and improving the accuracy and efficiency of the models.

CN116611494BActive Publication Date: 2025-12-19MAINTENANCE & TEST CENTRE CSG EHV POWER TRANSMISSION CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310547812.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-15
Publication Date
2025-12-19
Estimated Expiration
2043-05-15

AI Technical Summary

Technical Problem

Existing power defect detection models suffer from low accuracy when applied to mobile terminals.

Method used

By quantifying the power defect detection model, a power quantification model is obtained. Through iterative training and distillation, and by combining the differences between the source model and the target model, the accuracy of the model is increased.

Benefits of technology

It has realized efficient and economical training methods, devices, systems, computer equipment, storage media and computer program products in the Internet field, especially involving power defect detection models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116611494B_ABST
    Figure CN116611494B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of training method of electric power defect detection model, it is related to the field of Internet.The method comprises: obtaining the initial electric power defect detection model of pre-trained electric power system and electric power sample data;According to the preset quantization accuracy, each network layer of initial electric power defect detection model is quantized, and the electric power quantization model is obtained;According to the difference between the first defect detection result of source model and the second defect detection result of target model, the target model is trained, and the electric power distillation model is obtained;The electric power sample data is input into electric power distillation model, and the third defect detection result of electric power distillation model is obtained;According to the second defect detection result and the third defect detection result, the fusion defect detection result is obtained, and according to the difference between fusion defect detection result and third defect detection result, the target electric power defect detection model is obtained.The method can reduce the model storage space and the complexity of calculation, and improve the model accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of Internet, and in particular, to a power defect detection model training method, device, system, computer equipment, storage medium and computer program product. BACKGROUND

[0002] With the rapid development of deep learning, the accuracy of deep neural network models, such as power defect detection models, is constantly improved. These deep neural network models, such as power defect detection models, also consume huge hardware resources when applied, and are not suitable for mobile terminals and the like. In order to solve the problem of applying high-precision power defect detection models on mobile terminals, a method of quantizing the model is usually used to reduce the storage space and computational complexity of the model, so as to obtain a model that can be used on mobile terminals.

[0003] At present, the model quantization method in the related art has the problem of low model accuracy. SUMMARY

[0004] Therefore, it is necessary to provide a power defect detection model training method, device, system, computer equipment, storage medium and computer program product to solve the above technical problems.

[0005] In a first aspect, the present application provides a power defect detection model training method. The method comprises:

[0006] obtaining an initial power defect detection model of a pre-trained power system and power sample data;

[0007] quantizing each network layer of the initial power defect detection model according to a preset quantization precision to obtain a to-be-trained quantization model corresponding to the initial power defect detection model;

[0008] performing iterative training on the to-be-trained quantization model according to the power sample data to obtain a power quantization model corresponding to the initial power defect detection model;

[0009] taking the initial power defect detection model as a source model and the power quantization model as a target model, and training the target model according to the difference between a first defect detection result of the source model and a second defect detection result of the target model to obtain a power distillation model corresponding to the initial power defect detection model;

[0010] inputting the power sample data into the power distillation model to obtain a third defect detection result of the power distillation model;

[0011] A fusion defect detection result is obtained according to the second defect detection result and the third defect detection result, and the power distillation model is trained according to a difference between the fusion defect detection result and the third defect detection result, to obtain a target power defect detection model.

[0012] In one of the embodiments, the quantizing each network layer of the initial power defect detection model according to the preset quantization precision to obtain a to-be-trained quantization model corresponding to the initial power defect detection model comprises: adjusting the quantization precision of each network layer of the initial power defect detection model to the preset quantization precision to obtain the to-be-trained quantization model.

[0013] In one of the embodiments, the iteratively training the to-be-trained quantization model according to the power sample data for a preset number of times to obtain a power quantization model corresponding to the initial power defect detection model comprises: iteratively training the to-be-trained quantization model according to the power sample data for a preset number of times to obtain target quantization parameters of the to-be-trained quantization model; and replacing initial quantization parameters of the to-be-trained quantization model with the target quantization parameters to obtain the power quantization model corresponding to the initial power defect detection model.

[0014] In one of the embodiments, the training the target model according to a difference between the first defect detection result of the source model and the second defect detection result of the target model to obtain a power distillation model corresponding to the initial power defect detection model comprises: training the target model according to a difference between the first defect detection result of the source model and the second defect detection result of the target model to obtain an initial power distillation model corresponding to the initial power defect detection model; taking the initial power distillation model as a new target model and returning to execute the step of training the target model according to a difference between the first defect detection result of the source model and the second defect detection result of the target model until a preset number of training times is met, to obtain the power distillation model corresponding to the initial power defect detection model.

[0015] In one of the embodiments, the training the target model according to a difference between the first defect detection result of the source model and the second defect detection result of the target model to obtain an initial power distillation model corresponding to the initial power defect detection model comprises: inputting the power sample data into the source model to obtain the first defect detection result; inputting the power sample data into the target model to obtain the second defect detection result; and training the target model according to a difference between the first defect detection result and the second defect detection result to obtain the initial power distillation model.

[0016] In one of the embodiments, the obtaining the fusion defect detection result according to the second defect detection result and the third defect detection result comprises: obtaining weight values corresponding to the second defect detection result and the third defect detection result respectively; and performing weighted average processing on the second defect detection result and the third defect detection result based on the weight values to obtain the fusion defect detection result.

[0017] In a second aspect, the application provides a device for training an electric power defect detection model. The device comprises:

[0018] an obtaining module configured to obtain an initial electric power defect detection model of a pre-trained electric power system and electric power sample data;

[0019] an adjusting module configured to perform quantization processing on each network layer of the initial electric power defect detection model according to a preset quantization precision to obtain a to-be-trained quantization model corresponding to the initial electric power defect detection model;

[0020] a quantization module configured to perform iterative training on the to-be-trained quantization model according to the electric power sample data for a preset number of times to obtain an electric power quantization model corresponding to the initial electric power defect detection model;

[0021] a distillation module configured to take the initial electric power defect detection model as a source model and take the electric power quantization model as a target model, and perform training on the target model according to a difference between a first defect detection result of the source model and a second defect detection result of the target model to obtain an electric power distillation model corresponding to the initial electric power defect detection model;

[0022] a calculating module configured to input the electric power sample data into the electric power distillation model to obtain a third defect detection result of the electric power distillation model;

[0023] an integrating module configured to obtain a fusion defect detection result according to the second defect detection result and the third defect detection result, and perform training on the electric power distillation model according to a difference between the fusion defect detection result and the third defect detection result to obtain a target electric power defect detection model.

[0024] In a third aspect, the application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0025] obtaining an initial electric power defect detection model of a pre-trained electric power system and electric power sample data;

[0026] quantize each network layer of the initial power defect detection model according to a preset quantization precision, to obtain a to-be-trained quantization model corresponding to the initial power defect detection model;

[0027] perform iterative training on the to-be-trained quantization model using the power sample data for a preset number of times, to obtain a power quantization model corresponding to the initial power defect detection model;

[0028] take the initial power defect detection model as a source model, take the power quantization model as a target model, and train the target model according to a difference between a first defect detection result of the source model and a second defect detection result of the target model, to obtain a power distillation model corresponding to the initial power defect detection model;

[0029] input the power sample data into the power distillation model, to obtain a third defect detection result of the power distillation model;

[0030] obtain a fusion defect detection result according to the second defect detection result and the third defect detection result, and train the power distillation model according to a difference between the fusion defect detection result and the third defect detection result, to obtain a target power defect detection model.

[0031] In a fourth aspect, the present application also provides a computer readable storage medium. The computer readable storage medium has a computer program stored thereon, and the computer program is executed by a processor to implement the following steps:

[0032] obtain an initial power defect detection model of a pre-trained power system, and power sample data;

[0033] quantize each network layer of the initial power defect detection model according to a preset quantization precision, to obtain a to-be-trained quantization model corresponding to the initial power defect detection model;

[0034] perform iterative training on the to-be-trained quantization model using the power sample data for a preset number of times, to obtain a power quantization model corresponding to the initial power defect detection model;

[0035] take the initial power defect detection model as a source model, take the power quantization model as a target model, and train the target model according to a difference between a first defect detection result of the source model and a second defect detection result of the target model, to obtain a power distillation model corresponding to the initial power defect detection model;

[0036] input the power sample data into the power distillation model, to obtain a third defect detection result of the power distillation model;

[0037] According to the second defect detection result and the third defect detection result, a fusion defect detection result is obtained, and according to the difference between the fusion defect detection result and the third defect detection result, the power distillation model is trained to obtain a target power defect detection model.

[0038] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the following steps:

[0039] An initial power defect detection model of a pre-trained power system and power sample data are obtained;

[0040] According to a preset quantization precision, each network layer of the initial power defect detection model is quantized to obtain a to-be-trained quantization model corresponding to the initial power defect detection model;

[0041] The to-be-trained quantization model is iteratively trained for a preset number of times using the power sample data to obtain a power quantization model corresponding to the initial power defect detection model;

[0042] The initial power defect detection model is taken as a source model, and the power quantization model is taken as a target model, and according to the difference between a first defect detection result of the source model and a second defect detection result of the target model, the target model is trained to obtain a power distillation model corresponding to the initial power defect detection model;

[0043] The power sample data is input into the power distillation model to obtain a third defect detection result of the power distillation model;

[0044] According to the second defect detection result and the third defect detection result, a fusion defect detection result is obtained, and according to the difference between the fusion defect detection result and the third defect detection result, the power distillation model is trained to obtain a target power defect detection model.

[0045] In the aforementioned training method, apparatus, system, computer equipment, storage medium, and computer program product for the power defect detection model, an initial power defect detection model for the power system can be pre-trained based on power sample data. Then, each network layer of the initial power defect detection model is quantized according to a preset quantization precision to obtain the quantized model to be trained corresponding to the initial power defect detection model. The quantized model to be trained is iteratively trained using power sample data for a preset number of times to obtain the power quantization model corresponding to the initial power defect detection model. Next, the initial power defect detection model is used as the source model, and the power quantization model is used as the target model. Based on the difference between the first defect detection result of the source model and the second defect detection result of the target model, the target model is trained to obtain the power distillation model corresponding to the initial power defect detection model. Next, power sample data is input into the power distillation model to obtain the third defect detection result of the power distillation model. Based on the second and third defect detection results, a fused defect detection result is obtained. Based on the difference between the fused defect detection result and the third defect detection result, the power distillation model is trained to obtain the target power defect detection model. In the training method of the power defect detection model provided in this application embodiment, the initial power defect detection model can be quantized to obtain the power quantization model corresponding to the initial power defect detection model, thereby reducing the storage space and computational complexity of the initial power defect detection model. On this basis, the power quantization model can be distilled and integrated to obtain the target power defect detection model, thereby increasing the model accuracy. Attached Figure Description

[0046] Figure 1 A flowchart illustrating a training method for a power defect detection model, provided as an embodiment;

[0047] Figure 2 A flowchart illustrating a training method for a power defect detection model, provided as another embodiment;

[0048] Figure 3 A structural block diagram of a training device for a power defect detection model provided in one embodiment;

[0049] Figure 4 An internal structural diagram of a computer device provided for one embodiment. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit the scope of this application. In one embodiment, such as... Figure 1As shown, a method for training a power defect detection model is provided. In this embodiment, the method is applied to a server. It should be understood that the method can also be applied to a terminal and a system including a terminal and a server, and can be implemented through the interaction of the terminal and the server. In this embodiment, the method includes the following steps:

[0051] In step S101, an initial power defect detection model of a power system is obtained, and power sample data is obtained.

[0052] In some possible implementation manners, the method for obtaining the initial power defect detection model can be as follows:

[0053] 1. Obtain power sample data of a power system and an actual defect label of the power sample data.

[0054] 2. Input the power sample data into the initial power defect detection model to be trained to obtain a predicted defect label of the power sample data.

[0055] 3. Train the initial power defect detection model to be trained according to the difference between the actual defect label and the predicted defect label.

[0056] The power sample data can be power data to be detected for defects, and whether the corresponding power device has defects can be determined based on the power data. The actual defect label can be a defect category and / or a defect judgment accuracy rate represented by the power sample data. The parameters of the initial power defect detection model can be high-precision floating-point parameters.

[0057] In some possible implementation manners, the initial power defect detection model can include at least one convolutional layer, at least one pooling layer, and at least one fully connected layer. The convolutional layer is used to extract features of input data. The pooling layer is used to sample the input data. The fully connected layer can classify data. The convolutional layer, the pooling layer, and the fully connected layer each include an activation function, and the activation function includes a weight matrix and a bias constant.

[0058] In this embodiment, the power sample data can include a plurality of power data.

[0059] Specifically, the convolution layer can be used to extract initial features of the plurality of power data. In a first step, the plurality of power data is vector converted to obtain a plurality of power data vectors, which can be combined into a power data vector matrix; in a second step, the power data vector matrix is input into the convolution layer, and a convolution kernel is used to perform convolution operation with the power data vector matrix, that is, the power data vector matrix and the convolution kernel are subjected to inner product operation to obtain a convolution result corresponding to the power data vector matrix; next, the convolution result is subjected to nonlinear transformation based on an activation function, and a bias vector is added to obtain an initial feature vector; in a third step, the initial feature vector is input into the pooling layer, and the initial feature vector can be subjected to feature sampling; then, the feature sampling result is subjected to nonlinear transformation based on an activation function, and a bias vector is added to obtain a power defect feature; in a fourth step, the power defect feature can be input into the fully connected layer, and the power defect feature is subjected to nonlinear transformation based on a weight matrix and a bias vector of the activation function, and then normalized to obtain a defect detection result corresponding to the power sample data.

[0060] In step S102, each network layer of the initial power defect detection model is quantized according to a preset quantization precision to obtain a to-be-trained quantized model corresponding to the initial power defect detection model.

[0061] The initial power defect detection model can be a neural network model. The parameters of the initial power defect detection model, such as weight data, are generally float32 floating point data. The quantization is a way of model compression. Quantization is to approximate the weight or activation value in the initial power defect detection model represented by a high bit width (for example, 32float) with a lower bit width (int8). In numerical terms, this means discretizing continuous values. The preset quantization precision can be a specified bit width.

[0062] In some possible implementations, the quantization manner can include the following manners:

[0063] Specifically, each layer of the deep neural network model is quantized correspondingly. FP32 is a single-precision floating point number, which uses 8 bits to represent the exponent part and 23 bits to represent the decimal part. Compared with FP16 and int8, it has a wider range of decimal part representation, and therefore has higher precision. However, because it has a larger data representation range, it requires more storage space and computing resources. Quantization can be performed using 16 bits and 8 bits, and different quantization manners are explained as follows.

[0064] 16-bit quantization, also known as FP16, is a half-precision floating-point representation method. It uses 5 bits to represent the exponent part and 10 bits to represent the fractional part, which is 13 fewer bits than the 32-bit single-precision floating-point number FP32. Since the fractional part of FP16 has a smaller range than FP32, rounding is required when storing and calculating, resulting in some precision errors. However, this precision loss is relatively small, and in some application scenarios, FP16 can significantly reduce model size and computational complexity without significantly affecting model performance. Although the integer range represented by FP32 and FP16 is the same in terms of data representation range, the fractional part representation range is different. In simd instructions, a single instruction can load up to 128 bits of data, so for FP32 data, up to 4 data can be supported for parallel computation at a time, while for FP16 data, up to 8 data can be supported for parallel computation at a time. Therefore, in calculations, the performance peak of FP16 should be twice that of FP32.

[0065] 8-bit quantization, also known as int8 quantization, is a very common fixed-point quantization method. In this method, a floating-point neural network model is converted to a fixed-point neural network model to achieve the purpose of reducing model size and improving computational speed.

[0066] Linear quantization, the transformation of quantization must be linear, which means that when converting a floating-point number to a fixed-point number, a linear relationship must be satisfied. Specifically, it is done by multiplying the floating-point number by a scaling factor and rounding it to the nearest integer value. This scaling factor is determined according to the range of the original data and the number of quantization bits. Due to the linear relationship, the quantized data can be restored to the original floating-point value through dequantization, ensuring that the calculation result can be mapped back to the original value. Linear quantization can include symmetric quantization and asymmetric quantization, symmetric quantization refers to a quantization method where the scaling factor is symmetric for positive and negative values, which can better maintain the shape of the data distribution; asymmetric quantization refers to a quantization method where the scaling factor is a positive number, which can make the quantized data simpler and easier to implement in hardware.

[0067] Non-uniform quantization, in addition to linear quantization, there is also a non-uniform quantization method, which can determine the scaling factor according to the data distribution. This method can make the data have higher precision after quantization, but it will also increase the complexity of the calculation.

[0068] In step S103, the power sample data is used to perform iterative training on the to-be-trained quantization model to meet a preset number of times, and an initial power defect detection model corresponding to the power quantization model is obtained.

[0069] Specifically, the power sample data can be input into the initial power defect detection model to obtain an initial defect detection result; the power sample data can be input into the to-be-trained quantization model to obtain an output result corresponding to each network layer included in the to-be-trained quantization model; based on the initial defect detection result and the output result corresponding to each network layer included in the to-be-trained quantization model, a sensitivity of each network layer included in the to-be-trained quantization model to the preset quantization precision, i.e., a specified bit width, is determined; based on the sensitivity corresponding to each network layer, the bit width corresponding to each network layer is adjusted; and based on the bit width corresponding to each network layer, the to-be-trained quantization model is iteratively trained using the power sample data to meet the preset number of times to obtain a power quantization model corresponding to the initial power defect detection model.

[0070] In each iteration training, a quantization parameter for the to-be-trained quantization model can be determined first; then, according to the bit width corresponding to each network layer and the quantization parameter, the weight and the activation value corresponding to each network layer are quantized to obtain a weight quantization value and an activation quantization value; and based on the weight quantization value and the activation quantization value, the quantization parameter for the next iteration training is updated.

[0071] In some possible implementation manners, the sensitivity corresponding to each network layer can be determined based on the following manner:

[0072] Based on the initial defect detection result and the output result corresponding to each network layer included in the to-be-trained quantization model, an accuracy loss corresponding to each network layer can be determined; and based on the accuracy loss corresponding to each network layer, the sensitivity corresponding to each network layer is obtained.

[0073] In some possible implementation manners, the power quantization model can also be further optimized, for example, fine-tuned.

[0074] Specifically, in the process of quantizing the initial power defect detection model to obtain the power quantization model, in order to reduce the quantization error, a compensation strategy is usually adopted, that is, a bias is introduced in the quantization process to offset the quantization error. The bias is achieved by adding a constant to the quantized value, so that the quantized value is closer to the actual value.

[0075] After the quantization operation, the model needs to be fine-tuned. In the offline quantization stage, the original floating-point model is first converted into a fixed-point model, and the number of quantization bits is adjusted according to the sensitivity of each layer, so that the accuracy and sensitivity of different layers are matched. In this process, a bias strategy is used to offset the quantization error. Subsequently, in the online fine-tuning stage, the quantized model is fine-tuned to further improve the accuracy, which usually includes adjusting the compensation bias, retraining the weight and bias, and other operations.

[0076] The specific steps of the fine-tuning operation include the following aspects:

[0077] The loss function of fine-tuning is calculated, usually using cross-entropy loss function to calculate the difference between the predicted results and the actual results; according to the loss function of fine-tuning, the weights and biases of the model are adjusted to reduce the prediction error; adjust the bias to reduce the quantization error and ensure that the accuracy of the quantized model meets the expectations; repeat the above steps until the accuracy of the model meets the requirements.

[0078] Step S104, taking the initial power defect detection model as the source model, and taking the power quantization model as the target model, and training the target model according to the difference between the first defect detection result of the source model and the second defect detection result of the target model, to obtain the power distillation model corresponding to the initial power defect detection model.

[0079] The source model can also be called a teacher model; the target model can also be called a student model; the student model can be trained based on the first defect detection result of the teacher model, so that the student model is closer to the teacher model. The first defect detection result can be a defect detection result obtained based on the initial power defect detection model for the power sample data; the second defect detection result can be a defect detection result obtained based on the power quantization model for the power sample data; the defect detection result can be used to represent whether the power device corresponding to the power sample data has a defect, if the power device corresponding to the power sample data has a defect, it can contain the defect category and defect judgment accuracy of the power device.

[0080] Step S105, inputting the power sample data into the power distillation model to obtain the third defect detection result of the power distillation model.

[0081] Step S106, obtaining a fusion defect detection result according to the second defect detection result and the third defect detection result, and training the power distillation model according to the difference between the fusion defect detection result and the third defect detection result to obtain a target power defect detection model.

[0082] The second defect detection result and the third defect detection result can be integrated to obtain the fusion defect detection result.

[0083] In the method of the embodiment, the initial power defect detection model for the power system can be pre-trained based on the power sample data; then, each network layer of the initial power defect detection model is quantized according to a preset quantization precision, to obtain a to-be-trained quantization model corresponding to the initial power defect detection model; the to-be-trained quantization model is iteratively trained by using the power sample data for a preset number of times, to obtain a power quantization model corresponding to the initial power defect detection model; then, the initial power defect detection model is taken as a source model, and the power quantization model is taken as a target model, and the target model is trained according to a difference between a first defect detection result of the source model and a second defect detection result of the target model, to obtain a power distillation model corresponding to the initial power defect detection model; next, the power sample data is input into the power distillation model, to obtain a third defect detection result of the power distillation model; then, a fusion defect detection result is obtained according to the second defect detection result and the third defect detection result, and the power distillation model is trained according to a difference between the fusion defect detection result and the third defect detection result, to obtain a target power defect detection model. In the training method of the power defect detection model provided in the embodiment, the initial power defect detection model is quantized to obtain the power quantization model corresponding to the initial power defect detection model, so as to reduce the storage space and the calculation complexity of the initial power defect detection model, and on this basis, the power quantization model is distilled and integrated to obtain the target power defect detection model, thereby increasing the model accuracy.

[0084] In some embodiments, step S102 can include:

[0085] The quantization precision of each network layer of the initial power defect detection model is adjusted to the preset quantization precision, to obtain the to-be-trained quantization model.

[0086] The quantization bit number can be determined based on the preset quantization precision, and the specified bit width can be set based on the preset quantization precision and the quantization bit number, so that the quantization precision of each network layer of the initial power defect detection model can be adjusted to the preset quantization precision, i.e., the specified bit width, to obtain the to-be-trained quantization model.

[0087] In the method of the embodiment, the initial power defect detection model is quantized to obtain the power quantization model corresponding to the initial power defect detection model, so as to reduce the storage space and the calculation complexity of the initial power defect detection model.

[0088] In some embodiments, step S103 can include:

[0089] The power sample data is used to iteratively train the to-be-trained quantization model for a preset number of times to obtain target quantization parameters of the to-be-trained quantization model; and the initial quantization parameters of the to-be-trained quantization model are replaced with the target quantization parameters to obtain the power quantization model corresponding to the initial power defect detection model.

[0090] In the method of the embodiment, the initial power defect detection model is quantized to obtain the power quantization model corresponding to the initial power defect detection model, thereby reducing the storage space and the calculation complexity of the initial power defect detection model.

[0091] In some embodiments, step S104 can include:

[0092] According to the difference between the first defect detection result of the source model and the second defect detection result of the target model, the target model is trained to obtain an initial power distillation model corresponding to the initial power defect detection model; the initial power distillation model is taken as a new target model, and the step of training the target model according to the difference between the first defect detection result of the source model and the second defect detection result of the target model is performed until a preset number of training times is met, thereby obtaining a power distillation model corresponding to the initial power defect detection model.

[0093] In some possible implementations, the power quantization model can be distilled for a preset number of times based on the initial power defect detection model, taking three times as the preset number of times for example:

[0094] Specifically, the power sample data is input into the initial power defect detection model to obtain the first defect detection result; the power sample data is input into the power quantization model to obtain the second defect detection result; according to the difference between the first defect detection result of the initial power defect detection model and the second defect detection result of the power quantization model, the power quantization model is trained to obtain an initial power distillation model; the power sample data is input into the initial power distillation model to obtain the second defect detection result of the initial power distillation model; according to the difference between the first defect detection result of the initial power defect detection model and the second defect detection result of the initial power distillation model, the initial power distillation model is trained to obtain a secondary power distillation model; the power sample data is input into the secondary power distillation model to obtain the second defect detection result of the secondary power distillation model; according to the difference between the first defect detection result of the initial power defect detection model and the second defect detection result of the secondary power distillation model, the secondary power distillation model is trained to obtain a three-time power distillation model, which is taken as the power distillation model corresponding to the initial power defect detection model.

[0095] In the method of the embodiment, the power quantification model can be subjected to distillation processing satisfying a preset number of times to obtain a power distillation model, thereby increasing model accuracy.

[0096] In some embodiments, obtaining the fusion defect detection result according to the second defect detection result and the third defect detection result in step S106 can include:

[0097] The second defect detection result can include at least one defect detection result, and can include a number of defect detection results satisfying a preset number of times. Taking three times as the preset number of times as an example, the second defect detection result can include a second defect detection result of the power quantification model, a second defect detection result of the initial power distillation model, and a second defect detection result of the secondary power distillation model. The third defect detection result can be a defect detection result for the power sample data obtained based on the power distillation model. The weight values of the second defect detection result of the power quantification model, the second defect detection result of the initial power distillation model, the second defect detection result of the secondary power distillation model, and the third defect detection result can be obtained respectively; and the average of the product of the second defect detection result of the power quantification model and the corresponding first weight value, the product of the second defect detection result of the initial power distillation model and the corresponding second weight value, the product of the second defect detection result of the secondary power distillation model and the corresponding third weight value, and the product of the third defect detection result and the corresponding fourth weight value are taken as the fusion defect detection result.

[0098] In the method of the embodiment, the power quantification model and the plurality of distillation models can be subjected to integration processing to obtain a target power defect detection model, thereby increasing model accuracy.

[0099] In another embodiment, as shown in Figure 2 a method for training a power defect detection model is provided, which can include:

[0100] In step S201, an initial power defect detection model of a power system pre-trained and power sample data are obtained.

[0101] The to-be-recommended resource object is a resource object to be transferred in a financial business system; and the candidate to-be-recommended account is an account pre-obtained for the to-be-recommended resource object and having a potential preset behavior.

[0102] In step S202, the quantization accuracy of each network layer of the initial power defect detection model is adjusted to a preset quantization accuracy to obtain a to-be-trained quantization model.

[0103] The prediction resource transfer tendency degree represents a predicted probability of each candidate to-be-recommended account performing a preset behavior on the to-be-recommended resource object.

[0104] Step S203, the power sample data is used to train the to-be-trained quantization model to meet the preset number of iterations, and the target quantization parameter of the to-be-trained quantization model is obtained.

[0105] Step S204, the initial quantization parameter of the to-be-trained quantization model is replaced by the target quantization parameter, and the power quantization model corresponding to the initial power defect detection model is obtained.

[0106] Step S205, the initial power defect detection model is used as a source model, and the power quantization model is used as a target model.

[0107] Step S206, according to the difference between the first defect detection result of the source model and the second defect detection result of the target model, the target model is trained to obtain the initial power distillation model corresponding to the initial power defect detection model.

[0108] Step S207, the initial power distillation model is used as a new target model, and the step of training the target model according to the difference between the first defect detection result of the source model and the second defect detection result of the target model is returned to be executed until the preset number of training is met, and the power distillation model corresponding to the initial power defect detection model is obtained.

[0109] Step S208, the power sample data is input into the power distillation model to obtain the third defect detection result of the power distillation model.

[0110] Step S209, the weight values corresponding to the second defect detection result and the third defect detection result are obtained.

[0111] Step S210, based on the weight values, the second defect detection result and the third defect detection result are weighted and averaged to obtain the fusion defect detection result.

[0112] Step S211, according to the difference between the fusion defect detection result and the third defect detection result, the power distillation model is trained to obtain the target power defect detection model.

[0113] In the method of the embodiment, an initial power defect detection model for a power system can be pre-trained based on power sample data; thus, each network layer of the initial power defect detection model is quantized according to a preset quantization precision, to obtain a to-be-trained quantization model corresponding to the initial power defect detection model; the to-be-trained quantization model is iteratively trained using the power sample data for a preset number of times, to obtain a power quantization model corresponding to the initial power defect detection model; then, the initial power defect detection model is taken as a source model, and the power quantization model is taken as a target model, and the target model is trained according to a difference between a first defect detection result of the source model and a second defect detection result of the target model, to obtain a power distillation model corresponding to the initial power defect detection model; next, the power sample data is input into the power distillation model, to obtain a third defect detection result of the power distillation model; and a fusion defect detection result is obtained according to the second defect detection result and the third defect detection result, and the power distillation model is trained according to a difference between the fusion defect detection result and the third defect detection result, to obtain a target power defect detection model. In the training method of the power defect detection model provided in the embodiments, the initial power defect detection model is quantized to obtain the power quantization model corresponding to the initial power defect detection model, so as to reduce the storage space and the calculation complexity of the initial power defect detection model, and on this basis, the power quantization model can be distilled and integrated to obtain the target power defect detection model, thereby increasing the model accuracy.

[0114] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the order of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which 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 sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0115] Based on the same inventive concept, the embodiments of the present application also provide a power defect detection model training device for implementing the power defect detection model training method described above. The problem-solving implementation scheme provided by the device is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more power defect detection model training device embodiments provided below can refer to the limitations of the power defect detection model training method described above, which will not be repeated here.

[0116] In one embodiment, as shown in Figure 3 The training device of the power defect detection model comprises an acquisition module 301, an adjustment module 302, a quantization module 303, a distillation module 304, a calculation module 305, and an integration module 306.

[0117] The acquisition module 301 is configured to acquire an initial power defect detection model of a pre-trained power system and power sample data.

[0118] The adjustment module 302 is configured to quantize each network layer of the initial power defect detection model according to a preset quantization precision to obtain a to-be-trained quantization model corresponding to the initial power defect detection model.

[0119] The quantization module 303 is configured to perform iterative training on the to-be-trained quantization model using the power sample data for a preset number of times to obtain a power quantization model corresponding to the initial power defect detection model.

[0120] The distillation module 304 is configured to take the initial power defect detection model as a source model and take the power quantization model as a target model, and train the target model according to a difference between a first defect detection result of the source model and a second defect detection result of the target model to obtain a power distillation model corresponding to the initial power defect detection model.

[0121] The calculation module 305 is configured to input the power sample data into the power distillation model to obtain a third defect detection result of the power distillation model.

[0122] The integration module 306 is configured to obtain a fusion defect detection result according to the second defect detection result and the third defect detection result, and train the power distillation model according to a difference between the fusion defect detection result and the third defect detection result to obtain a target power defect detection model.

[0123] In addition, the adjustment module 302 is further configured to adjust the quantization precision of each network layer of the initial power defect detection model to the preset quantization precision to obtain the to-be-trained quantization model.

[0124] The quantization module 303 is further configured to perform iterative training on the to-be-trained quantization model using the power sample data for a preset number of times to obtain a target quantization parameter of the to-be-trained quantization model, and replace an initial quantization parameter of the to-be-trained quantization model with the target quantization parameter to obtain the power quantization model corresponding to the initial power defect detection model.

[0125] The distillation module 304 is further configured to: train the target model based on the difference between the first defect detection result of the source model and the second defect detection result of the target model to obtain an initial power distillation model corresponding to the initial power defect detection model; use the initial power distillation model as a new target model, and return to execute the step of training the target model based on the difference between the first defect detection result of the source model and the second defect detection result of the target model, until a preset number of training times is met to obtain the power distillation model corresponding to the initial power defect detection model.

[0126] Furthermore, the distillation module 304 is also used to: input the power sample data into the source model to obtain the first defect detection result; input the power sample data into the target model to obtain the second defect detection result; and train the target model based on the difference between the first defect detection result and the second defect detection result to obtain the initial power distillation model.

[0127] The integration module 306 is further configured to: obtain the weight values ​​corresponding to the second defect detection result and the third defect detection result respectively; and perform a weighted average processing on the second defect detection result and the third defect detection result based on the weight values ​​to obtain the fused defect detection result.

[0128] Each module in the training device for the aforementioned power defect detection model can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0129] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores training data for a power defect detection model. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a training method for a power defect detection model.

[0130] Those skilled in the art will understand that Figure 4The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0131] In one embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method embodiments when executing the computer program.

[0132] In one embodiment, a computer readable storage medium is provided, storing a computer program, and the computer program implements the steps in the above method embodiments when executed by a processor.

[0133] In one embodiment, a computer program product is provided, including a computer program, and the computer program implements the steps in the above method embodiments when executed by a processor.

[0134] 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 for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.

[0135] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0136] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0137] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A training method for a power defect detection model, characterized in that, The method comprises: acquiring an initial power defect detection model of a pre-trained power system and power sample data; quantizing each network layer of the initial power defect detection model according to a preset quantization precision to obtain a to-be-trained quantization model corresponding to the initial power defect detection model; performing iterative training on the to-be-trained quantization model using the power sample data to obtain a power quantization model corresponding to the initial power defect detection model; taking the initial power defect detection model as a source model and the power quantization model as a target model, and training the target model according to the difference between a first defect detection result of the source model and a second defect detection result of the target model to obtain a power distillation model corresponding to the initial power defect detection model; inputting the power sample data into the power distillation model to obtain a third defect detection result of the power distillation model; obtaining a fusion defect detection result according to the second defect detection result and the third defect detection result, and training the power distillation model according to the difference between the fusion defect detection result and the third defect detection result to obtain a target power defect detection model.

2. The method of claim 1, wherein, The method comprises: adjusting the quantization precision of each network layer of the initial power defect detection model to the preset quantization precision to obtain the to-be-trained quantization model.

3. The method of claim 1, wherein, The method comprises: performing iterative training on the to-be-trained quantization model using the power sample data to obtain target quantization parameters of the to-be-trained quantization model; replacing the initial quantization parameters of the to-be-trained quantization model with the target quantization parameters to obtain the power quantization model corresponding to the initial power defect detection model.

4. The method of claim 1, wherein, The method comprises: training the target model according to the difference between the first defect detection result of the source model and the second defect detection result of the target model to obtain an initial power distillation model corresponding to the initial power defect detection model; taking the initial power distillation model as a new target model and returning to perform the step of training the target model according to the difference between the first defect detection result of the source model and the second defect detection result of the target model until a preset number of training times is reached to obtain the power distillation model corresponding to the initial power defect detection model.

5. The method of claim 4, wherein, The initial power distillation model corresponding to the initial power defect detection model is obtained by training the target model according to the difference between the first defect detection result of the source model and the second defect detection result of the target model. The first defect detection result is obtained by inputting the power sample data into the source model. The second defect detection result is obtained by inputting the power sample data into the target model. The initial power distillation model is obtained by training the target model according to the difference between the first defect detection result and the second defect detection result.

6. The method of claim 4, wherein, The fusion defect detection result is obtained according to the second defect detection result and the third defect detection result. The weight values corresponding to the second defect detection result and the third defect detection result are obtained. The second defect detection result and the third defect detection result are weighted and averaged based on the weight values to obtain the fusion defect detection result. 7.A device for training a power defect detection model, characterized in that, The device comprises: An acquisition module is configured to acquire an initial power defect detection model of a pre-trained power system and power sample data. An adjustment module is configured to quantize each network layer of the initial power defect detection model according to a preset quantization precision to obtain a to-be-trained quantization model corresponding to the initial power defect detection model. A quantization module is configured to perform iterative training on the to-be-trained quantization model using the power sample data to obtain a power quantization model corresponding to the initial power defect detection model. A distillation module is configured to use the initial power defect detection model as a source model and the power quantization model as a target model, and train the target model according to the difference between the first defect detection result of the source model and the second defect detection result of the target model to obtain a power distillation model corresponding to the initial power defect detection model. A calculation module is configured to input the power sample data into the power distillation model to obtain a third defect detection result of the power distillation model. An integration module is configured to obtain a fusion defect detection result according to the second defect detection result and the third defect detection result, and train the power distillation model according to the difference between the fusion defect detection result and the third defect detection result to obtain a target power defect detection model.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to realize the steps of the method of any one of claims 1-6.

9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method of any one of claims 1-6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Quantitative training method and device of model, electronic equipment and readable storage medium

    CN116070689A

  • Method of load forecasting via knowledge distillation, and an apparatus for the same

    US20230102489A1