TCN-LSTM-based lightweight load decomposition method and device
Through the TCN-LSTM lightweight model, combined with depth separation convolution and expansion convolution, combined with knowledge distillation technology, the problem of high computational complexity of deep learning load decomposition method is solved, and efficient load decomposition in edge computing scenarios is achieved.
Patent Information
- Application Number
- CN202510528992.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-08
AI Technical Summary
The existing non-invasive load decomposition method based on deep learning has high computational complexity and high resource consumption, making it difficult to actually apply in resource-constrained scenarios such as edge computing.
The lightweight load decomposition method based on TCN-LSTM is adopted to replace standard convolution by deep separation convolution and expanding convolution, and combined with knowledge distillation technology, a lightweight model is built to realize the lightweight design of the model structure, and to improve the model performance through knowledge transfer.
While maintaining high decomposition accuracy, it significantly reduces computing complexity and resource consumption, which is suitable for practical applications in edge computing scenarios and improves the efficiency and accuracy of load decomposition.
Smart Images

Figure CN120448727A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power market clearing methods, and in particular relates to a lightweight load decomposition method and device based on TCN-LSTM. Background Art
[0002] With the development of smart grids and user-side energy management, non-intrusive load decomposition (NILM) technology has attracted widespread attention due to its advantages such as low cost and easy deployment. This technology analyzes the total power data at the user end to identify the operating status and power curve of individual electrical devices, providing support for user energy consumption analysis and demand-side management. In practical applications, accurate load decomposition results can help users understand the power consumption behavior of various electrical appliances, provide data support for energy-saving management and power optimization, and are of great significance to improving the efficiency of power grid operation and users' energy-saving awareness. In recent years, with the development of deep learning technology, load decomposition methods based on deep neural networks have gradually become a research hotspot, with better feature extraction capabilities and decomposition accuracy than traditional methods. However, existing deep learning-based NILM methods generally have problems with high computational complexity and high resource consumption, which seriously restricts their practical application in resource-constrained scenarios such as edge computing.
[0003] In response to the above problems, in order to solve the high computational complexity of the existing non-invasive load decomposition method based on deep learning, and to achieve lightweight model while maintaining high decomposition accuracy, the present invention proposes a lightweight load decomposition method based on TCN-LSTM. Summary of the Invention
[0004] To address the problems in the background art, the present invention aims to provide a lightweight load decomposition model based on TCN-LSTM. This model replaces the standard convolution operation in TCN with depthwise separable convolution and combines it with the sequence modeling capabilities of LSTM to achieve a lightweight design of the model structure. Furthermore, knowledge distillation technology is introduced to transfer knowledge from large models to lightweight models, further improving model performance.
[0005] The present invention adopts the following technical solutions:
[0006] A lightweight load decomposition method based on TCN-LSTM, the method comprising the following steps:
[0007] A lightweight load decomposition model based on the temporal convolutional network (TCN) and the long short-term memory (LSTM) network was constructed. The TCN employs depthwise separable convolution, dilated convolution, and residual connections. Dilated convolution improves upon conventional convolution by introducing holes in the receptive field. As the network depth increases, the dilation coefficient increases exponentially by d = 2, and the receptive field expands exponentially. This allows the model to cover a larger field of view with fewer layers, acquiring further historical data while maintaining temporal hierarchy.
[0008] Construct a loss function for the TCN-LSTM lightweight load decomposition model for knowledge distillation, deploy a corresponding pre-trained teacher model, and perform knowledge distillation training on the proposed TCN-LSTM lightweight load decomposition model to obtain a trained lightweight load decomposition model.
[0009] The trained lightweight load decomposition model is used to decompose the user's total power data to obtain the power curve and operating status of each electrical equipment.
[0010] Furthermore, the method for performing knowledge distillation training on the proposed TCN-LSTM lightweight load decomposition model is as follows:
[0011] The output results of the teacher model and the student model are modified, and the temperature parameter T is introduced to soften the output of the teacher model and the student model. In addition, the modified knowledge distillation total loss function is added to the student model. The function of the knowledge distillation total loss function is to measure the degree of fit of the student model to the output of the teacher model. The modified knowledge distillation total loss function consists of two parts. One part is the loss function L of the student model for the real result. CE , loss function L CE It is used to improve the prediction effect of the student model on the real results. The other part is the knowledge distillation loss function L KD , knowledge distillation loss function L KD Used to measure how well the student model learns from the teacher model;
[0012] During the training process, data is input into the teacher model and the student model at the same time. The teacher model outputs a softened prediction result based on the data, and the student model outputs a softened prediction result and an unsoftened prediction result based on the data. The student model then calculates the loss value based on the total loss function of knowledge distillation. Finally, the optimizer is called to minimize the total loss function of the student model and perform stochastic gradient descent iterations on the student model until the loss function drops to a predetermined value or reaches a predetermined number of training rounds.
[0013] Furthermore, the knowledge distillation process is as follows:
[0014] The method of introducing the temperature parameter T to soften the output of the teacher model and the student model is:
[0015]
[0016] Where: p n represents the output probability of the nth category, T is the temperature hyperparameter, x n Represents the output label of the model in the nth output category; It means dividing each category of the model output by the temperature coefficient and then calculating the exponential, and finally summing up all the results.
[0017] Furthermore, the total loss function of the knowledge distillation is:
[0018] L total =αL KD +(1-α)L CE (9)
[0019] Where: L total is the total loss function, L KD is the knowledge distillation loss function, L CE is the hard label loss function, α is the weight coefficient for balancing the two loss functions, α∈[0,1].
[0020] Furthermore, the knowledge distillation loss function L KD The specific form is:
[0021]
[0022] Where: z t represents the logits output of the teacher model, z s represents the logits output of the student model, Soft is the softmax function, KL stands for Kullback-Leibler divergence, which is used to measure the difference between two probability distributions, and T is the temperature hyperparameter.
[0023] Furthermore, the dilated convolution operation formula is:
[0024]
[0025] Where: x is the input sequence; f is the filter; s is the position index; d is the expansion factor; i is the convolution kernel position; k is the convolution kernel size.
[0026] Furthermore, depthwise separable convolution replaces the standard convolution operation and divides the convolution process into two steps. First, channel-by-channel convolution is performed, using an independent convolution kernel for each channel, significantly reducing the number of parameters; then, information fusion between channels is achieved through 1×1 point-by-point convolution.
[0027] A lightweight load decomposition device based on TCN-LSTM, comprising:
[0028] A lightweight load decomposition model construction module is used to build a lightweight load decomposition model based on the temporal convolutional network (TCN) and the long short-term memory (LSTM) network. The temporal convolutional network (TCN) uses depthwise separable convolution, dilated convolution, and residual connections. Dilated convolution improves on ordinary convolution by introducing holes in the receptive field of ordinary convolution. As the network depth increases, the dilation coefficient increases exponentially by d = 2, and the receptive field expands exponentially, thereby covering a larger field of view with fewer layers, obtaining more historical data while maintaining temporal hierarchy.
[0029] The trained lightweight load decomposition model acquisition module is used to construct the loss function of the TCN-LSTM lightweight load decomposition model for knowledge distillation, deploy the corresponding pre-trained teacher model, perform knowledge distillation training on the proposed TCN-LSTM lightweight load decomposition model, and obtain the trained lightweight load decomposition model;
[0030] The power curve and operating status acquisition module of the electrical equipment is used to decompose the user's total power data using the trained lightweight load decomposition model to obtain the power curve and operating status of each electrical equipment.
[0031] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the aforementioned TCN-LSTM-based lightweight load decomposition method.
[0032] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a lightweight load decomposition method based on TCN-LSTM is implemented as described above.
[0033] The beneficial technical effects of the present invention are:
[0034] The present invention significantly reduces the difficulty of edge deployment and inference operation of the load decomposition model by designing a lightweight TCN-LSTM hybrid architecture. The TCN model uses depthwise separable convolution to replace standard convolution operations, and combines the design of different expansion rates to form a receptive field that grows exponentially with the number of layers, significantly reducing the number of parameters while maintaining the ability to effectively capture features at different time scales. The LSTM model effectively processes long-sequence time data through its gating mechanism, compensating for the shortcomings of TCN in modeling long-term dependencies. The combination of the two network structures forms a complementary enhancement effect, enabling the lightweight hybrid model to simultaneously possess efficient feature extraction and long-time series modeling capabilities, thereby improving the accuracy of load decomposition tasks. To further improve the actual deployment and operation efficiency of the lightweight model, the present invention utilizes knowledge distillation technology and a softening processing mechanism adjusted by temperature parameters to enable the lightweight model to learn the rich decision boundary information and inter-class similarity relationships in the large model. This breaks through the limitations of the lightweight model's recognition ability and achieves generalization capabilities close to those of the large model while maintaining low computational complexity. This provides an innovative solution for the practical application of load decomposition technology in resource-constrained scenarios such as edge computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The figure is a flow chart of a lightweight load decomposition method based on TCN-LSTM in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following is a further clear and complete description of a method and device for clearing a power capacity market taking into account flexibility provided by the present invention, with reference to the accompanying drawings:
[0037] Example 1
[0038] like Figure 1 As shown, this embodiment provides a lightweight load decomposition method based on TCN-LSTM, which is as follows:
[0039] S1. Build a lightweight load decomposition model based on the temporal convolutional network (TCN) and the long short-term memory (LSTM) network.
[0040] Among them, the temporal convolutional network TCN adopts depthwise separable convolution, dilated convolution and residual connection; depthwise separable convolution replaces the standard convolution operation and divides the convolution process into two steps. First, channel-by-channel convolution (depthwise convolution) is performed, and each channel uses an independent convolution kernel, which significantly reduces the number of parameters; then, information fusion between channels is achieved through 1×1 pointwise convolution; this design not only maintains the feature extraction capability of the convolution operation, but also greatly reduces the computational complexity; dilated convolution is improved on the basis of ordinary convolution, and a hole is introduced in the receptive field of ordinary convolution, that is, a certain length of input is skipped to expand the receptive field range. As the network depth increases, the dilation coefficient grows exponentially in the form of d=2, and the receptive field expands exponentially, thereby covering a larger field of view with fewer layers, obtaining more distant historical data while maintaining temporal hierarchy. Among them, the dilated convolution operation formula is:
[0041]
[0042] Where: x is the input sequence; f is the filter; s is the position index; d is the expansion factor; i is the convolution kernel position; k is the convolution kernel size.
[0043] Long Short-Term Memory (LSTM) neural networks are a special variant of recurrent neural networks (RNNs). They effectively address the vanishing or exploding gradient problems that can occur during RNN training. LSTMs are particularly well-suited for processing time series data that require consideration of long-term dependencies. The computational process for each LSTM layer is as follows:
[0044] i t =σ(W ii x t +W hi h t-1 +b i ) (2)
[0045] f t =σ(W if x t +W lf h t-1 +b f ) (3)
[0046] g t =tanh(W ig x t +W hg h t-1 +b g ) (4)
[0047] o t=σ(W io x t +W io h t-1 +b o ) (5)
[0048] c t =f t ⊙c t-1 +i t ⊙g t (6)
[0049] h t =o t ⊙tanh(c t ) (7)
[0050] Where: i t 、f t 、o t Represent the states of the input gate, forget gate, and output gate respectively, g t is a candidate memory unit, h t is the hidden state, c t is the unit state; W ii 、W if 、W ig 、W io are the input weight matrices of the input gate, forget gate, candidate unit state, and output gate, respectively. gi ,W lf ,W hg ,W io They are the hidden state weight matrices of the input gate, forget gate, candidate unit state, and output gate, respectively, b i ,b f ,b g ,b i are the bias vectors of the input gate, forget gate, candidate unit state, and output gate respectively; σ is the sigmoid activation function, and ⊙ represents the multiplication of the corresponding elements.
[0051] S2. Construct a loss function for the TCN-LSTM lightweight load decomposition model for knowledge distillation and deploy the corresponding pre-trained teacher model to perform knowledge distillation training on the proposed TCN-LSTM lightweight load decomposition model to improve model accuracy.
[0052] The training process of knowledge distillation mainly includes three prerequisites: teacher model, student model, and knowledge transfer process;
[0053] In this process, the teacher model can be freely selected. Typically, models with large parameters and complex structures are chosen because they generally have better recognition capabilities. However, due to their large parameters and complex structure, these models typically consume more computing resources when running and are not suitable for field deployment on the edge. Therefore, in the knowledge distillation process, they only serve to improve the performance of the student model.
[0054] The student model is usually a lightweight model with a simpler structure and a smaller number of model parameters. In the present invention, the constructed lightweight TCN-LSTM model is the student model. Generally, lightweight model architectures run fast and consume less computing resources. However, due to the small number of model parameters, the model's recognition ability is often very limited. However, since this patent proposes to use the teacher model to improve the recognition accuracy of the lightweight model, after the model knowledge distillation training, the student model can achieve a relatively good recognition effect with a smaller number of parameters.
[0055] The knowledge transfer process mainly includes two stages of tasks. In the first stage, the output results of the teacher model and the student model must be modified first, and the temperature parameter T is introduced to soften the output of the teacher model and the student model to improve the training effect in future training. In addition, the loss function of the student model must be modified and a "knowledge distillation total loss function" is added. The main function of this total loss function is to measure the degree of fit of the student model to the output of the teacher model. The modified student model total loss function consists of two parts. One part is the loss function of the student model for the real result, namely L CE , this part of the loss function is used to improve the prediction effect of the student model for the real results, and the other part is the knowledge distillation loss function, namely L KD This part of the loss function is used to measure the learning of the student model from the teacher model. The two parts together constitute the total loss function L of the student model. total .
[0056] After completing the first phase of the task, that is, the output modification of the teacher model and the student model, and the construction of the loss function of the student model, the second phase of training can be carried out. During the training process, data is input to the teacher model and the student model at the same time. The teacher model outputs a softened prediction result based on the data, and the student model outputs a softened prediction result and an unsoftened prediction result (i.e., a normal prediction result) based on the data. Then the student model calculates the loss value (L) according to its total loss function. CE The loss is calculated using the true results of the data and the normal prediction results of the student model, L KDThe loss is calculated using the softened predictions of the teacher and student models. The total loss function is the sum of the two, with a coefficient α controlling the weight of the two loss function calculations. Finally, the optimizer is called to minimize the total loss function of the student model. Stochastic gradient descent is iterated on the student model until the loss function drops to a predetermined value or the number of training rounds is reached.
[0057] The details are as follows:
[0058] First, the model output is softened by the temperature parameter T:
[0059]
[0060] Where: p n represents the output probability of the nth category, T is the temperature hyperparameter, z n Represents the output label of the model in the nth output category (the output label is the logits output); It means dividing each category of the model output by the temperature coefficient and then finding the exponent, and finally summing up all the results. The subscript m mainly serves as a summation index in this process.
[0061] Knowledge transfer is achieved by optimizing the following loss function:
[0062] L total =αL KD +(1-α)L CE (9)
[0063] Where: L total is the total loss function, L KD is the knowledge distillation loss function, L CE is the hard label loss function, α is the weight coefficient for balancing the two loss functions, α∈[0,1];
[0064] Knowledge distillation loss function L KD The specific form is:
[0065]
[0066] Where: z t represents the logits output of the teacher model, z s represents the logits output of the student model, Soft is the softmax function, KL stands for Kullback-Leibler divergence, which is used to measure the difference between two probability distributions, and T is the temperature hyperparameter.
[0067] The trained lightweight load decomposition model is used to decompose the user's total power data and output the power curve and operating status of each electrical equipment.
[0068] As an example, in this embodiment, to comprehensively evaluate the performance of the proposed method, four evaluation indicators are used: Mean Absolute Error (MAE), Mean Relative Error (MRE), Accuracy (Acc), and F1-score. The calculation formulas for each indicator are as follows:
[0069] (1) Mean absolute error (MAE):
[0070]
[0071] (2) Mean relative error (MRE):
[0072]
[0073] Where: a is the number of samples, y b is the actual power value of the appliance at time b, The model predicts the power value of the appliance at time b;
[0074] (3) Accuracy
[0075]
[0076] Where: TP (True Positive) represents the number of samples that correctly predict the device is on, TN (True Negative) represents the number of samples that correctly predict the device is off, FP (False Positive) represents the number of samples that incorrectly predict the device is on, and FN (False Negative) represents the number of samples that incorrectly predict the device is off.
[0077] (4) F1 score
[0078]
[0079] Where: Precision is the accuracy rate, which measures the proportion of samples predicted by the model as "on" that are actually "on"; Recall is the recall rate, which measures the proportion of samples that are actually "on" that are correctly identified by the model; F1 score is the harmonic mean of precision and recall, which is used to evaluate the overall performance of the model in identifying device status.
[0080] To verify the effectiveness of the proposed improved model, this example selected a regularized bidirectional GRU, a regularized bidirectional LSTM (GRU, LSTM), and a sequence-to-sequence model (Seq2seq) as comparison objects. To ensure experimental fairness, all models used the same training configuration and were tested on an untrained home appliance dataset. Table 1 shows the performance metrics of each model on the dataset, with higher accuracy and F1 score being preferred, while lower MRE and MAE are preferred.
[0081] Table 1 Comparison of model performance indicators
[0082]
[0083] As shown in Table 1, the TCN-LSTM model proposed in this example exhibits different performance characteristics on different types of household appliances. For appliances with distinct on / off features, such as kettles, the TCN-LSTM model performs best, outperforming the comparison model in all metrics. In the load decomposition task of a washing machine, the TCN-LSTM model demonstrates relatively stable performance. While slightly inferior to the Seq2seq model in some individual metrics, the model performs well overall, demonstrating that it achieves lightweight while maintaining high performance.
[0084] In addition to model performance accuracy, to comprehensively evaluate the practicality of the proposed model, this example further compares the Transformer, lightweight TCN-LSTM, and LSTM models in terms of model parameter count, model file size, training time, and inference time. Training time is measured based on the kettle load training data in the dataset, while inference time is measured based on the kettle load test data.
[0085] Table 2 Comparison of model parameters and time
[0086] Model Parameter quantity Model file size Training time Inference time Transformer 2 million 15.6MB 10 minutes and 31 seconds 16 seconds TCN-LSTM 33,500 0.28MB 1 minute 18 seconds 7 seconds LSTM 1.3 million 9.67MB 11 minutes and 10 seconds 15 seconds
[0087] As shown in Table 2, the lightweight TCN-LSTM model proposed in this embodiment has significant advantages in terms of lightweightness compared to the Transformer and LSTM models. The model has only 33,500 parameters, far fewer than the 2 million in the Transformer and 1.3 million in the LSTM. The model file size only takes up 0.28MB of storage space, a 98.2% and 97.1% reduction compared to the Transformer and LSTM, respectively. In terms of training efficiency, the TCN-LSTM completes training in just 1 minute and 18 seconds, significantly reducing training time. During the inference phase, the model can complete the load decomposition task in 7 seconds, more than doubling the inference speed compared to the comparison model. These results fully demonstrate the lightweight effect and practical value of the proposed model.
[0088] In summary, the lightweight TCN-LSTM model proposed in this paper has achieved good results in both performance and practicality. In terms of model performance, it shows a relatively stable decomposition effect for different types of household appliances. In particular, for devices with obvious switching characteristics, the model performance surpasses existing methods. In terms of model lightweighting, the application of technologies such as depthwise separable convolution significantly reduces the number of model parameters and storage space, while achieving faster training and inference speeds. Experimental results show that while ensuring load decomposition performance, the model successfully achieves the goal of model lightweighting, making it more suitable for deployment and application in real-world scenarios.
[0089] Example 2
[0090] This embodiment provides a lightweight load decomposition device based on TCN-LSTM, including:
[0091] A lightweight load decomposition model construction module is used to build a lightweight load decomposition model based on the temporal convolutional network (TCN) and the long short-term memory (LSTM) network. The temporal convolutional network (TCN) uses depthwise separable convolution, dilated convolution, and residual connections. Dilated convolution improves on ordinary convolution by introducing holes in the receptive field of ordinary convolution. As the network depth increases, the dilation coefficient increases exponentially by d = 2, and the receptive field expands exponentially, thereby covering a larger field of view with fewer layers, obtaining more historical data while maintaining temporal hierarchy.
[0092] The trained lightweight load decomposition model acquisition module is used to construct the loss function of the TCN-LSTM lightweight load decomposition model for knowledge distillation, deploy the corresponding pre-trained teacher model, perform knowledge distillation training on the proposed TCN-LSTM lightweight load decomposition model, and obtain the trained lightweight load decomposition model;
[0093] The power curve and operating status acquisition module of the electrical equipment is used to decompose the user's total power data using the trained lightweight load decomposition model to obtain the power curve and operating status of each electrical equipment.
[0094] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the aforementioned TCN-LSTM-based lightweight load decomposition method.
[0095] Furthermore, the present invention adopts the following technical solutions:
[0096] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a lightweight load decomposition method based on TCN-LSTM as described above is implemented.
[0097] Through the description of the above embodiments, it will be clear to those skilled in the art that the facilities of the present invention can be implemented by means of software plus the necessary general hardware platform. The embodiments of the present invention can be implemented using existing processors, or by a dedicated processor used for this or other purposes for an appropriate system, or by a hard-wired system. The embodiments of the present invention also include non-transitory computer-readable storage media, which include machine-readable media for carrying or having machine-executable instructions or data structures stored thereon; such machine-readable media can be any available medium that can be accessed by a general-purpose or special-purpose computer or other machine with a processor. For example, such machine-readable media can include RAM, ROM, EPROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store the required program code in the form of machine-executable instructions or data structures and can be accessed by a general-purpose or special-purpose computer or other machine with a processor. When information is transmitted or provided to a machine via a network or other communication connection (hard-wired, wireless, or a combination of hard-wired and wireless), the connection is also considered a machine-readable medium.
[0098] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.
Claims
1. A lightweight load decomposition method based on TCN-LSTM, characterized in that: The method comprises the following steps: A lightweight load decomposition model based on the temporal convolutional network (TCN) and the long short-term memory (LSTM) network was constructed. The TCN employs depthwise separable convolution, dilated convolution, and residual connections. Dilated convolution improves upon conventional convolution by introducing holes in the receptive field. As the network depth increases, the dilation coefficient increases exponentially by d = 2, and the receptive field expands exponentially. This allows the model to cover a larger field of view with fewer layers, acquiring further historical data while maintaining temporal hierarchy. Construct a loss function for the TCN-LSTM lightweight load decomposition model for knowledge distillation, deploy a corresponding pre-trained teacher model, and perform knowledge distillation training on the proposed TCN-LSTM lightweight load decomposition model to obtain a trained lightweight load decomposition model. The trained lightweight load decomposition model is used to decompose the user's total power data to obtain the power curve and operating status of each electrical equipment.
2. A lightweight load decomposition method based on TCN-LSTM according to claim 1, characterized in that: The method for performing knowledge distillation training on the proposed TCN-LSTM lightweight load decomposition model is as follows: The output results of the teacher model and the student model are modified, and the temperature parameter T is introduced to soften the output of the teacher model and the student model. In addition, the modified knowledge distillation total loss function is added to the student model. The function of the knowledge distillation total loss function is to measure the degree of fit of the student model to the output of the teacher model. The modified knowledge distillation total loss function consists of two parts. One part is the loss function L of the student model for the real result. CE , loss function L CE It is used to improve the prediction effect of the student model on the real results. The other part is the knowledge distillation loss function L KD , knowledge distillation loss function L KD Used to measure how well the student model learns from the teacher model; During the training process, data is input into the teacher model and the student model at the same time. The teacher model outputs a softened prediction result based on the data, and the student model outputs a softened prediction result and an unsoftened prediction result based on the data. The student model then calculates the loss value based on the total loss function of knowledge distillation. Finally, the optimizer is called to minimize the total loss function of the student model and perform stochastic gradient descent iterations on the student model until the loss function drops to a predetermined value or reaches a predetermined number of training rounds.
3. The lightweight load decomposition method based on TCN-LSTM according to claim 2 is characterized in that: in, The knowledge distillation process is as follows: The method of introducing the temperature parameter T to soften the output of the teacher model and the student model is: Where: p n represents the output probability of the nth category, T is the temperature hyperparameter, z n Represents the output label of the model in the nth output category; It means dividing each category of the model output by the temperature coefficient and then calculating the exponential, and finally summing up all the results.
4. The lightweight load decomposition method based on TCN-LSTM according to claim 2 is characterized in that: The total loss function of the knowledge distillation is: L total =αL KD +(1-α)L CE (9) Where: L total is the total loss function, L KD is the knowledge distillation loss function, L CE is the hard label loss function, α is the weight coefficient for balancing the two loss functions, α∈[0,1].
5. The lightweight load decomposition method based on TCN-LSTM according to claim 4 is characterized in that: Knowledge distillation loss function L KD The specific form is: Where: z t represents the logits output of the teacher model, z s represents the logits output of the student model, Soft is the softmax function, KL stands for Kullback-Leibler divergence, which is used to measure the difference between two probability distributions, and T is the temperature hyperparameter.
6. The lightweight load decomposition method based on TCN-LSTM according to claim 2 is characterized in that: in, The expansion convolution operation formula is: Where: x is the input sequence; f is the filter; s is the position index; d is the expansion factor; i is the convolution kernel position; k is the convolution kernel size.
7. The lightweight load decomposition method based on TCN-LSTM according to claim 1 is characterized in that: Depthwise separable convolution replaces the standard convolution operation and divides the convolution process into two steps. First, channel-by-channel convolution is performed, using an independent convolution kernel for each channel, significantly reducing the number of parameters; then, information fusion between channels is achieved through 1×1 point-by-point convolution.
8. A lightweight load decomposition device based on TCN-LSTM, characterized in that: include: A lightweight load decomposition model construction module is used to build a lightweight load decomposition model based on the temporal convolutional network (TCN) and the long short-term memory (LSTM) network. The temporal convolutional network (TCN) uses depthwise separable convolution, dilated convolution, and residual connections. Dilated convolution improves on ordinary convolution by introducing holes in the receptive field of ordinary convolution. As the network depth increases, the dilation coefficient increases exponentially by d = 2, and the receptive field expands exponentially, thereby covering a larger field of view with fewer layers, obtaining more historical data while maintaining temporal hierarchy. The trained lightweight load decomposition model acquisition module is used to construct the loss function of the TCN-LSTM lightweight load decomposition model for knowledge distillation, deploy the corresponding pre-trained teacher model, perform knowledge distillation training on the proposed TCN-LSTM lightweight load decomposition model, and obtain the trained lightweight load decomposition model; The power curve and operating status acquisition module of the electrical equipment is used to decompose the user's total power data using the trained lightweight load decomposition model to obtain the power curve and operating status of each electrical equipment.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements a lightweight load decomposition method based on TCN-LSTM as described in any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements a lightweight load decomposition method based on TCN-LSTM as described in any one of claims 1 to 7.