Load power detection model training method and load power detection method
By training the load power detection model through dual-knowledge distillation and utilizing transfer learning from teacher and student networks, the problem of accurately predicting future changes in load power data in existing technologies is solved, thus achieving accurate detection and prediction of load power data.
Patent Information
- Application Number
- CN202211117924.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-09-14
AI Technical Summary
Existing technologies cannot accurately predict future changes in load power data. Traditional methods are computationally complex and prone to missing detections. Deep learning models require a large amount of labeled data and cannot effectively detect future load power anomalies.
A dual-knowledge distillation approach is used to train the load power detection model. By acquiring historical, current, and future load power data of the power system, and utilizing transfer learning from teacher and student network models, parameters are optimized to detect changes in load power data.
The performance of the load power detection model has been improved, enabling accurate detection of the load power data to be detected, accurate prediction of future changes, and improved detection accuracy.
Smart Images

Figure CN115687915B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system technology, and in particular to a load power detection model training method and a load power detection method. Background Technology
[0002] Load power data is of great value to the power system and is an important basis for decision-making by departments such as power system marketing, planning, dispatching and scheduling. However, actual data may fluctuate and be abnormal due to electricity theft, leakage or other complex factors. Real-time detection of load power anomalies is an important measure to improve the robustness and stability of the power system, and can effectively help power companies and the power grid to carry out safe operation, production and predictive dispatch.
[0003] Traditional load power anomaly detection methods are state estimation-based outlier detection methods, commonly including residual search detection, non-quadratic criterion detection, and estimation detection. However, these methods suffer from computational complexity, missed detections, and residual overload. With the rise of machine learning models, using deep learning models for load power anomaly detection has gradually become a mainstream approach. Examples include methods based on autoencoders and generative adversarial networks, methods based on deep Boltzmann machines, methods based on denoising autoencoders, methods based on recurrent neural networks, and methods based on long short-term memory neural networks.
[0004] However, these methods require a large amount of complete labeled data and can only detect historical data and current data to be detected, making it difficult to detect load power anomalies and resulting in an inability to accurately predict future changes in load power data. Summary of the Invention
[0005] This invention provides a load power detection model training method and a load power detection method to solve the shortcomings of existing technologies that cannot accurately predict future changes in load power data, and to achieve accurate prediction of future changes in load power data.
[0006] This invention provides a method for training a load power detection model, comprising:
[0007] Obtain a load power dataset of a power system; the load power dataset includes at least one data sequence; the data sequence includes historical load power data, current load power data, and future load power data.
[0008] Based on the load power dataset, the initial teacher network model is trained to obtain the target teacher network model;
[0009] Train an initial student network model based on the historical load power data and the current load power data to obtain a first student network model;
[0010] Update the first student network model in a double-knowledge distillation manner based on the target teacher network model and the first student network model to determine a load power detection model.
[0011] According to the load power detection model training method provided by the application, the first student network model is updated in a double-knowledge distillation manner based on the target teacher network model and the first student network model to determine a load power detection model, which comprises:
[0012] Train the first student network model in a first knowledge distillation manner based on the target teacher network model and the first student network model to determine a first optimization parameter corresponding to the first student network model;
[0013] Update the first student network model based on the first optimization parameter to obtain a second student network model;
[0014] Train the second student network model in a second knowledge distillation manner based on the second student network model and the target teacher network model to determine the load power detection model.
[0015] According to the load power detection model training method provided by the application, the first optimization parameter corresponding to the first student network model is determined, which comprises:
[0016] Calculate a first loss value based on a first parameter of the target teacher network model, a second parameter of the first student network model and an initialization parameter corresponding to a guide layer in the first student network model;
[0017] Determine the first optimization parameter corresponding to the first student network model based on the first loss value.
[0018] According to the load power detection model training method provided by the application, the second student network model is trained in a second knowledge distillation manner to determine the load power detection model, which comprises:
[0019] Determine a target optimization parameter of the second student network model;
[0020] Update the second student network model based on the target optimization parameter to obtain the load power detection model.
[0021] According to the load power detection model training method provided by the present application, the target optimization parameter of the second student network model is determined, comprising:
[0022] Based on the at least one output probability obtained in the training process of the second student network model and the output probability of the target teacher network model, cross-entropy loss values are respectively calculated;
[0023] Based on the cross-entropy loss values, the target optimization parameter of the second student network model is determined.
[0024] In a second aspect, the present application further provides a load power detection method, comprising:
[0025] Obtaining load power data to be detected;
[0026] Inputting the load power data to be detected into a load power detection model to obtain a detection result output by the load power detection model; the load power detection model is trained based on the load power detection model training method in any of the above-mentioned manners.
[0027] The present application further provides a load power detection model training device, comprising:
[0028] A first obtaining module is configured to obtain a load power data set of a power system; the load power data set comprises at least one data sequence; the data sequence comprises historical load power data, current load power data and future load power data;
[0029] A first training module is configured to train an initial teacher network model based on the load power data set to obtain a target teacher network model;
[0030] A second training module is configured to train an initial student network model based on the historical load power data and the current load power data to obtain a first student network model;
[0031] An updating module is configured to update the first student network model in a double-knowledge distillation manner based on the target teacher network model and the first student network model to determine a load power detection model; the load power detection model is determined based on the updated first student network model and is used for detecting load power data to be detected to determine the change of the load power data to be detected.
[0032] The present application further provides a load power detection device, comprising:
[0033] A second obtaining module is configured to obtain load power data to be detected;
[0034] a detection module configured to input the to-be-detected load power data into the load power detection model to obtain a detection result output by the load power detection model, wherein the load power detection model is trained based on the load power detection model training method described in any of the above.
[0035] The present application also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the load power detection model training method or the load power detection method described in any of the above when executing the program.
[0036] The present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the load power detection model training method or the load power detection method described in any of the above.
[0037] The present application provides a load power detection model training method and a load power detection method, which comprises the following steps: obtaining a load power data set of a power system; the load power data set comprises at least one data sequence; the data sequence comprises historical load power data, current load power data, and future load power data; training an initial teacher network model according to the historical load power data, the current load power data, and the future load power data in the load power data set to obtain a target teacher network model; training an initial student network model according to the historical load power data and the current load power data in the load power data set to obtain a first student network model; updating the first student network model in a double-knowledge distillation manner according to the target teacher network model and the first student network model to determine a load power detection model; the load power detection model is determined based on the updated first student network model and is used for detecting to-be-detected load power data to determine the change of the to-be-detected load power data, which realizes the determination of the load power detection model in a double-knowledge distillation manner, improves the performance of the load power detection model, enables the load power detection model to accurately detect abnormal values of the to-be-detected load power data, improves the accuracy of the detection of the to-be-detected load power data, and thus accurately predicts the future change of the load power data. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0039] FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application;
[0040] FIG. 1(b) is a schematic diagram of a change of a point to be detected according to the present application;
[0041] FIG. 1(c) is a schematic diagram of a change of a point to be detected according to the present application;
[0042] Figure 2 FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application;
[0043] Figure 3 FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application;
[0044] Figure 4 FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application;
[0045] Figure 5 FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application;
[0046] Figure 6 FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application;
[0047] Figure 7 FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application;
[0048] Figure 8 FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application;
[0049] Figure 9 FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application; DETAILED DESCRIPTION
[0050] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described below in connection with the drawings in the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0051] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described below in connection with the drawings in the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0052] Assuming that the labeled data is to be detected data, FIG. 1(a) is a schematic diagram of a change of a point to be detected according to the present application. In FIG. 1(a), if the future data change direction of the to-be-detected data changes and the change degree is large, it can be determined that the to-be-detected data is an abnormal value.
[0053] Fig. 1(b) is one of the schematic diagrams of normal change of the to-be-detected point provided by the present application, in which if the future data change direction of the to-be-detected data does not change, showing a continuous change trend, it can be determined that the to-be-detected data is a normal value.
[0054] Fig. 1(c) is a schematic diagram of normal change of the to-be-detected point provided by the present application, in which if the future data change direction of the to-be-detected data changes, but the change degree is small, it can be determined that the to-be-detected data is a normal value.
[0055] Since we can only obtain the historical to-be-detected data and the current to-be-detected data in real-time power anomaly value detection, and cannot obtain the future to-be-detected data, it is difficult to determine the change direction and degree of the current to-be-detected data, causing difficulty in detection. Therefore, the present application provides a load power detection model training method and a load power detection method to realize accurate prediction of the future change of load power data.
[0056] The load power detection model training method and the load power detection method of the present application will be described below. Figures 2-6 The load power detection model training method and the load power detection method of the present application will be described below.
[0057] Figure 2 Fig. 1(a) is a flowchart of the load power detection model training method provided by the present application, as shown in the figure, the method comprises steps 201-204; wherein, Figure 2
[0058] Step 201, obtaining a load power data set of a power system; the load power data set comprises at least one data sequence; the data sequence comprises historical load power data, current load power data and future load power data.
[0059] It should be noted that the load power detection model training method provided by the present application can be applied to the scene of load power data detection. The execution subject of the method can be a load power detection model training device, such as an electronic device, or a control module in the load power detection model training device for executing the load power detection model training method.
[0060] Specifically, load power anomaly value detection is a binary classification problem, which can be expressed by formula (1) specifically, wherein the second-order difference of load power data is greater than or equal to a threshold value δ, then the output probability y t = 1, indicating that the to-be-detected data x t is an abnormal value; otherwise, the output probability y t = 0, indicating that the to-be-detected data x t is a normal value. Formula (1) is expressed as:
[0061]
[0062] wherein t represents the t-th moment, x t represents the data to be detected, y t represents the output probability, and δ represents a threshold value.
[0063] In step 202, the initial teacher network model is trained based on the load power data set to obtain a target teacher network model.
[0064] Specifically, an initial teacher network model is constructed in advance according to at least one data sequence in the load power data set; the data sequence includes historical load power data, current load power data and future load power data, and label data corresponding to the historical load power data, the current load power data and the future load power data, wherein the data sequence is represented as X t = {x t-m ,x t-m+1 ,...,x t ,...,x t+n-1 ,x t+n}, t represents time, m and n are both positive integers, and the label data is 1 and 0, wherein 1 represents normal power data and 0 represents abnormal load power; in the training process of the initial teacher network model, the data sequence X t is input into the initial teacher network model to obtain the probability y t output by the initial teacher network model, wherein y t = soft max(a t ), a t represents the detection value output by the initial teacher network, and the detection value a t is normalized to obtain the probability y t , wherein y t represents the detection label of the current load power data x t , y t = {0, 1}, y t = 1 represents that the current load power data x t is an abnormal value, and y t = 0 represents that the current load power data x t is a normal value.
[0065] The initial teacher network model is updated by continuously changing parameters of the initial teacher network model until the cross-entropy loss value tends to be stable, and the training of the initial teacher network model ends, and a target teacher network model is obtained, and the target teacher network model can accurately detect the load power data; wherein the minimized binary cross-entropy loss value is represented by formula (2), wherein:
[0066] L t =-(p t log y t +(1-p t )log(1-y t )) (2)
[0067] wherein L t represents the cross-entropy loss value, p t represents a true label of the current load power data x t , and y t represents a detection label of the current load power data x t .
[0068] In step 203, the initial student network model is trained based on the historical load power data and the current load power data to obtain a first student network model.
[0069] Specifically, the initial teacher network model is consistent with the initial student network model in structure. The historical load power data and the current load power data in the load power data set are combined to form a data sequence X s , X s ={x t-m ,x t-m+1 ,...,x t} during the training process of the initial student network model, the data sequence X s is input to the initial student network model to obtain a probability y t output by the initial student network model; the minimized binary cross-entropy loss value is calculated by using formula (2) above, whether the training of the initial student network model ends is judged according to the cross-entropy loss value and a preset condition, the initial student network model is updated by continuously changing parameters of the initial student network model until the cross-entropy loss value tends to be stable, and the training of the initial student network model ends, and the first student network model is obtained.
[0070] Step 204: Based on the target teacher network model and the first student network model, the first student network model is updated using a dual-knowledge distillation method to determine the load power detection model. The load power detection model is determined based on the updated first student network model and is used to detect the load power data to be detected in order to determine the changes in the load power data to be detected.
[0071] Specifically, based on the target teacher network model and the first student network model, a dual-knowledge distillation method is used. This allows the first student network model to learn from both the hidden layer knowledge of the target teacher network model and its detection results, thereby updating the first student network model. The resulting optimized first student network model can then be used to determine the load power detection model. This model can detect outliers in the load power data to be detected, thus identifying changes in the load power data.
[0072] The load power detection model training method provided by this invention involves acquiring a load power dataset of a power system. The load power dataset includes at least one data sequence, comprising historical load power data, current load power data, and future load power data. Based on the historical, current, and future load power data in the load power dataset, an initial teacher network model is trained to obtain a target teacher network model. Then, based on the historical and current load power data in the load power dataset, an initial student network model is trained to obtain a first student network model. Finally, based on the obtained target teacher network model and the first student network model, the first student network model is updated using a double-knowledge distillation method to determine the load power detection model. The load power detection model, determined based on the updated first student network model, is used to detect the load power data to be detected, thereby judging the changes in the load power data. This method utilizes double-knowledge distillation to determine the load power detection model, improving its performance and enabling accurate detection of outliers in the load power data. This improves the accuracy of load power data detection and allows for accurate prediction of future changes in load power data.
[0073] Optionally, step 204 above can be implemented by the following steps:
[0074] Step 1) Based on the target teacher network model and the first student network model, the first student network model is trained using the first knowledge distillation method to determine the first optimization parameters corresponding to the first student network model.
[0075] It should be noted that the first knowledge distillation manner is to learn the hidden layer knowledge of the target teacher network model by the first student network model, and a hint is introduced from the hidden layer of the target teacher network model, which can guide the training process of the first student network model; wherein the hint is defined as the output result of the hidden layer of the target teacher network model guiding the learning process of the first student network model. The guide layer is defined as the hidden layer of the first student network model to be learned and optimized to the target teacher network model.
[0076] In practice, in the training process of the first student network model, the first student network model can continuously learn the hint introduced from the hidden layer of the target teacher network model, so that the first student network model can better learn the target teacher network model, and determine the first optimization parameter corresponding to the first student network model.
[0077] Step 2) updating the first student network model based on the first optimization parameter to obtain a second student network model.
[0078] Specifically, according to the first optimization parameter corresponding to the first student network model, the first student network model is updated to obtain a second learning network model.
[0079] Step 3) based on the second student network model and the target teacher network model, a second knowledge distillation manner is used to train the second student network model to determine the load power detection model.
[0080] It should be noted that the second knowledge distillation manner is to learn the detection result of the target teacher network model by the second student network model, and further improve the accuracy of the detection result of the second student network model.
[0081] Specifically, according to the second student network model and the target teacher network model, in the training process of the second student network model, the second student network model continuously learns the detection result output by the target teacher network model, so as to determine the load power detection model.
[0082] The load power detection model training method provided by the application trains the first student network model by using a first knowledge distillation method according to the target teacher network model and the first student network model, determines the first optimization parameter corresponding to the first student network model, updates the first student network model according to the first optimization parameter, obtains a second student network model, trains the second student network model by using a second knowledge distillation method according to the second student network model and the target teacher network model, and determines the load power detection model, so that the load power detection model is determined by using the first knowledge distillation method and the second knowledge distillation method, the performance of the load power detection model is improved, the accuracy of the abnormal value detection of the to-be-detected load power data is improved, and the future change of the load power data can be accurately predicted.
[0083] Optionally, the specific implementation of step 1) comprises the following steps:
[0084] Step 1-1) calculates a first loss value based on the first parameter of the target teacher network model, the second parameter of the first student network model, and the initialization parameter of the guide layer in the first student network model.
[0085] Specifically, in the process of training the first student network model, the initialization parameter W r of the guide layer in the first student network model is randomly initialized. t The first parameter W o of the target teacher network model and the second parameter W h of the first student network model are used to train the parameter of the guide layer in the first student network model by minimizing the loss function, and a regression function is introduced to make the second parameter of the first student network model match the prompt introduced in the target teacher network model, that is, the parameter dimension is aligned.
[0086] In practice, the minimization of the loss function is represented by formula (3), wherein:
[0087]
[0088] Wherein, L h represents the first loss value, u and v are the depth embedding functions of the target teacher network model and the second student network model, W t represents the first parameter of the target teacher network model, W o represents the second parameter of the first student network model, W r represents the initialization parameter of the guide layer in the first student network model, r represents the regression function on the guide layer in the first student network model, x t represents the current load power parameter, and h represents the hidden layer.
[0089] Step 1-2) determining the first optimization parameter corresponding to the first student network model based on each of the first loss values.
[0090] Specifically, according to the calculated first loss values, the first optimization parameter corresponding to the first student network model is determined by using formula (4), wherein:
[0091]
[0092] Wherein, s represents the first student network model, W s represents the first optimization parameter.
[0093] The load power detection model training method provided by the application determines the first optimization parameter corresponding to the first student network model based on the first parameters of the target teacher network model, the second parameters of the first student network model, and the initialization parameters of the guide layer in the first student network model, respectively calculates the first loss values, and then determines the first optimization parameter corresponding to the first student network model based on each of the first loss values, and then updates the first student network model based on the first optimization parameter to obtain the second student network model, thereby determining the load power detection model, improving the performance of the load power detection model, improving the accuracy of the detected load power data anomaly value detection, and accurately predicting the future changes of the load power data.
[0094] Optionally, the specific implementation of the load power detection model is determined by using the second knowledge distillation method to train the second student network model in the above step 3), which includes the following steps:
[0095] Step 3-1) determining the target optimization parameter of the second student network model.
[0096] Specifically, in the training process of the second student network model, the target optimization parameter of the second student network model can be determined by using the second knowledge distillation method.
[0097] Step 3-2) updating the second student network model based on the target optimization parameter to obtain the load power detection model.
[0098] Specifically, the second student network model can be updated based on the determined target optimization parameter to obtain the load power detection model.
[0099] The load power detection model training method provided by the application determines the target optimization parameter of the second student network model by using the second knowledge distillation method to train the second student network model, and then updates the second student network model based on the target optimization parameter to obtain the load power detection model. The obtained load power detection model can accurately predict the future changes of the load power data, improve the performance of the load power detection model, and improve the accuracy of the detected load power data detection.
[0100] Optionally, the target optimization parameter of the second student network model is determined by:
[0101] Based on the at least one output probability obtained in the training process of the second student network model and the output probability of the target teacher network model, cross-entropy loss values are respectively calculated, and the target optimization parameter of the second student network model is determined based on the cross-entropy loss values.
[0102] Specifically, in the training process of the second student network model, the parameters of the second student network are W s , the probability output by the second student network model is y s , y s = soft max(a s ), wherein a s represents the detection value output by the second student network model, and the probability y s is obtained by normalizing the detection value a s , and y s represents the detection label of the current load power data x t . The second student network model is trained by minimizing the loss function, and the cross-entropy loss value is calculated by using formula (5), wherein:
[0103] L s (W s ) = H(y ture , y s ) + λH(y t , y s ) (5)
[0104] Wherein, L s represents the cross-entropy loss value, y ture represents the true label, λ represents the adjustable parameter of balancing cross-entropy, y t represents the probability output by the target teacher network, y s represents the probability output by the second student network model, and H(y t , y s ) represents the cross-entropy loss function.
[0105] In practice, the target optimization parameter of the second student network model is determined by using formula (6) according to the calculated cross-entropy loss values, wherein:
[0106]
[0107] Wherein, represents the target optimization parameter.
[0108] The load power detection model training method provided by this invention calculates the cross-entropy loss value based on at least one output probability obtained during the training of the second student network model and the output probability of the target teacher network model. Then, based on each cross-entropy loss value, the target optimization parameters of the second student network model are determined, and the second student network model is updated according to the target optimization parameters to obtain the load power detection model. The obtained load power detection model can accurately predict the future changes of load power data, thereby improving the performance of the load power detection model and the accuracy of detecting the load power data to be detected.
[0109] Figure 3 This is the second flowchart illustrating the load power detection model training method provided by the present invention, as shown below. Figure 3 As shown, the specific implementation methods include:
[0110] Step 1: Generate a data sequence X that includes historical load power data, current load power data, and future load power data. t The input is fed into a pre-built initial teacher network model to train it. The detection values output by the initial teacher network model are then normalized to obtain the probability y output by the initial teacher network model. t After the initial teacher network model is trained, the target teacher network model is obtained, where the first parameter of the target teacher network model is W. t .
[0111] Step 2: Generate a data sequence X including historical load power data and current load power data. s The input is fed into a pre-built initial student network model to train it. The detection values output by the initial student network model are then normalized to obtain the probability y output by the initial student network model. s After the initial student network model is trained, the first student network model is obtained, where the second parameter of the first student network model is W. o .
[0112] Step 3: Train the first student network model using the first knowledge distillation method. During the training process, initialize the initialization parameter W corresponding to the guiding layer in the first student network model. r By minimizing the first loss value of the loss function, the parameters of the first student network model and the target teacher network model are aligned. This is based on the first parameter W of the target teacher network model. t The second parameter Wo of the first student network model and the initialization parameter W corresponding to the bootstrap layer in the first student network model. r, the first loss value is calculated by using the above formula (3), and then the first optimization parameter W corresponding to the first student network model is determined by using the above formula (4) according to the first loss value s ; the first student network model is updated according to the first optimization parameter to obtain a second student network model.
[0113] Step 4, the second student network model is trained by using the second knowledge distillation method, and in the process of training the second student network model, the output probability of the second student network model is close to the output probability of the target teacher network model by minimizing the cross-entropy loss value of the cross-entropy loss function, the cross-entropy loss value is calculated by using the above formula (5), and then the target optimization parameter of the second student network model is obtained by using the above formula (6) according to the calculated cross-entropy loss value , so as to update the second student network model according to the target optimization parameter , and obtain the load power detection model.
[0114] Figure 4 is the flowchart of the load power detection method provided by the application, as shown in Figure 4 , the method comprises steps 401-402, wherein:
[0115] Step 401, obtaining the load power data to be detected;
[0116] Step 402, inputting the load power data to be detected into the load power detection model to obtain the detection result output by the load power detection model; the load power detection model is trained based on the load power detection model training method in the above embodiments.
[0117] Specifically, the obtained load power data to be detected is input into the load power detection model, so that the detection result output by the load power detection model can be obtained; wherein the detection result y s ={0,1}, y s =1 indicates that the load power data to be detected is an abnormal value, and y s =0 indicates that the load power data to be detected is a normal value.
[0118] The load power detection method provided by the application inputs the load power data to be detected into the load power detection model to obtain the detection result output by the load power detection model, and in the training process of the load power detection model, the student network model is continuously learned to the target teacher network model by using the double knowledge distillation method, and the target teacher network model considers the historical load power data, the current load power data and the future load power data, so that the obtained load power detection model can complete the real-time detection of the abnormal value of the load power data to be detected, and the detection accuracy is improved.
[0119] Exemplarily, the load power detection model is obtained by using the load power detection model training method of the present application on the Low Carbon London (LCL) dataset, and the detection result of the load power detection model is verified by using the load power detection model to detect the to-be-detected load power data. The smart meter data in LCL represents the residential consumer load in London, and the LCL load dataset includes load power measurement values of 2613 users from January 1, 2013 to December 31, 2013, in units of kilowatts (kW). 80% of the user data is randomly selected as the training set, 10% of the user data is randomly selected as the verification set, and 10% of the user data is randomly selected as the test set.
[0120] The present application also uses micro-F1 (micro-F1) and macro-F1 (macro-F1) to evaluate the detection result of the load power detection model. The micro-F1 is calculated by using formula (7), and the macro-F1 is calculated by using formula (8), wherein:
[0121]
[0122]
[0123] Wherein, F1-score0 and F1-score1 are represented by formula (9), Precision m is represented by formula (10), and Recall m is represented by formula (11), wherein:
[0124]
[0125]
[0126]
[0127] Wherein, TP i represents that the positive class of the i-th class is determined as a positive class, FP i represents that the negative class of the i-th class is determined as a positive class, FN i represents that the positive class of the i-th class is determined as a negative class, and TN i represents that the negative class of the i-th class is determined as a negative class.
[0128] The method provided by the present application is compared with the existing outlier detection methods (K-Nearest Neighbor (KNN), Distilling Knowledge (KD), and Random Forest), and the results are as follows:
[0129] Figure 5 is a comparison result diagram of macro-F1 provided by the present application, as shown in the figure, Figure 5 the macro-F1 value obtained by the method provided by the present application is increased by 11.2% compared with KNN, increased by 5.8% compared with KD, and increased by 4.5% compared with RandomForest. It can be seen that the accuracy of the method provided by the present application for detecting abnormal values of the to-be-detected load power data is obviously improved.
[0130] Figure 6 is a comparison result diagram of micro-F1 provided by the present application, as shown in the figure, Figure 6 the micro-F1 value obtained by the method provided by the present application is increased by 1.6% compared with KNN, increased by 2.7% compared with KD, and increased by 0.3% compared with RandomForest. It can be seen that the method provided by the present application is better than KNN, KD and RandomForest for detecting abnormal values of the to-be-detected load power data. Therefore, the method provided by the present application can detect abnormal values of the to-be-detected load power data in real time and improve the accuracy of detection.
[0131] The load power detection model training device and the load power detection device provided by the present application are described below. The load power detection model training device described below can be correspondingly referred to the load power detection model training method described above, and the load power detection device can be correspondingly referred to the load power detection method described above.
[0132] Figure 7 is a structure schematic diagram of the load power detection model training device provided by the present application, as shown in the figure, Figure 7 the load power detection model training device 700 comprises a first acquisition module 701, a first training module 702, a second training module 703 and an updating module 704; wherein,
[0133] The first acquisition module 701 is used for acquiring a load power data set of a power system; the load power data set comprises at least one data sequence; the data sequence comprises historical load power data, current load power data and future load power data;
[0134] The first training module 702 is used for training an initial teacher network model based on the load power data set to obtain a target teacher network model;
[0135] The second training module 703 is used for training an initial student network model based on the historical load power data and the current load power data to obtain a first student network model;
[0136] The updating module 704 is configured to update the first student network model based on the target teacher network model and the first student network model in a double-knowledge distillation manner, and determine the load power detection model.
[0137] The load power detection model training method provided by the application comprises the following steps: obtaining a load power data set of a power system; the load power data set comprises at least one data sequence; the data sequence comprises historical load power data, current load power data and future load power data; training an initial teacher network model based on the historical load power data, the current load power data and the future load power data in the load power data set, to obtain a target teacher network model; training an initial student network model based on the historical load power data and the current load power data in the load power data set, to obtain a first student network model; updating the first student network model based on the target teacher network model and the first student network model in a double-knowledge distillation manner, to determine a load power detection model; the load power detection model is determined based on the updated first student network model, and is used for detecting to-be-detected load power data, to determine the change of the to-be-detected load power data. The double-knowledge distillation manner is used to determine the load power detection model, the performance of the load power detection model is improved, the load power detection model can accurately detect abnormal values of to-be-detected load power data, the accuracy of to-be-detected load power data detection is improved, and the future change of the load power data can be accurately predicted.
[0138] Optionally, the updating module 704 is specifically configured to:
[0139] training the first student network model based on the target teacher network model and the first student network model in a first knowledge distillation manner, to determine first optimization parameters corresponding to the first student network model;
[0140] updating the first student network model based on the first optimization parameters, to obtain a second student network model;
[0141] training the second student network model based on the second student network model and the target teacher network model in a second knowledge distillation manner, to determine the load power detection model.
[0142] Optionally, the updating module 704 is specifically configured to:
[0143] The first loss value is calculated based on the first parameter of the target teacher network model, the second parameter of the first student network model and the initialization parameter corresponding to the guide layer in the first student network model.
[0144] The first optimization parameter corresponding to the first student network model is determined based on the first loss value.
[0145] Optionally, the updating module 704 is specifically configured to:
[0146] The target optimization parameter of the second student network model is determined.
[0147] The second student network model is updated based on the target optimization parameter, and the load power detection model is obtained.
[0148] Optionally, the updating module 704 is specifically configured to:
[0149] The cross-entropy loss value is calculated based on at least one output probability obtained in the training process of the second student network model and the output probability of the target teacher network model.
[0150] The target optimization parameter of the second student network model is determined based on the cross-entropy loss value.
[0151] Figure 8 The structure diagram of the load power detection device provided by the application is shown in FIG. 8. Figure 8 As shown in FIG. 8, the load power detection device 800 comprises a second acquisition module 801 and a detection module 802.
[0152] The second acquisition module 801 is configured to acquire the load power data to be detected.
[0153] The detection module 802 is configured to input the load power data to be detected into the load power detection model to obtain the detection result output by the load power detection model. Figure 7 The load power detection model is trained by the load power detection model training device shown in FIG. 7.
[0154] The load power detection device provided by the application inputs the load power data to be detected into the load power detection model to obtain the detection result output by the load power detection model.
[0155] Figure 9 is a schematic diagram of an entity structure of an electronic device provided by the present application, as shown in the figure, the electronic device can include: processor 910, communications interface 920, memory 930 and communication bus 940, wherein the processor 910, communications interface 920, memory 930 through the communication bus 940 complete mutual communication. The processor 910 can call the logic instruction in the memory 930 to execute the load power detection model training method, the method comprises: Figure 9 Obtaining a load power dataset of a power system; the load power dataset includes at least one data sequence; the data sequence includes historical load power data, current load power data and future load power data;
[0156] Training an initial teacher network model based on the load power dataset to obtain a target teacher network model;
[0157] Training an initial student network model based on the historical load power data and the current load power data to obtain a first student network model;
[0158] Updating the first student network model in a double-knowledge distillation manner based on the target teacher network model and the first student network model to determine a load power detection model; the load power detection model is determined based on the updated first student network model, and is used for detecting the to-be-detected load power data to judge the change of the to-be-detected load power data.
[0159] Optionally, the present application also provides an electronic device, which can include: processor, communications interface, memory and communication bus, wherein the processor, communications interface, memory complete mutual communication through the communication bus. The processor can call the logic instruction in the memory to execute the load power detection method, the method comprises: obtaining to-be-detected load power data; inputting the to-be-detected load power data into the load power detection model to obtain the detection result output by the load power detection model; the load power detection model is trained based on the load power detection model training method of any of the preceding embodiments.
[0160]
[0161] In addition, the logic instructions in the memory 930 described above can be implemented in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0162] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor to enable a computer to execute the load power detection model training method provided by the above-mentioned method, which comprises:
[0163] obtaining a load power data set of a power system; the load power data set comprises at least one data sequence; the data sequence comprises historical load power data, current load power data and future load power data;
[0164] training an initial teacher network model based on the load power data set to obtain a target teacher network model;
[0165] training an initial student network model based on the historical load power data and the current load power data to obtain a first student network model;
[0166] updating the first student network model in a double-knowledge distillation manner based on the target teacher network model and the first student network model to determine a load power detection model; the load power detection model is determined based on the updated first student network model, and is used for detecting to-be-detected load power data to judge the change of the to-be-detected load power data.
[0167] In another aspect, the present application also provides a computer program product comprising a computer program, which can be stored on a non-transitory computer-readable storage medium, and the computer program can be executed by a processor to enable a computer to perform the load power detection method provided by any of the above methods, which comprises: obtaining load power data to be detected; inputting the load power data to be detected into a load power detection model to obtain a detection result output by the load power detection model; and the load power detection model is trained based on the load power detection model training method of any of the above embodiments.
[0168] In another aspect, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the load power detection model training method provided by any of the above methods, which comprises:
[0169] obtaining a load power data set of a power system; the load power data set comprises at least one data sequence; the data sequence comprises historical load power data, current load power data and future load power data;
[0170] training an initial teacher network model based on the load power data set to obtain a target teacher network model;
[0171] training an initial student network model based on the historical load power data and the current load power data to obtain a first student network model;
[0172] updating the first student network model in a double-knowledge distillation manner based on the target teacher network model and the first student network model to determine a load power detection model; the load power detection model is determined based on the updated first student network model and is used for detecting load power data to be detected to determine a change of the load power data to be detected.
[0173] In another aspect, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the load power detection method provided by any of the above methods, which comprises: obtaining load power data to be detected; inputting the load power data to be detected into a load power detection model to obtain a detection result output by the load power detection model; and the load power detection model is trained based on the load power detection model training method of any of the above embodiments.
[0174] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0175] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0176] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for training a load power detection model, characterized in that, include: Obtain a load power dataset of a power system; the load power dataset includes at least one data sequence; the data sequence includes historical load power data, current load power data, and future load power data. Based on the load power dataset, the initial teacher network model is trained to obtain the target teacher network model; Based on the historical load power data and the current load power data, the initial student network model is trained to obtain the first student network model. Based on the target teacher network model and the first student network model, the first student network model is updated using a dual-knowledge distillation method to determine the load power detection model. The load power detection model is determined based on the updated first student network model and is used to detect the load power data to be detected in order to determine the changes in the load power data to be detected. The step of updating the first student network model using a dual-knowledge distillation method based on the target teacher network model and the first student network model to determine the load power detection model includes: Based on the target teacher network model and the first student network model, the first student network model is trained using a first knowledge distillation method to determine the first optimization parameters corresponding to the first student network model. Based on the first optimization parameters, the first student network model is updated to obtain the second student network model; Based on the second student network model and the target teacher network model, the second student network model is trained using a second knowledge distillation method to determine the load power detection model.
2. The load power detection model training method according to claim 1, characterized in that, Determining the first optimization parameters corresponding to the first student network model includes: Based on the first parameter of the target teacher network model, the second parameter of the first student network model, and the initialization parameter corresponding to the guiding layer in the first student network model, the first loss value is calculated respectively. Based on each of the first loss values, the first optimization parameters corresponding to the first student network model are determined.
3. The load power detection model training method according to claim 1, characterized in that, The step of training the second student network model using a second knowledge distillation method to determine the load power detection model includes: Determine the target optimization parameters for the second student network model; Based on the target optimization parameters, the second student network model is updated to obtain the load power detection model.
4. The load power detection model training method according to claim 3, characterized in that, Determining the target optimization parameters of the second student network model includes: Based on at least one output probability obtained during the training of the second student network model and the output probability of the target teacher network model, the cross-entropy loss value is calculated respectively. Based on the cross-entropy loss values, the target optimization parameters of the second student network model are determined.
5. A method for detecting load power, characterized in that, include: Acquire the power data of the load to be tested; The load power data to be detected is input into the load power detection model to obtain the detection result output by the load power detection model; the load power detection model is trained based on the load power detection model training method according to any one of claims 1 to 4.
6. A load power detection model training device, characterized in that, include: The first acquisition module is used to acquire a load power dataset of the power system; the load power dataset includes at least one data sequence; the data sequence includes historical load power data, current load power data, and future load power data. The first training module is used to train the initial teacher network model based on the load power dataset to obtain the target teacher network model; The second training module is used to train the initial student network model based on the historical load power data and the current load power data to obtain the first student network model. The update module is used to update the first student network model based on the target teacher network model and the first student network model using a dual-knowledge distillation method to determine the load power detection model; the load power detection model is determined based on the updated first student network model and is used to detect the load power data to be detected in order to determine the changes in the load power data to be detected. The update module is specifically used for: Based on the target teacher network model and the first student network model, the first student network model is trained using a first knowledge distillation method to determine the first optimization parameters corresponding to the first student network model. Based on the first optimization parameters, the first student network model is updated to obtain the second student network model; Based on the second student network model and the target teacher network model, the second student network model is trained using a second knowledge distillation method to determine the load power detection model.
7. A load power detection device, characterized in that, include: The second acquisition module is used to acquire the power data of the load to be detected; The detection module is used to input the load power data to be detected into the load power detection model and obtain the detection result output by the load power detection model; the load power detection model is trained based on the load power detection model training method according to any one of claims 1 to 4.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the load power detection model training method as described in any one of claims 1 to 4, or the load power detection method as described in claim 5.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the load power detection model training method as described in any one of claims 1 to 4, or the load power detection method as described in claim 5.