A load identification method, system, medium and device based on knowledge distillation
Patent Information
- Application Number
- CN202510792547.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2045-06-13
AI Technical Summary
[0004]本申请提供了一种基于知识蒸馏的负荷识别方法、系统、介质及设备,能够解决现有技术在资源受限的边缘设备上难以实现高效、自适应的非侵入式负荷监测的问题
[0014]相比于现有技术,上述实施例具有如下有益效果:通过梯度大小动态计算第二重要性权重,可以利用梯度敏感性量化参数对模型输出的贡献,确保重要性评估的客观性;平衡参数用于控制训练期间的时间影响,使参数重要性评估兼顾长期稳定性与短期数据变化;构造MAS正则化项,可以通过参数偏移惩罚约束历史任务关键参数,保持模型对旧负载的识别稳定性,解决灾难性遗忘问题。
Smart Images

Figure CN120611273B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power metering and relates to a load identification method, system, medium, and equipment based on knowledge distillation. Background Technology
[0002] With the continued growth of global energy demand and the increasing urgency for improving energy efficiency, smart grids, as the core development direction of modern power systems, rely on non-intrusive load monitoring technology to achieve refined analysis of users' electricity consumption behavior. This technology, by collecting real-time data on total voltage, current, and harmonics at the household entrance, replaces traditional invasive monitoring schemes, significantly reducing equipment deployment and maintenance costs, and becoming a key means for large-scale deployment. Existing methods mainly rely on machine learning algorithms (such as support vector machines and random forests), deep learning models (such as CNNs and Transformers), and centralized cloud processing to achieve load identification. Some solutions deploy static models locally on smart meters to perform inference, thus circumventing communication bandwidth limitations.
[0003] However, while existing methods have achieved non-intrusive load monitoring to some extent, their limitations significantly restrict their practical application: statically deployed models cannot dynamically adapt to the access of new appliances or changes in user electricity consumption patterns, requiring retraining and deployment in the cloud, resulting in delayed updates and insufficient flexibility; complex models (such as deep residual networks) can improve recognition accuracy, but their computational resource requirements far exceed the processing capabilities of edge devices such as smart meters, while lightweight models (such as simple CNNs) have weakened feature extraction capabilities due to structural simplification, making it difficult to balance accuracy and efficiency; in addition, centralized cloud processing relies on narrowband communication (such as NB-IoT) to transmit high-frequency sampling data, and bandwidth limitations can lead to a surge in communication latency, making it difficult to meet real-time monitoring requirements. Summary of the Invention
[0004] This application provides a load identification method, system, medium, and device based on knowledge distillation, which can solve the problem that existing technologies struggle to achieve efficient, adaptive, and non-intrusive load monitoring on resource-constrained edge devices.
[0005] To achieve the above objectives, in a first aspect, the present invention provides a load identification method based on knowledge distillation, comprising: Based on a preset cloud load identification model, the load classification knowledge of the cloud load identification model is transferred to the preset original load identification model through knowledge distillation to obtain a first load identification model; The first load identification model is quantized to obtain a lightweight second load identification model, and the second load identification model is sent to the edge device. The incremental update dataset is sent to the edge device so that the edge device optimizes the second load identification model according to the preset incremental update algorithm, combined with the cross-entropy loss and the dynamic constraints of key parameters of historical tasks, to generate a third load identification model. After optimization, the edge device performs load identification on the power data collected in real time according to the third load identification model and outputs the identification result.
[0006] Compared to existing technologies, the embodiments of this application have the following beneficial effects: Based on the cloud-based load identification model, load classification knowledge is transferred to the original load identification model through knowledge distillation, and the number of model parameters and computational complexity are reduced through quantization. While compressing the number of model parameters, the classification capability of the cloud-based load identification model is inherited, directly solving the problem of the imbalance between accuracy and efficiency of resource-constrained equipment. Furthermore, the cross-entropy loss in the incremental update algorithm optimizes the model's adaptability to new data, while dynamic constraints (such as MAS regularization) balance the updates of new and old task parameters to prevent catastrophic forgetting and improve the model's adaptability to dynamic power consumption scenarios. Finally, load identification is performed locally, eliminating the need for cloud communication, eliminating data transmission delays, and significantly improving real-time performance. The overall solution solves the core technical problem that static edge models cannot dynamically adapt to load changes through the synergistic combination of "knowledge distillation - dynamic incremental update - edge inference", achieving low resource consumption and real-time response while ensuring identification accuracy.
[0007] In some embodiments of the first aspect of this application, the step of transferring the load classification knowledge of the cloud load identification model to the preset original load identification model through knowledge distillation to obtain a first load identification model, based on a preset cloud load identification model, includes: Obtain the distillation dataset; wherein each load data in the distillation dataset is configured with a corresponding real type label; Based on the cloud-based load identification model, the load type of the distillation dataset is identified, and the corresponding first predicted probability distribution is output. Based on the original load identification model, the load type of the distillation dataset is identified, and the corresponding second predicted probability distribution is output. Based on the second predicted probability distribution and the one-heat distribution of the true type label, the first cross-entropy loss is calculated. The corresponding weighted Kullback-Leibler divergence is calculated based on the first and second predicted probability distributions. Based on the first cross-entropy loss and the weighted Kullback-Leibler divergence, a loss function is constructed, and the parameters of the original load identification model are iteratively updated according to the loss function until the model converges, thus obtaining the first load identification model.
[0008] Compared to existing technologies, the above embodiments have the following beneficial effects: By introducing supervision from real type labels, the original load identification model is ensured to retain its direct learning ability from the original task objective throughout the distillation process; the first predicted probability distribution output by the cloud-based load identification model is used as a soft objective to guide the original load identification model to understand the potential semantic similarity of samples, thereby enhancing its generalization ability to complex features; the cross-entropy loss is calculated by combining the second predicted probability distribution of the original load identification model to strengthen the supervision role of real labels and provide a clear optimization direction for the original load identification model; furthermore, the knowledge of the cloud-based load identification model is fused through weighted KL divergence and iteratively trained, and the joint optimization of cross-entropy loss and weighted KL divergence forms complementary supervision, dynamically adjusting the difference weights of the output distributions of the two models, balancing the "imitation intensity" of knowledge distillation, avoiding overfitting or underfitting caused by simply forcing distribution alignment, and achieving fine control of knowledge transfer.
[0009] In some embodiments of the first aspect of this application, the step of calculating the corresponding weighted Kullback-Leibler divergence based on the first and second predicted probability distributions includes: Based on the proportion of electricity consumption of each load category to the total electricity consumption in the distillation dataset, the weighted Kullback-Leibler divergence is calculated as the corresponding first importance weight; the calculation formula is as follows: ;in, This represents the weighted Kullback-Leibler divergence. This represents the first importance weight of the i-th type of load. This represents the predicted probability of the cloud-based load identification model for the i-th load category. This represents the predicted probability of the original load identification model for the i-th load category. This indicates the total number of load categories.
[0010] Compared with existing technologies, the above embodiments have the following beneficial effects: By introducing the proportion of electricity consumption as the first importance weight in the weighted KL divergence formula, the load energy consumption difference in the business scenario is quantified into model training weights, so that the prediction error of high energy-consuming equipment (such as air conditioners and refrigerators) is amplified in the loss function, directly improving the model's priority in identifying key loads.
[0011] In some embodiments of the first aspect of this application, the step of optimizing the second load identification model according to a preset incremental update algorithm, combined with cross-entropy loss and dynamic constraints of key parameters of historical tasks, to generate a third load identification model includes: Obtain the incremental update dataset; wherein, the incremental update dataset includes erroneous sample data obtained by the edge device through load identification of historically collected power data using the second load identification model; Based on the second load identification model, inference is performed on the incremental update dataset to calculate the corresponding second cross-entropy loss; The weight matrix of the fully connected layer of the second load identification model is clustered according to the load category to obtain several sets of classification parameters; Calculate the corresponding second importance weight based on each group of classification parameters, and construct the MAS regularization term based on each second importance weight; Based on the preset penalty coefficient, the second cross-entropy loss and MAS regularization term are weighted and fused to generate an objective function. Based on the objective function, the weight matrix and bias vector of the fully connected layer of the second load identification model are iteratively updated until the model converges, thus obtaining the third load identification model.
[0012] Compared to existing technologies, the above embodiments have the following beneficial effects: Incremental updates to the dataset trigger iterative model optimization, ensuring continuous learning capability for new load types. Simultaneously, error sample filtering focuses on weak points in the model, improving the efficiency of incremental learning. Clustering the weight matrix by load category explicitly encodes the correlation of classification parameters within the same category into a group structure. This parameter grouping mechanism can identify and strengthen the model's core discriminative dimensions for different category features, reduce redundant parameter interference, and improve the model's sensitivity to category-specific features. The MAS regularization term calculated based on the second importance weight of the parameter group can quantify the weighting of different parameter groups on historical tasks. The key to this approach is to constrain the update magnitude of important parameter sets, prioritizing the protection of learned critical classification knowledge and avoiding catastrophic forgetting during incremental training, while allowing non-important parameter sets to be flexibly adjusted for new tasks. Cross-entropy loss drives the model to learn new features from incremental data, while MAS regularization suppresses destructive updates to historically important parameters. By weighting the cross-entropy loss and MAS regularization terms with a penalty coefficient, this mechanism automatically distinguishes between adjustable and fixed parameter regions during parameter updates. Ultimately, this enables the third load identification model to stably integrate incremental data knowledge while inheriting the core capabilities of the second load identification model, achieving a balanced optimization of the goals of new and old tasks.
[0013] In some embodiments of the first aspect of this application, the step of calculating the corresponding second importance weight based on each group of classification parameters, and constructing a MAS regularization term according to each of the second importance weights, includes: The second importance weight is calculated separately for each group of classification parameters, as follows: ;in, This represents the classification parameters of the k-th group calculated in the t-th iteration. The second most important weight, Represents the balance parameters. This represents the incrementally updated dataset corresponding to the k-th group of classification parameters. Indicates a data sample. express The number of data samples in the middle, This indicates that the output of the second load identification model is relative to the classification parameters. The magnitude of the gradient; Based on each of the second importance weights, construct the MAS regularization term, as follows: ;in, This represents the MAS constraint, where K represents the number of groups of classification parameters. This represents the optimal classification parameter values obtained by training on historical data.
[0014] Compared with existing technologies, the above embodiments have the following beneficial effects: by dynamically calculating the second importance weight through gradient magnitude, the contribution of parameters to the model output can be quantified using gradient sensitivity, ensuring the objectivity of importance assessment; the balancing parameter is used to control the time influence during training, so that the parameter importance assessment takes into account both long-term stability and short-term data changes; the MAS regularization term is constructed, which can constrain key parameters of historical tasks through parameter offset penalty, maintain the stability of the model's recognition of old loads, and solve the catastrophic forgetting problem.
[0015] In some embodiments of the first aspect of this application, the step of generating the objective function by weighted fusion of the second cross-entropy loss and the MAS regularization term according to a preset penalty coefficient includes: The penalty coefficient is constructed based on the feature similarity between the new and old training tasks, using the following algorithm: ;in, Indicates the penalty coefficient. Indicates feature similarity. To control the hyperparameters of the decay rate, For the current new training task data, For old training task data, This indicates the upper limit of the penalty coefficient; Based on the penalty coefficient, the second cross-entropy loss and the MAS regularization term are weighted and fused to generate the objective function, as follows: ; Describe the objective function. This represents the second cross-entropy loss.
[0016] Compared with existing technologies, the above embodiments have the following beneficial effects: the dynamic penalty coefficient maps task similarity to a coefficient decay curve through an exponential function, which strengthens the regularization constraint when the difference between the new and old tasks is large and weakens the constraint when the difference is small, thus avoiding over-constraint or under-constraint caused by fixed coefficients; the objective function dynamically adjusts the learning intensity of the new and old tasks through the penalty coefficient, so that the model remains stable when the load characteristics change abruptly.
[0017] In some embodiments of the first aspect of this application, the step of identifying the load on the power data collected in real time by the edge device according to the third load identification model and outputting the identification result includes: The current and voltage waveform data are collected, and features are extracted from the current and voltage waveform data based on a preset sliding window mechanism to obtain the corresponding original power features. The original power characteristics are normalized to obtain power characteristic data, which is then input into the third load identification model for identification, and the identification result is output.
[0018] Compared with existing technologies, the above embodiments have the following beneficial effects: by normalizing the original power characteristics into standardized inputs with uniform dimensions, the differences in numerical ranges between characteristics are eliminated, the model's ability to perform balanced analysis of multidimensional power data is improved, and the stability and accuracy of the identification results are enhanced.
[0019] Secondly, the present invention also provides a knowledge distillation-based load identification system, comprising: a distillation module, a quantization module, and an optimized identification module; The distillation module is used to transfer the load classification knowledge of the cloud load identification model to the preset original load identification model through knowledge distillation based on the preset cloud load identification model, so as to obtain a first load identification model. The quantization module is used to quantize the first load identification model to obtain a lightweight second load identification model, and then send the second load identification model to the edge device. The optimized identification module is used to send incremental update datasets to the edge device, so that the edge device optimizes the second load identification model according to a preset incremental update algorithm, combined with cross-entropy loss and dynamic constraints of key parameters of historical tasks, to generate a third load identification model. After optimization, the edge device performs load identification on the real-time power data collected by the edge device according to the third load identification model and outputs the identification results.
[0020] Compared with existing technologies, the above embodiments of this application have the following beneficial effects: Based on the cloud-based load identification model, load classification knowledge is transferred to the original load identification model through knowledge distillation, and the number of model parameters and computational complexity are reduced by quantization. While compressing the number of model parameters, the classification ability of the cloud-based load identification model is inherited, directly solving the problem of the imbalance between accuracy and efficiency of resource-constrained equipment. Furthermore, the cross-entropy loss in the incremental update algorithm optimizes the model's adaptability to new data, while dynamic constraints (such as MAS regularization) balance the updates of new and old task parameters to prevent catastrophic forgetting and improve the model's adaptability to dynamic power consumption scenarios. Finally, the load identification is performed locally by the third load identification model, without relying on cloud communication, eliminating data transmission delay and significantly improving real-time performance. The overall solution solves the core technical problem that static edge models cannot dynamically adapt to load changes through the synergistic combination of "knowledge distillation - dynamic incremental update - edge inference", achieving low resource consumption and real-time response while ensuring identification accuracy.
[0021] Thirdly, the present invention also provides a knowledge distillation-based load identification device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when loaded onto the processor, implements the steps of any of the knowledge distillation-based load identification methods of the present invention.
[0022] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the knowledge distillation-based load identification methods of the present invention. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating a knowledge distillation-based load identification method provided in some embodiments of the present invention.
[0024] Figure 2 : This is a schematic diagram of a load identification system based on knowledge distillation provided in some embodiments of the present invention.
[0025] Figure 3 : This is a structural diagram of a load identification device based on knowledge distillation provided in some embodiments of the present invention.
[0026] Figure 4 This is a system architecture diagram for load identification provided in some embodiments of the present invention.
[0027] Figure 5 : This is a structural diagram of a load identification model on an edge device provided in some embodiments of the present invention. Detailed Implementation
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] Example 1: Please refer to Figure 1 To address the problem of existing technologies struggling to achieve efficient, adaptive, and non-intrusive load monitoring on resource-constrained edge devices, an embodiment of the present invention provides a load identification method based on knowledge distillation, comprising steps S1 to S3: Step S1: Based on the preset cloud load identification model, the load classification knowledge of the cloud load identification model is transferred to the preset original load identification model through knowledge distillation to obtain the first load identification model.
[0030] Furthermore, step S1 can be implemented through the following preferred embodiments, including steps S11-S15, as detailed below: S11: Obtain the distillation dataset; wherein, each load data in the distillation dataset is configured with a corresponding real type label; S12: Based on the cloud-based load identification model, identify the load type of the distillation dataset and output the corresponding first predicted probability distribution; S13: Based on the original load identification model, identify the load type of the distillation dataset, output the corresponding second predicted probability distribution, and calculate the first cross-entropy loss based on the second predicted probability distribution and the one-heat distribution of the true type label. S14: Calculate the corresponding weighted Kullback-Leibler divergence based on the first and second prediction probability distributions; S15: Construct a loss function based on the first cross-entropy loss and the weighted Kullback-Leibler divergence, and iteratively update the parameters of the original load identification model according to the loss function until the model converges to obtain the first load identification model.
[0031] In this preferred embodiment, by introducing supervision from real type labels, the original load identification model is ensured to retain its direct learning ability from the original task objective throughout the distillation process. The first predicted probability distribution output by the cloud-based load identification model is used as a soft objective to guide the original load identification model in understanding the latent semantic similarity of samples, enhancing its generalization ability to complex features. The cross-entropy loss is calculated by combining the second predicted probability distribution of the original load identification model, strengthening the supervisory role of real labels and providing a clear optimization direction for the original load identification model. Furthermore, by fusing knowledge from the cloud-based load identification model through weighted KL divergence and performing iterative training, the joint optimization of cross-entropy loss and weighted KL divergence forms complementary supervision, dynamically adjusting the difference weights of the two model output distributions, balancing the "imitation intensity" of knowledge distillation, avoiding overfitting or underfitting caused by simply forcing distribution alignment, and achieving fine control of knowledge transfer.
[0032] In specific implementation, such as Figure 4 The diagram illustrates a system architecture for load identification. This system includes a metering automation master station (cloud), smart meters (edge devices), and smart distribution area terminals. The metering automation master station is used to orchestrate system-wide data utilization, operational strategies, model iteration, and propagation. In the cloud, the bandwidth utilization and packet loss rate of data transmission at each substation can be monitored in real time, and data acquisition commands can be issued to obtain training samples. After training a high-precision cloud model (i.e., the cloud-based load identification model in this application), knowledge distillation and model compression techniques are applied to transfer rich knowledge from the cloud model to a lightweight student model (i.e., the original load identification model in this application) and distribute it to the edge devices. Furthermore, a big data analytics platform can be used to analyze load characteristic changes between different substations, thereby dynamically adjusting the model parameter propagation strategy.
[0033] As a key node in the system's data processing, the smart distribution terminal performs crucial functions such as data aggregation, transmission, and model update propagation. It connects to the cloud platform and runs several key components delivered from the cloud. These include a device management component for centralized management of smart meters, enabling coordinated data collection across edge devices; a local data caching component for temporary storage of collected data for later processing; and an application management component that oversees the lifecycle of various edge applications to ensure stable operation and iterative updates.
[0034] The smart meter acts as the system's data acquisition and preliminary processing unit. It integrates an extended computing module with an Arm Cortex-M4F core, supporting the local deployment of lightweight neural network models. The meter can sample current and voltage waveforms at a rate of 8 kHz, extracting load characteristics through its built-in load identification model to identify the operating status of the equipment load. To alleviate communication bandwidth limitations, the identification results can be compressed and transmitted to the smart distribution terminal according to the DL / T645-2007 communication protocol.
[0035] like Figure 5 The diagram shows a structure of a load identification model on an edge device. In this application, the model downloaded from the cloud and deployed on a smart meter can adopt a lightweight architecture combining 1D-CNN, BiGRU, and Attention mechanisms. This network includes a CNN-based feature extraction layer, a BiGRU temporal layer, an attention mechanism, and a fully connected classification layer, as detailed below: (1) CNN layer: Two convolutional layers are used, with 32 and 64 filters respectively. Each convolution uses a kernel size of 1×3 and the ReLU activation function for local feature extraction; (2) BiGRU layer: Use a single bidirectional GRU layer with 64 units; (3) Attention layer: The attention mechanism is used to enhance the focus on key features and improve classification accuracy.
[0036] (4) Fully connected classification layer: A single fully connected layer is used, with the number of neurons equal to the number of load classes. The Softmax activation function is used to output the probability distribution of each class.
[0037] During knowledge distillation, soft-target distillation is employed, enabling the original load identification model to learn the predicted probability distribution of the cloud-based load identification model, rather than relying solely on discrete hard labels. The overall loss function is defined as follows: ,in, This represents the weighted Kullback-Leibler divergence. This represents the first cross-entropy loss. Indicates the balance parameters; Furthermore, the calculation of the first cross-entropy loss is expressed as follows: Where C is the number of categories in the classification task. One-hot encoding of the true type labels for the distillation dataset. This represents the predicted probability of the original load identification model for the i-th load category.
[0038] Furthermore, in step S14, the calculation of the weighted Kullback-Leibler divergence can be implemented through the following preferred embodiment, as follows: Based on the proportion of electricity consumption of each load category to the total electricity consumption in the distillation dataset, the weighted Kullback-Leibler divergence is calculated as the corresponding first importance weight; the calculation formula is as follows: ;in, This represents the weighted Kullback-Leibler divergence. This represents the first importance weight of the i-th type of load. This represents the predicted probability of the cloud-based load identification model for the i-th load category. This represents the predicted probability of the original load identification model for the i-th load category. This indicates the total number of load categories.
[0039] In this preferred embodiment, the proportion of electricity consumption is introduced as the first importance weight in the weighted KL divergence formula, and the difference in load energy consumption in the business scenario is quantified as the model training weight. This amplifies the prediction error of high-energy-consuming equipment (such as air conditioners and refrigerators) in the loss function, and directly improves the model's priority in identifying key loads.
[0040] Step S2: Quantize the first load identification model to obtain a lightweight second load identification model, and send the second load identification model to the edge device.
[0041] In practice, the model can be quantized using the INT8 quantization method, converting the original floating-point calculations into 8-bit integer operations, thereby reducing computational resource consumption and improving inference speed. After quantization, the model can be deployed to edge devices (i.e., smart meters) using TensorFlow Lite.
[0042] In this embodiment, the model is quantized before being pushed to the smart meter to meet the requirements of the smart meter as an embedded device for low-power real-time inference.
[0043] Step S3: Send the incremental update dataset to the edge device so that the edge device can optimize the second load identification model according to the preset incremental update algorithm, combined with the cross-entropy loss and the dynamic constraints of the key parameters of the historical task, generate a third load identification model, and after optimization, perform load identification on the power data collected by the edge device in real time according to the third load identification model and output the identification result.
[0044] Furthermore, in step S3, the optimization of the second load identification model can be achieved through the following preferred implementation method, including steps S31-S35, as follows: S31: Obtain the incremental update dataset; wherein, the incremental update dataset includes erroneous sample data obtained by the edge device through the second load identification model to identify the load of historically collected power data; S32: Based on the second load identification model, reason about the incremental update dataset and calculate the corresponding second cross-entropy loss; S33: Cluster the weight matrix of the fully connected layer of the second load identification model according to the load category to obtain several sets of classification parameters; S34: Calculate the corresponding second importance weight based on each group of classification parameters, and construct the MAS regularization term according to each second importance weight; S35: Based on the preset penalty coefficient, the second cross-entropy loss and MAS regularization term are weighted and fused to generate an objective function. Based on the objective function, the weight matrix and bias vector of the fully connected layer of the second load identification model are iteratively updated until the model converges to obtain the third load identification model.
[0045] In this preferred embodiment, incremental updates to the dataset trigger iterative model optimization, ensuring continuous learning capability for new load types. Simultaneously, error sample filtering focuses on weak points in the model, improving the efficiency of incremental learning. Clustering the weight matrix by load category explicitly encodes the correlation of classification parameters within the same category into a group structure. This parameter grouping mechanism identifies and strengthens the model's core discriminative dimensions for different category features, reduces redundant parameter interference, and enhances the model's sensitivity to category-specific features. The MAS regularization term, calculated based on the second importance weights of the parameter groups, quantifies the importance of different parameter groups to historical tasks, and through approximation... The update magnitude of important parameter sets is constrained, prioritizing the protection of learned key classification knowledge and avoiding catastrophic forgetting during incremental training, while allowing non-important parameter sets to be flexibly adjusted for new tasks. Cross-entropy loss drives the model to learn new features of incremental data, while MAS regularization suppresses destructive updates to historically important parameters. By weighting the cross-entropy loss and MAS regularization terms with a penalty coefficient, this mechanism automatically distinguishes between adjustable and fixed parameter regions during parameter updates. Ultimately, the third load identification model, while inheriting the core capabilities of the second load identification model, stably integrates the knowledge of incremental data, achieving a balanced optimization of the goals of new and old tasks.
[0046] In practical implementation, after the edge device identifies the load of historically collected power data through the second load identification model, the sample data with incorrect identification can be uploaded to the cloud for identification and correction of data labels, which can then be used as the data source for subsequent incremental updates.
[0047] In step S32, the second cross-entropy loss is calculated, assuming the incrementally updated dataset is: ;in This represents the i-th input feature (such as active power, reactive power, and harmonic features). This indicates the true label corresponding to the input feature. This refers to the sample size. Therefore, the second cross-entropy loss can be calculated as follows: ;in, It is the sample size of the input data. It is the number of categories. It is a sample For the true label of category c The samples are output by the second load identification model. The predicted probability for category c.
[0048] Furthermore, during the clustering and grouping process in step S33, the weights of the fully connected layers are adjusted based on the clustering analysis. Group by load type, assuming there are K groups. The dataset is updated incrementally for each group. Specifically, the K-Means algorithm can be used to analyze load characteristics (such as...). (Using standardized data), we calculate the inertia of different K values, which is the sum of squared distances from the sample to the cluster center. Then, we select the K value where the inertia decreases sharply, i.e., the elbow, as the number of groups to ensure reasonable grouping and avoid overfitting or underfitting.
[0049] After grouping, in step S34, constructing the MAS regularization term can be achieved through the following preferred implementation, including steps S341-342, as follows: S341: Calculate the second importance weight separately for each group of classification parameters, as follows: ;in, This represents the classification parameters of the k-th group calculated in the t-th iteration. The second most important weight, Represents the balance parameters. This represents the incrementally updated dataset corresponding to the k-th group of classification parameters. Indicates a data sample. express The number of data samples in the middle, This indicates that the output of the second load identification model is relative to the classification parameters. The magnitude of the gradient; S342: Construct the MAS regularization term based on each of the second importance weights, as follows: ;in, This represents the MAS constraint, where K represents the number of groups of classification parameters. This represents the optimal classification parameter values obtained through training on historical data. If A large value indicates that the parameter is important for the old task. They will be subject to severe punishment, forcing Keep close .if If the value is very small, it means the parameter is not important to the old task, so it is allowed. Significant adjustments were made to adapt to the new tasks.
[0050] In this preferred embodiment, the second importance weight is dynamically calculated by the gradient magnitude, which allows the gradient sensitivity to quantify the contribution of the parameter to the model output, ensuring the objectivity of the importance assessment. The balancing parameter is used to control the time influence during training, so that the parameter importance assessment takes into account both long-term stability and short-term data changes. The MAS regularization term is constructed, which can constrain the key parameters of historical tasks through parameter offset penalties, maintain the stability of the model's recognition of old loads, and solve the catastrophic forgetting problem.
[0051] Furthermore, in order to achieve a dynamic balance between knowledge preservation and new knowledge learning when the similarity between tasks varies, this application also introduces an adaptive mechanism when constructing the objective function for incremental updates. The mechanism is as follows: In step S35, the objective function can be generated through the following preferred implementation method, including steps S351-S352, as follows: S351: Construct the penalty coefficient based on the feature similarity between the new and old training tasks. The algorithm is as follows: ;in, Indicates the penalty coefficient. Indicates feature similarity. To control the hyperparameters of the decay rate, For the current new training task data, For old training task data, This represents the upper limit of the penalty coefficient; when the similarity between preceding and following tasks is high, Automatically reduces the limitations of MAS on old parameters, but when there are large differences in tasks, Increase and reinforce existing knowledge to avoid catastrophic forgetting.
[0052] S352: Based on the penalty coefficient, the second cross-entropy loss and the MAS regularization term are weighted and fused to generate the objective function, as follows: ; Describe the objective function. This represents the second cross-entropy loss.
[0053] In practical implementation, the feature similarity in step S351 can be measured using cosine similarity, for two data vectors. and The cosine similarity between them for: ;in It is the dot product (inner product) of vectors. and These represent the modulus (Euclidean norm) of the two vectors, respectively.
[0054] Furthermore, when using the objective function for incremental updates, a small-batch update strategy specifically for the classification layer is employed. Specifically, during updates, only the weights W and bias vector b of the fully connected layers are fine-tuned, keeping the overall model architecture unchanged. The update is represented as follows: ; ;in, The learning rate controls the step size for each update. and Loss functions The gradient with respect to W and b.
[0055] In this preferred embodiment, the dynamic penalty coefficient maps the task similarity to a coefficient decay curve through an exponential function. When the difference between the new and old tasks is large, the regularization constraint is strengthened, and when the difference is small, the constraint is weakened, avoiding over-constraint or under-constraint caused by fixed coefficients. The objective function dynamically adjusts the learning intensity of the new and old tasks through the penalty coefficient, so that the model remains stable when the load characteristics change abruptly.
[0056] Further, in step S3, the process of identifying the load on the power data collected in real time by the edge device based on the third load identification model and outputting the identification result can be implemented through the following preferred embodiments, including steps S36-S37, as follows: S36: Collect the current and voltage waveform data, and extract features from the current and voltage waveform data based on a preset sliding window mechanism to obtain the corresponding original power features; S37: Normalize the original power characteristics to obtain power characteristic data, input it into the third load identification model for identification, and output the identification result.
[0057] In practical implementation, during load identification, active power P and reactive power Q are the main effective characteristics reflecting the operating status of various electrical appliances. Active power can distinguish devices with different power levels, while reactive power can distinguish loads of different types, such as inductors, capacitors, and resistors. and The definition is as follows: ; Where T represents the number of sampling points in one period; and These represent the voltage and current values at the t-th sampling point, respectively.
[0058] Furthermore, the widespread use of various nonlinear electrical devices in power systems leads to current distortion, thereby generating harmonics. Different devices produce harmonics with different components and amplitudes. Therefore, harmonic components are also a key characteristic. Harmonic characteristics are represented as follows: ;in, , It is the total number of sampling points. Indicates the order of harmonics. Indicates the current number The amplitude of the second harmonic, where j represents the imaginary unit.
[0059] During data collection, the smart meter collects the user's current and voltage waveforms at a sampling rate of 8kHz, then uses a sliding window to segment the time series data, and calculates the features using the formula mentioned above. , , , , and To form a time feature sequence: ;in, The load characteristics for the i-th time window are then normalized. ;in, The normalized load characteristics for the i-th time window are... This is the average value. The standard deviation is denoted as .
[0060] After collecting the data, it is input into the model for recognition, as shown below: ;in, This represents the load identification model on the smart meter. This represents the model output.
[0061] During recognition, the model generates a predicted probability distribution based on the input data. This represents the probability of each load pattern. For multi-class classification problems, this probability distribution is typically obtained using the Softmax activation function, as shown below: ;in, It is the unnormalized output of the model for the i-th type of load, and C is the number of categories.
[0062] After the identification is complete, we can extract the maximum predicted probability from the predicted probability distribution. ,in, This is the student model's prediction probability for the c-th type of load, representing the model's most confident prediction. If the highest prediction probability is... Below the set threshold If a sample is deemed uncertain, it is recorded as an erroneous sample and pushed to the metering master station for verification. Subsequently, during incremental updates, these erroneous samples can be used to verify and correct the labels in the cloud before being sent back to the smart meter for incremental updates and optimization of the local model, i.e., step S3 above. .
[0063] In this preferred embodiment, the original power characteristics are converted into standardized inputs with uniform dimensions through normalization processing, eliminating differences in the numerical range between characteristics, improving the model's ability to perform balanced analysis of multidimensional power data, and enhancing the stability and accuracy of the identification results.
[0064] In summary, compared with the prior art, the above embodiments of this application have the following beneficial effects: Based on the cloud-based load identification model, load classification knowledge is transferred to the original load identification model through knowledge distillation, and the number of model parameters and computational complexity are reduced by quantization. While compressing the number of model parameters, the classification ability of the cloud-based load identification model is inherited, directly solving the problem of the imbalance between accuracy and efficiency of resource-constrained equipment. Furthermore, the cross-entropy loss in the incremental update algorithm optimizes the model's adaptability to new data, while dynamic constraints (such as MAS regularization) balance the updates of new and old task parameters to prevent catastrophic forgetting and improve the model's adaptability to dynamic power consumption scenarios. Finally, the load identification is performed locally by the third load identification model, without relying on cloud communication, eliminating data transmission delay and significantly improving real-time performance. The overall solution solves the core technical problem that static edge models cannot dynamically adapt to load changes through the synergistic combination of "knowledge distillation - dynamic incremental update - edge inference", achieving low resource consumption and real-time response while ensuring identification accuracy.
[0065] Example 2: Please refer to Figure 2 Based on the same inventive concept, the present invention discloses a load identification system based on knowledge distillation, comprising: a distillation module M1, a quantization module M2, and an optimized identification module M3; The distillation module M1 is used to transfer the load classification knowledge of the cloud load identification model to the preset original load identification model through knowledge distillation based on the preset cloud load identification model, so as to obtain the first load identification model.
[0066] Furthermore, the distillation module M1 includes: a distillation data acquisition unit, a first load identification unit, a first cross-entropy loss calculation unit, a weighted Kullback-Leibler divergence calculation unit, and a first iteration unit; The distillation data acquisition unit is used to acquire a distillation dataset; wherein each load data in the distillation dataset is configured with a corresponding real type label; The first load identification unit is used to identify the load type of the distillation dataset according to the cloud load identification model and output the corresponding first predicted probability distribution; The first cross-entropy loss calculation unit is used to identify the load type of the distillation dataset according to the original load identification model, output the corresponding second predicted probability distribution, and calculate the first cross-entropy loss according to the second predicted probability distribution and the one-heat distribution of the true type label. The weighted Kullback-Leibler divergence calculation unit is used to calculate the corresponding weighted Kullback-Leibler divergence based on the first prediction probability distribution and the second prediction probability distribution. The first iterative unit is used to construct a loss function based on the first cross-entropy loss and the weighted Kullback-Leibler divergence, and to iteratively update the parameters of the original load identification model according to the loss function until the model converges, thereby obtaining the first load identification model.
[0067] In this preferred embodiment, by introducing supervision from real type labels, the original load identification model is ensured to retain its direct learning ability from the original task objective throughout the distillation process. The first predicted probability distribution output by the cloud-based load identification model is used as a soft objective to guide the original load identification model in understanding the latent semantic similarity of samples, enhancing its generalization ability to complex features. The cross-entropy loss is calculated by combining the second predicted probability distribution of the original load identification model, strengthening the supervisory role of real labels and providing a clear optimization direction for the original load identification model. Furthermore, by fusing knowledge from the cloud-based load identification model through weighted KL divergence and performing iterative training, the joint optimization of cross-entropy loss and weighted KL divergence forms complementary supervision, dynamically adjusting the difference weights of the two model output distributions, balancing the "imitation intensity" of knowledge distillation, avoiding overfitting or underfitting caused by simply forcing distribution alignment, and achieving fine control of knowledge transfer.
[0068] Furthermore, the weighted Kullback-Leibler divergence calculation unit can be implemented through the following preferred embodiments, as detailed below: Based on the proportion of electricity consumption of each load category to the total electricity consumption in the distillation dataset, the weighted Kullback-Leibler divergence is calculated as the corresponding first importance weight; the calculation formula is as follows: ;in, This represents the weighted Kullback-Leibler divergence. This represents the first importance weight of the i-th type of load. This represents the predicted probability of the cloud-based load identification model for the i-th load category. This represents the predicted probability of the original load identification model for the i-th load category. This indicates the total number of load categories.
[0069] In this preferred embodiment, the proportion of electricity consumption is introduced as the first importance weight in the weighted KL divergence formula, and the difference in load energy consumption in the business scenario is quantified as the model training weight. This amplifies the prediction error of high-energy-consuming equipment (such as air conditioners and refrigerators) in the loss function, and directly improves the model's priority in identifying key loads.
[0070] The quantization module M2 is used to quantize the first load identification model to obtain a lightweight second load identification model, and then send the second load identification model to the edge device.
[0071] The optimized identification module M3 is used to send incremental update datasets to the edge device, so that the edge device optimizes the second load identification model according to the preset incremental update algorithm, combined with the cross-entropy loss and the dynamic constraints of key parameters of historical tasks, to generate a third load identification model. After optimization, the edge device performs load identification on the real-time power data collected by the edge device according to the third load identification model and outputs the identification results.
[0072] Furthermore, the optimized identification module M3 includes: an incremental data acquisition unit, a second cross-entropy loss calculation unit, a grouping unit, a regularization term construction unit, and a second iteration unit; The incremental data acquisition unit is used to acquire the incremental update dataset; wherein the incremental update dataset includes erroneous sample data obtained by the edge device through load identification of historically collected power data using the second load identification model; The second cross-entropy loss calculation unit is used to infer the incremental update dataset based on the second load identification model and calculate the corresponding second cross-entropy loss. The grouping unit is used to cluster the weight matrix of the fully connected layer of the second load identification model according to the load category to obtain several groups of classification parameters; The regularization term construction unit is used to calculate the corresponding second importance weight based on each group of classification parameters, and to construct MAS regularization terms according to each of the second importance weights. The second iteration unit is used to generate an objective function by weighted fusion of the second cross-entropy loss and the MAS regularization term according to a preset penalty coefficient, and to iteratively update the weight matrix and bias vector of the fully connected layer of the second load identification model according to the objective function until the model converges, thereby obtaining the third load identification model.
[0073] In this preferred embodiment, incremental updates to the dataset trigger iterative model optimization, ensuring continuous learning capability for new load types. Simultaneously, error sample filtering focuses on weak points in the model, improving the efficiency of incremental learning. Clustering the weight matrix by load category explicitly encodes the correlation of classification parameters within the same category into a group structure. This parameter grouping mechanism identifies and strengthens the model's core discriminative dimensions for different category features, reduces redundant parameter interference, and enhances the model's sensitivity to category-specific features. The MAS regularization term, calculated based on the second importance weights of the parameter groups, quantifies the importance of different parameter groups to historical tasks, and through approximation... The update magnitude of important parameter sets is constrained, prioritizing the protection of learned key classification knowledge and avoiding catastrophic forgetting during incremental training, while allowing non-important parameter sets to be flexibly adjusted for new tasks. Cross-entropy loss drives the model to learn new features of incremental data, while MAS regularization suppresses destructive updates to historically important parameters. By weighting the cross-entropy loss and MAS regularization terms with a penalty coefficient, this mechanism automatically distinguishes between adjustable and fixed parameter regions during parameter updates. Ultimately, the third load identification model, while inheriting the core capabilities of the second load identification model, stably integrates the knowledge of incremental data, achieving a balanced optimization of the goals of new and old tasks.
[0074] Furthermore, the regularization term construction unit includes: a weight calculation subunit and a construction subunit; The weight calculation subunit is used to calculate the second importance weight for each group of classification parameters separately, and the calculation method is as follows: ;in, This represents the classification parameters of the k-th group calculated in the t-th iteration. The second most important weight, Represents the balance parameters. This represents the incrementally updated dataset corresponding to the k-th group of classification parameters. Indicates a data sample. express The number of data samples in the middle, This indicates that the output of the second load identification model is relative to the classification parameters. The magnitude of the gradient; The construction subunit is used to construct MAS regularization terms based on each of the second importance weights, and the algorithm is as follows: ;in, This represents the MAS constraint, where K represents the number of groups of classification parameters. This represents the optimal classification parameter values obtained by training on historical data.
[0075] In this preferred embodiment, the second importance weight is dynamically calculated by the gradient magnitude, which allows the gradient sensitivity to quantify the contribution of the parameter to the model output, ensuring the objectivity of the importance assessment. The balancing parameter is used to control the time influence during training, so that the parameter importance assessment takes into account both long-term stability and short-term data changes. The MAS regularization term is constructed, which can constrain the key parameters of historical tasks through parameter offset penalties, maintain the stability of the model's recognition of old loads, and solve the catastrophic forgetting problem.
[0076] Furthermore, the second iterative unit includes: a penalty coefficient construction subunit and a fusion subunit; The penalty coefficient construction subunit is used to construct the penalty coefficient based on the feature similarity between the new and old training tasks. The algorithm is as follows: ;in, Indicates the penalty coefficient. Indicates feature similarity. To control the hyperparameters of the decay rate, For the current new training task data, For old training task data, This indicates the upper limit of the penalty coefficient; The fusion subunit is used to generate an objective function by weightedly fusing the second cross-entropy loss and the MAS regularization term according to the penalty coefficient, as follows: ; Describe the objective function. This represents the second cross-entropy loss.
[0077] In this preferred embodiment, the dynamic penalty coefficient maps the task similarity to a coefficient decay curve through an exponential function. When the difference between the new and old tasks is large, the regularization constraint is strengthened, and when the difference is small, the constraint is weakened, avoiding over-constraint or under-constraint caused by fixed coefficients. The objective function dynamically adjusts the learning intensity of the new and old tasks through the penalty coefficient, so that the model remains stable when the load characteristics change abruptly.
[0078] Furthermore, the optimized identification module M3 also includes: a real-time data acquisition unit and an output unit; The real-time data acquisition unit is used to acquire current and voltage waveform data, and extract features from the current and voltage waveform data based on a preset sliding window mechanism to obtain the corresponding original power features. The output unit is used to normalize the original power characteristics to obtain power characteristic data, and input it into the third load identification model for identification, and output the identification result.
[0079] In this preferred embodiment, the original power characteristics are converted into standardized inputs with uniform dimensions through normalization processing, eliminating differences in the numerical range between characteristics, improving the model's ability to perform balanced analysis of multidimensional power data, and enhancing the stability and accuracy of the identification results.
[0080] In summary, compared with existing technologies, the embodiments of this application have the following beneficial effects: Based on the cloud-based load identification model, load classification knowledge is transferred to the original load identification model through knowledge distillation, and the number of model parameters and computational complexity are reduced through quantization. While compressing the number of model parameters, the classification capability of the cloud-based load identification model is inherited, directly solving the problem of the imbalance between accuracy and efficiency of resource-constrained equipment. Furthermore, the cross-entropy loss in the incremental update algorithm optimizes the model's adaptability to new data, while dynamic constraints (such as MAS regularization) balance the updates of new and old task parameters to prevent catastrophic forgetting and improve the model's adaptability to dynamic power consumption scenarios. Finally, load identification is performed locally through a third load identification model, without relying on cloud communication, eliminating data transmission delays and significantly improving real-time performance. The overall solution solves the core technical problem that static edge models cannot dynamically adapt to load changes through the synergistic combination of "knowledge distillation - dynamic incremental update - edge inference", achieving low resource consumption and real-time response while ensuring identification accuracy.
[0081] Example 3: Figure 3 A structural diagram of a load identification device based on knowledge distillation, as described in this application, is presented. Figure 3 As shown, the knowledge distillation-based load identification device may include: a processor N1, a memory N2, a data interface N3, and a communication bus N4.
[0082] Wherein: processor N1, memory N2, and data interface N3 communicate with each other through communication bus N4; data interface N3 is used for data communication with other devices such as input devices or output devices; processor N1 is used to execute program N5, specifically it can execute the relevant steps in any of the above embodiments of the knowledge distillation-based load identification method.
[0083] Specifically, program N5 may include program code, which includes computer-executable instructions.
[0084] The processor N1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The knowledge distillation-based load identification device includes one or more processors, which may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.
[0085] Memory N2 is used to store program N5. Memory N2 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage.
[0086] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Furthermore, the embodiments in this application are not directed to any particular programming language.
[0087] Example 4: This invention also provides a computer-readable storage medium storing at least one executable instruction that, when executed on a knowledge distillation-based load identification device / system, causes the knowledge distillation-based load identification device / system to perform one of the knowledge distillation-based load identification methods described in any of the above method embodiments.
[0088] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. Similarly, for the purpose of simplification and aiding understanding of one or more aspects of the invention, in the above description of exemplary embodiments of this application, various features of the embodiments are sometimes grouped together in a single embodiment, figure, or description thereof. The claims, which follow the detailed description, are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.
[0089] Those skilled in the art will understand that the modules in the device of the embodiment can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiment can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components, except that at least some of such features and / or processes or units are mutually exclusive.
Claims
1. A load identification method based on knowledge distillation, characterized in that, include: Based on a preset cloud-based load identification model, the load classification knowledge of the cloud-based load identification model is transferred to the preset original load identification model through knowledge distillation to obtain a first load identification model; including: Obtain the distillation dataset; wherein each load data in the distillation dataset is configured with a corresponding real type label; Based on the cloud-based load identification model, the load type of the distillation dataset is identified, and the corresponding first predicted probability distribution is output. Based on the original load identification model, the load type of the distillation dataset is identified, and the corresponding second predicted probability distribution is output. Based on the second predicted probability distribution and the one-heat distribution of the true type label, the first cross-entropy loss is calculated. The corresponding weighted Kullback-Leibler divergence is calculated based on the first and second predicted probability distributions. Based on the first cross-entropy loss and the weighted Kullback-Leibler divergence, a loss function is constructed, and the parameters of the original load identification model are iteratively updated according to the loss function until the model converges, thus obtaining the first load identification model; The first load identification model is quantized to obtain a lightweight second load identification model, and the second load identification model is sent to the edge device. The incremental update dataset is sent to the edge device so that the edge device optimizes the second load identification model according to the preset incremental update algorithm, combined with the cross-entropy loss and the dynamic constraints of key parameters of historical tasks, to generate a third load identification model. After optimization, the edge device performs load identification on the real-time power data collected by the edge device according to the third load identification model and outputs the identification result. The second load identification model is optimized based on a preset incremental update algorithm, combined with cross-entropy loss and dynamic constraints of key parameters of historical tasks, to generate a third load identification model, including: Obtain the incremental update dataset; wherein, the incremental update dataset includes erroneous sample data obtained by the edge device through load identification of historically collected power data using the second load identification model; Based on the second load identification model, inference is performed on the incremental update dataset to calculate the corresponding second cross-entropy loss; The weight matrix of the fully connected layer of the second load identification model is clustered according to the load category to obtain several sets of classification parameters; Calculate the corresponding second importance weight based on each group of classification parameters, and construct the MAS regularization term based on each second importance weight; Based on the preset penalty coefficient, the second cross-entropy loss and MAS regularization term are weighted and fused to generate an objective function. Based on the objective function, the weight matrix and bias vector of the fully connected layer of the second load identification model are iteratively updated until the model converges, thus obtaining the third load identification model.
2. The knowledge distillation-based load identification method as described in claim 1, characterized in that, The step of calculating the corresponding weighted Kullback-Leibler divergence based on the first and second predicted probability distributions includes: Based on the proportion of electricity consumption of each load category to the total electricity consumption in the distillation dataset, the weighted Kullback-Leibler divergence is calculated as the corresponding first importance weight; the calculation formula is as follows: ;in, This represents the weighted Kullback-Leibler divergence. This represents the first importance weight of the i-th type of load. This represents the predicted probability of the cloud-based load identification model for the i-th load category. This represents the predicted probability of the original load identification model for the i-th load category. This indicates the total number of load categories.
3. The knowledge distillation-based load identification method as described in claim 1, characterized in that, The step of calculating the corresponding second importance weight based on each group of classification parameters, and constructing a MAS regularization term based on each of the second importance weights, includes: The second importance weight is calculated separately for each group of classification parameters, as follows: ;in, This represents the classification parameters of the k-th group calculated in the t-th iteration. The second most important weight, Represents the balance parameters. This represents the incrementally updated dataset corresponding to the k-th group of classification parameters. Indicates a data sample. express The number of data samples in the middle, This indicates that the output of the second load identification model is relative to the classification parameters. The magnitude of the gradient; Based on each of the second importance weights, construct the MAS regularization term, as follows: ;in, This represents the MAS constraint, where K represents the number of groups of classification parameters. This represents the optimal classification parameter values obtained by training on historical data.
4. The knowledge distillation-based load identification method as described in claim 1, characterized in that, The step of generating the objective function by weighted fusion of the second cross-entropy loss and the MAS regularization term according to a preset penalty coefficient includes: The penalty coefficient is constructed based on the feature similarity between the new and old training tasks, using the following algorithm: ;in, Indicates the penalty coefficient. Indicates feature similarity. To control the hyperparameters of the decay rate, For the current new training task data, For old training task data, This indicates the upper limit of the penalty coefficient; Based on the penalty coefficient, the second cross-entropy loss and the MAS regularization term are weighted and fused to generate the objective function, as follows: ; Describe the objective function. This represents the second cross-entropy loss; This represents a MAS constraint.
5. A knowledge distillation-based load identification method as described in any one of claims 1-4, characterized in that, The process of identifying the load based on the real-time power data collected by the edge device according to the third load identification model and outputting the identification result includes: The current and voltage waveform data are collected, and features are extracted from the current and voltage waveform data based on a preset sliding window mechanism to obtain the corresponding original power features. The original power characteristics are normalized to obtain power characteristic data, which is then input into the third load identification model for identification, and the identification result is output.
6. A load identification system based on knowledge distillation, characterized in that, include: Distillation module, quantization module, and optimized identification module; The distillation module is used to transfer the load classification knowledge of the cloud load identification model to the preset original load identification model through knowledge distillation based on the preset cloud load identification model, so as to obtain a first load identification model. The quantization module is used to quantize the first load identification model to obtain a lightweight second load identification model, and then send the second load identification model to the edge device. The optimized identification module is used to send incremental update datasets to the edge device, so that the edge device optimizes the second load identification model according to a preset incremental update algorithm, combined with cross-entropy loss and dynamic constraints of key parameters of historical tasks, to generate a third load identification model. After optimization, the edge device performs load identification on the real-time power data collected by the edge device according to the third load identification model and outputs the identification results. The distillation module includes: a distillation data acquisition unit, a first load identification unit, a first cross-entropy loss calculation unit, a weighted Kullback-Leibler divergence calculation unit, and a first iteration unit; The distillation data acquisition unit is used to acquire a distillation dataset; wherein each load data in the distillation dataset is configured with a corresponding real type label; The first load identification unit is used to identify the load type of the distillation dataset according to the cloud load identification model and output the corresponding first predicted probability distribution; The first cross-entropy loss calculation unit is used to identify the load type of the distillation dataset according to the original load identification model, output the corresponding second predicted probability distribution, and calculate the first cross-entropy loss according to the second predicted probability distribution and the one-heat distribution of the true type label. The weighted Kullback-Leibler divergence calculation unit is used to calculate the corresponding weighted Kullback-Leibler divergence based on the first prediction probability distribution and the second prediction probability distribution. The first iteration unit is used to construct a loss function based on the first cross-entropy loss and the weighted Kullback-Leibler divergence, and to iteratively update the parameters of the original load identification model according to the loss function until the model converges, thereby obtaining the first load identification model; The optimized identification module includes: an incremental data acquisition unit, a second cross-entropy loss calculation unit, a grouping unit, a regularization term construction unit, and a second iteration unit; The incremental data acquisition unit is used to acquire the incremental update dataset; wherein the incremental update dataset includes erroneous sample data obtained by the edge device through load identification of historically collected power data using the second load identification model; The second cross-entropy loss calculation unit is used to infer the incremental update dataset based on the second load identification model and calculate the corresponding second cross-entropy loss. The grouping unit is used to cluster the weight matrix of the fully connected layer of the second load identification model according to the load category to obtain several groups of classification parameters; The regularization term construction unit is used to calculate the corresponding second importance weight based on each group of classification parameters, and to construct MAS regularization terms according to each of the second importance weights. The second iteration unit is used to generate an objective function by weighted fusion of the second cross-entropy loss and the MAS regularization term according to a preset penalty coefficient, and to iteratively update the weight matrix and bias vector of the fully connected layer of the second load identification model according to the objective function until the model converges, thereby obtaining the third load identification model.
7. A knowledge distillation-based load identification device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it implements the steps of the knowledge distillation-based load identification method according to any one of claims 1-5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the knowledge distillation-based load identification method according to any one of claims 1-5.
Citation Information
Patent Citations
Electric power visual knowledge distillation method and system
CN119130711A
Non-intrusive load monitoring method and system based on knowledge distillation algorithm
CN119830999A