Micro-grid user load modeling method and system based on deep transfer learning

By adopting an improved deep transfer learning method in microgrid load modeling, including an improved deep convolutional neural network and dual attention mechanism, combined with field adaptation loss and incremental learning optimization, the problems of scarcity of data and poor domain adaptability are solved, and more efficient load prediction and stability are achieved.

CN120184915APending Publication Date: 2025-06-20BENXI POWER SUPPLY COMPANY OF STATE GRID LIAONINGELECTRIC POWER SUPPLY +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510251637.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing deep transfer learning methods face the problems of scarce data, poor field adaptability and overfitting in microgrid load modeling, resulting in insufficient training stability and generalization capabilities of the model.

Method used

A microgrid user load modeling method based on deep transfer learning is adopted, and feature extraction is performed through improved deep convolutional neural networks, a dual attention mechanism is introduced to optimize feature selection, and a load prediction model is constructed in combination with technologies such as field adaptation loss, incremental learning optimization and knowledge distillation.

Benefits of technology

It effectively solves the problems of scarcity of data and poor field adaptability, improves the accuracy and stability of load prediction, enhances the adaptability of the model, and can more reliably support the intelligent scheduling and load management of the microgrid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120184915A_ABST
    Figure CN120184915A_ABST
Patent Text Reader

Abstract

The invention discloses a micro-grid user load modeling method and system based on deep transfer learning, and relates to the technical field of smart grids, and the method comprises the steps: collecting micro-grid user data, and carrying out the data preprocessing and initialization; carrying out source domain pre-training, and constructing a deep transfer learning framework; carrying out feature extraction by using an improved deep convolutional neural network; carrying out domain adaptation loss calculation, introducing a dual attention mechanism, and constructing a load prediction model; and incremental learning optimization is set, and the strategy is optimized through an improved algorithm. According to the method, technologies such as field adaptation loss, incremental learning optimization and knowledge distillation are combined, and the problems of data scarcity, poor field adaptability and over-fitting in the prior art are effectively solved. According to the method, effective knowledge migration between the source domain and the target domain can be realized through the migration learning framework, the precision and the stability of load prediction are improved, and the method has relatively high adaptability when new data and changing scenes are processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart grids, and particularly to a microgrid user load modeling method and system based on deep transfer learning. Background Art

[0002] With the rapid development of smart grid and microgrid technologies, the importance of microgrids in modern power systems has become increasingly prominent. Microgrids can operate independently or interconnected with the main grid, with flexibility and reliability. In the operation and management of microgrids, accurate user load modeling and prediction are key factors to ensure power dispatching and safe and stable operation. Traditional load forecasting methods mainly rely on statistical analysis of historical data, usually based on time series data models or physical model-based methods. Although these methods can provide certain forecasting capabilities, they have many limitations. First, these methods rely on a large amount of historical data for modeling, and when new scenarios appear or data is scarce, the forecasting accuracy often drops significantly. Second, traditional models have poor adaptability to system complexity and non-linear characteristics, and it is difficult to capture the dynamic changes and complex interactions of loads in microgrids.

[0003] In recent years, the development of deep learning technologies has provided more powerful tools for load forecasting. Models such as deep neural networks (DNN), convolutional neural networks (CNN), and recurrent neural networks (RNN) perform well in feature extraction and pattern recognition, and can handle high-dimensional and complex input data. However, existing deep learning methods face some key problems in microgrid load modeling. First, deep learning models usually require a large amount of labeled data for effective training, but in the actual application of microgrids, data is often scarce, and there may be differences in data distributions between different microgrids. Second, due to the high complexity of deep neural networks, it is easy to overfit in the case of insufficient data or data inconsistency, resulting in poor generalization ability of the model. To address these challenges, transfer learning technologies have gradually become an effective means to solve the problems of data scarcity and distribution differences in recent years. Summary of the Invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the technical problem solved by the present invention is that the application of existing deep transfer learning methods in microgrid load modeling still faces some challenges. An efficient optimization strategy is still needed during the dynamic adjustment process to improve the training stability and generalization ability of the model.

[0006] To solve the above technical problems, the present invention provides the following technical solution: A microgrid user load modeling method based on deep transfer learning, including

[0007] Collect microgrid user data and perform data preprocessing and initialization;

[0008] Conduct source domain pre-training to construct a deep transfer learning framework;

[0009] Use an improved deep convolutional neural network for feature extraction;

[0010] Calculate the domain adaptation loss, introduce a dual attention mechanism, and construct a load forecasting model;

[0011] Set incremental learning optimization and optimize the strategy through an improved algorithm.

[0012] As a preferred solution of the microgrid user load modeling method based on deep transfer learning described in the present invention, wherein: the construction of the deep transfer learning framework includes that the designed network structure contains three key components. The feature extraction layer is used to learn the deep representation of the data, the domain adaptation layer is used to ensure the domain invariance of the features, and the task learning layer is used for specific prediction tasks;

[0013] The loss function formula is expressed as:

[0014] L = λ1L c + λ2L d + λ3L t

[0015] wherein, L c represents the classification loss, and the cross-entropy loss is adopted for the supervised learning task; L d represents the domain adaptation loss to ensure the consistency of the feature distributions in the source domain and the target domain; L t represents the task-specific loss for the special requirements of the load forecasting task; λ1, λ2, and λ3 represent the weight coefficients, which are dynamically adjusted through the validation set to balance the importance of each task.

[0016] As a preferred solution of the microgrid user load modeling method based on deep transfer learning described in the present invention, wherein: the feature extraction includes that the feature extraction module adopts an improved deep convolutional neural network, which contains multiple convolutional layers, pooling layers, and batch normalization layers;

[0017] The feature extraction process formula is expressed as:

[0018] h(x) = σ(W * x + b)

[0019] wherein, x represents the input data, W represents the convolutional kernel parameters, b represents the bias term, and σ represents the activation function; the residual connection structure is adopted, and a batch normalization layer is added after each convolutional layer; an improved MMD metric is introduced to reduce the distribution difference between the source domain and the target domain:

[0020]

[0021] Among them, X s , X t respectively represent the source domain and target domain data, and n s , n t represents the number of samples.

[0022] As a preferred solution of the microgrid user load modeling method based on deep transfer learning according to the present invention, wherein: the domain adaptation loss calculation includes that the domain adaptation layer adopts an adversarial learning strategy, and realizes the domain invariance of features through the adversarial training of the domain classifier and the feature extractor. The domain adaptation loss function is defined as:

[0023]

[0024] Among them, G f represents the feature extractor, and G d represents the domain classifier, and d i represents the domain label;

[0025] To improve the training stability, a gradient reversal layer and a feature regularization term are introduced; the feature extractor and the domain classifier achieve Nash equilibrium through alternating optimization.

[0026] As a preferred solution of the microgrid user load modeling method based on deep transfer learning according to the present invention, wherein: the construction of the load prediction model includes that the goal of the source domain pre-training stage is to make full use of the source domain data to establish a basic model, and construct a deep neural network basic structure including a feature extraction layer, a domain adaptation layer and a task learning layer; calculate the feature representation through forward propagation, and construct a pre-training loss function by combining the classification loss and the regularization term;

[0027] Based on the transferred feature representation, construct a multi-layer perceptron for load prediction, and the formula is expressed as:

[0028] y = f(W (L) h (L-1) (x) + b (L) )

[0029] The prediction error is evaluated by the root mean square error (RMSE):

[0030]

[0031] Among them, yi represents the actual value, represents the predicted value;

[0032] The Adam optimizer is used in the training process to achieve fast convergence by dynamically adjusting the learning rate; at this stage, the performance of the model on the source domain data is mainly concerned, and the model performance is evaluated through the validation set, and the network structure and hyperparameters are adjusted in time.

[0033] As a preferred solution of the microgrid user load modeling method based on deep transfer learning according to the present invention, wherein: the setting of incremental learning optimization includes an incremental learning optimization stage. To enable the model to have the ability of continuous learning, an incremental learning mechanism based on elastic weight consolidation is designed; the importance of parameters is evaluated through the Fisher information matrix, and the memory of existing knowledge is maintained while learning new knowledge;

[0034] The knowledge distillation module adjusts the softness of the soft label through temperature regulation, and the distillation loss function formula is expressed as:

[0035]

[0036] wherein, zs and zt respectively represent the outputs of the teacher model and the student model, T represents the temperature parameter, and KL represents the divergence; an adaptive temperature regulation mechanism is introduced:

[0037]

[0038] The incremental learning process is progressive. After receiving new data each time, the model updates the parameters. During the update process, the importance of the parameters is considered to protect the key parameters; an experience replay mechanism is adopted to maintain partial memory of the historical data; the network parameters are initialized using the He initialization method, and the parameters of the batch normalization layer are independently initialized to further improve the training efficiency.

[0039] As a preferred solution of the microgrid user load modeling method based on deep transfer learning according to the present invention, wherein: the optimization strategy through the improved algorithm includes processing the source domain and target domain data, and obtaining the deep feature representation through the feature extractor; to reduce the inter-domain difference, a dual domain adaptation mechanism based on the maximum mean difference and adversarial learning is designed;

[0040] A dual attention mechanism is introduced during the feature selection process, including two dimensions of channel attention and spatial attention, which can adaptively select the most relevant features. Through the combination of multiple loss functions, including classification loss, domain adaptation loss, task-specific loss, and knowledge distillation loss, the comprehensive optimization of the model is realized;

[0041] The parameter adjustment adopts a dynamic optimization strategy, including two aspects of weight coefficient update and learning rate adjustment; the update of the weight coefficient considers the historical gradient information, and the parameter change is smoothed through the momentum term; the learning rate adopts an adaptive adjustment strategy and is dynamically adjusted according to the change of the loss function;

[0042] Introduce a gradient clipping mechanism and design an early stopping strategy. When the performance on the validation set does not improve for multiple consecutive rounds, stop training in a timely manner. In the evaluation stage, adopt a multi-dimensional evaluation system, including multiple indicators such as root mean square error, mean absolute percentage error, and coefficient of determination, to comprehensively evaluate the model performance. Ensure the reliability of the evaluation results through cross-validation and set the model convergence judgment criterion.

[0043] As a preferred solution of the microgrid user load modeling system based on deep transfer learning described in the present invention, wherein: the data preprocessing module is responsible for data normalization, data augmentation, and model initialization;

[0044] The transfer learning and domain adaptation module is used to realize knowledge transfer between the source domain and the target domain, and perform transfer learning through the feature extraction, domain adaptation, and task learning layers in the deep transfer learning framework; it includes an adversarial training mechanism to ensure the domain invariance of features;

[0045] The load prediction module, based on the transferred feature representation, uses a multi-layer perceptron for load prediction, and combines an incremental learning method to ensure the model's ability to continuously learn new knowledge while avoiding catastrophic forgetting;

[0046] The adaptive adjustment module optimizes the model structure through knowledge distillation and utilizes the knowledge transfer between the teacher model and the student model; it combines an adaptive adjustment mechanism to ensure the stability of the model during the continuous learning process.

[0047] A computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the microgrid user load modeling method based on deep transfer learning are implemented.

[0048] A computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the microgrid user load modeling method based on deep transfer learning are implemented.

[0049] The beneficial effects of the present invention: The microgrid user load modeling method based on deep transfer learning provided by the present invention uses an improved deep convolutional neural network for feature extraction, adopts a dual attention mechanism to optimize feature selection, and combines technologies such as domain adaptation loss, incremental learning optimization, and knowledge distillation to effectively solve problems such as data scarcity, poor domain adaptability, and overfitting in the prior art. The present invention can achieve effective knowledge transfer between the source domain and the target domain through the transfer learning framework, improve the accuracy and stability of load prediction, and has strong adaptability when dealing with new data and changing scenarios, and can provide more reliable technical support for the intelligent scheduling and load management of the microgrid. Brief Description of the Drawings

[0050] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0051] Figure 1 It is the overall flowchart of a method for modeling the load of microgrid users based on deep transfer learning provided by the first embodiment of the present invention.

[0052] Figure 2 It is the schematic diagram of the algorithm flow of a method for modeling the load of microgrid users based on deep transfer learning provided by the first embodiment of the present invention. Detailed implementation manners

[0053] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will make a detailed description of the specific implementation manners of the present invention in conjunction with the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.

[0054] Example 1, referring to Figure 1 - Figure 2 This is an embodiment of the present invention, which provides a method for modeling the load of microgrid users based on deep transfer learning, including:

[0055] S1: Collect microgrid user data and perform data preprocessing and initialization.

[0056] Furthermore, as Figure 1 shown, user load data: Collect historical data related to power consumption, load demand, etc. from the microgrid user side. The data should cover multiple time periods, usually including hourly, daily, and monthly data, in order to capture the long-term and short-term characteristics of load changes. Environmental data: Collect external factors that may affect load demand, such as meteorological data (temperature, humidity, wind speed, etc.), seasonal information, and holiday arrangements. Equipment data: Include the status data of the internal equipment of the microgrid, such as the state of battery energy storage, the operation of generators, and the load of transformers. Communication data: Real-time collect the operation data of the microgrid through sensors, smart metering instruments, and other monitoring devices.

[0057] Furthermore, for data integrity and accuracy checks, check for missing data: Check for missing values in the collected data, identify the time periods or fields with missing values, and adopt appropriate filling strategies such as mean filling, interpolation, or filling methods based on similar time periods. Use statistical methods or machine learning algorithms to detect outliers in the data and correct or delete the abnormal data to ensure data accuracy. Through correlation analysis across multiple data sources (such as user load and environmental data), ensure the consistency of various data in terms of time and space.

[0058] Furthermore, for data preprocessing, denoising processing: Reduce the noise in the data through methods such as filters and smoothing techniques to ensure the stability of the data during model training. Common denoising methods include median filtering, wavelet transform, etc. Select appropriate missing value filling methods according to the characteristics and missing patterns of the data. For time series data, interpolation methods can be used to fill in the missing values, or more complex methods such as the K-nearest neighbor algorithm can be used to fill. Standardize or normalize each item of data to make the data distribution meet the requirements of the training model. For example, convert the data into a standard normal distribution with zero mean and unit variance, or scale the data to the [0,1] interval. Standardization can reduce the adverse effects of features with different dimensions on model training.

[0059] It should be noted that during the process of collecting microgrid user data, it is necessary to ensure the integrity, accuracy, and real-time nature of the data. In addition, the preprocessing stage includes steps such as denoising, missing value filling, and standardization to ensure that the data is suitable for the subsequent modeling process. During the initialization process, the feature distribution of the data should be considered, and appropriate preprocessing methods should be selected to lay the foundation for the training of the deep learning model.

[0060] S2: Conduct source domain pre-training and construct a deep transfer learning framework.

[0061] Further, as Figure 2 shown, constructing a deep transfer learning framework includes that the designed network structure contains three key components. The feature extraction layer is used to learn the deep representation of the data, the domain adaptation layer is used to ensure the domain invariance of the features, and the task learning layer is used for specific prediction tasks.

[0062] The loss function formula is expressed as:

[0063] L = λ1L c + λ2L d + λ3L t

[0064] where L c represents the classification loss, and the cross-entropy loss is adopted for the supervised learning task; L d represents the domain adaptation loss to ensure the consistency of the feature distributions in the source domain and the target domain; L tRepresents the task-specific loss, addressing the special requirements of the load forecasting task.

[0065] It should be noted that λ1, λ2, and λ3 represent weight coefficients, which are dynamically adjusted through the validation set to balance the importance of each task.

[0066] S3: Use the improved deep convolutional neural network for feature extraction.

[0067] Furthermore, the feature extraction includes that the feature extraction module uses an improved deep convolutional neural network, which contains multiple convolutional layers, pooling layers, and batch normalization layers.

[0068] The feature extraction process is represented by the formula:

[0069] h(x) = σ(W * x + b)

[0070] Where x represents the input data, W represents the convolutional kernel parameters, b represents the bias term, and σ represents the activation function; a residual connection structure is adopted, and a batch normalization layer is added after each convolutional layer; an improved MMD metric is introduced to reduce the distribution difference between the source domain and the target domain:

[0071]

[0072] Where X s , X t represent the source domain and target domain data respectively, and n s , n t represent the number of samples..

[0073] It should be noted that in the source domain pre-training stage, the design of the constructed deep transfer learning framework should focus on the similarities and differences between the source domain and the target domain. The source domain data provides rich training information, but the target domain data may face challenges such as data scarcity or domain differences. By using the source domain data in the pre-training stage, the constructed model can provide a preliminary knowledge transfer basis for the learning of the target domain. In the network structure, the design of each component should be optimized according to the requirements of different tasks to balance the effectiveness of feature extraction, domain adaptation, and prediction tasks.

[0074] S4: Calculate the domain adaptation loss, introduce a dual attention mechanism, and construct a load forecasting model.

[0075] Furthermore, the domain adaptation loss calculation includes that the domain adaptation layer adopts an adversarial learning strategy to achieve the domain invariance of features through the adversarial training of the domain classifier and the feature extractor. The domain adaptation loss function is defined as:

[0076]

[0077] Where G fDenote the feature extractor as G d Denote the domain classifier as d i Denote the domain label;

[0078] Furthermore, to improve the training stability, a gradient reversal layer and a feature regularization term are introduced; the feature extractor and the domain classifier achieve Nash equilibrium through alternating optimization.

[0079] Furthermore, the construction of the load prediction model includes that the goal of the source domain pre-training stage is to fully utilize the source domain data to establish a basic model, and a deep neural network basic structure including a feature extraction layer, a domain adaptation layer, and a task learning layer is constructed; the feature representation is calculated through forward propagation, and the pre-training loss function is constructed by combining the classification loss and the regularization term.

[0080] Furthermore, for feature selection and optimization, the attention mechanism helps the model focus on the most relevant features, and a dual attention mechanism is designed, including channel attention and spatial attention:

[0081] α channel = softmax(W α h + b α )

[0082] α spatial = sigmoid(W s [GAP(h) || GMP(h)])

[0083] Feature fusion process:

[0084] h′ = α channel ⊙ α spatial ⊙ h

[0085] where α is the attention weight, and ⊙ represents element-wise multiplication.

[0086] Furthermore, for parameter adaptive adjustment, a gradient-based adaptive adjustment strategy is adopted, and historical gradient information is also considered:

[0087]

[0088] where μ is the adjustment step size, i = 1, 2, 3 represent the weights of different loss terms, and m t is the exponential moving average of the historical gradient.

[0089]

[0090] For transfer-based feature representation, a multi-layer perceptron is constructed for load prediction, and the formula is expressed as:

[0091] y = f(W (L) h (L-1) (x) + b(L) )

[0092] The prediction error is evaluated using the root mean square error (RMSE):

[0093]

[0094] where yi represents the actual value, represents the predicted value;

[0095] Furthermore, the Adam optimizer is used in the training process to achieve fast convergence by dynamically adjusting the learning rate; at this stage, the performance of the model on the source domain data is focused on, and the model performance is evaluated through the validation set, and the network structure and hyperparameters are adjusted in a timely manner.

[0096] Furthermore, for the model evaluation index system, a multi-dimensional evaluation system is constructed, including the mean absolute error and the mean absolute percentage error:

[0097]

[0098] At the same time, a new evaluation index is introduced:

[0099]

[0100] The adjusted prediction deviation:

[0101]

[0102] To improve the model performance, the following optimization strategies are introduced:

[0103] Adaptive adjustment of the learning rate:

[0104]

[0105] Gradient clipping mechanism:

[0106]

[0107] Decision criterion for the early stopping strategy:

[0108]

[0109] It should be noted that in the feature extraction module, the feature representation ability is enhanced through an improved deep convolutional neural network. Especially when dealing with microgrid load data, the design of the convolutional layer should be optimized according to the time characteristics and spatial characteristics of the data. The application of the residual connection structure and the batch normalization layer can improve the training stability of the network, avoid the problem of gradient disappearance or explosion, and at the same time speed up the training speed. The improved maximum mean discrepancy (MMD) metric method can effectively reduce the distribution difference between the source domain and the target domain, thereby enhancing the effect of transfer learning.

[0110] S5: Set incremental learning optimization and optimize the strategy through an improved algorithm.

[0111] Furthermore, the design of the incremental learning module aims to enable the model to continuously learn from new data while maintaining the memory of historical knowledge. The Elastic Weight Consolidation (EWC) method is adopted to evaluate the importance of parameters through the Fisher information matrix, and the optimized model is:

[0112] W (t+1) = W (t) - η(▽L(W (t) ) + λ EWC F(W (t) - W * ))

[0113] where η is the learning rate, L is the loss function, F is the Fisher information matrix, W * is the historical optimal parameter, and λ EWC is the balance parameter. This way not only ensures the model's learning ability for new knowledge but also prevents catastrophic forgetting.

[0114] Step 1, data preprocessing and initialization stage. In the data preprocessing stage, the original data of the source domain and the target domain are comprehensively processed. The Z-score normalization method is adopted to convert all feature data into a standard normal distribution to eliminate the dimension difference. To enhance the robustness of the model, Gaussian noise is introduced for data augmentation to expand the training sample set.

[0115] The network parameters are initialized using the He initialization method. This method is suitable for deep neural networks and can effectively prevent the problems of gradient disappearance and gradient explosion, ensuring the stability of network training. At the same time, the parameters of the batch normalization layer are independently initialized to further improve the training efficiency.

[0116] Step 2, source domain pre-training stage. The main goal of the source domain pre-training stage is to fully utilize the source domain data to establish a basic model. A deep neural network basic structure including a feature extraction layer, a domain adaptation layer, and a task learning layer is constructed. The feature representation is calculated through forward propagation, and the pre-training loss function is constructed by combining the classification loss and the regularization term.

[0117] The Adam optimizer is used in the training process to achieve fast convergence by dynamically adjusting the learning rate. In this stage, focus on the performance of the model on the source domain data, evaluate the model performance through the validation set, and adjust the network structure and hyperparameters in a timely manner.

[0118] Step 3, Transfer Learning Phase. Transfer learning is the core part of the algorithm, mainly realizing the transfer of knowledge from the source domain to the target domain. It processes the data of both the source domain and the target domain simultaneously, and obtains deep feature representations through a feature extractor. To reduce the domain difference, a dual domain adaptation mechanism based on maximum mean discrepancy and adversarial learning is designed.

[0119] During the feature selection process, a dual attention mechanism is introduced, including two dimensions: channel attention and spatial attention, which can adaptively select the most relevant features. Through the combination of multiple loss functions, including classification loss, domain adaptation loss, task-specific loss, and knowledge distillation loss, the comprehensive optimization of the model is achieved.

[0120] Step 4, Incremental Learning Optimization Phase. To enable the model to have the ability of continuous learning, an incremental learning mechanism based on elastic weight consolidation is designed. The importance of parameters is evaluated through the Fisher information matrix, and while learning new knowledge, the memory of existing knowledge is maintained. This mechanism effectively prevents the problem of catastrophic forgetting.

[0121] The incremental learning process is progressive. After receiving new data each time, the model updates the parameters. During the update process, the importance of the parameters is considered to protect the key parameters. At the same time, an experience replay mechanism is adopted to maintain partial memory of the historical data.

[0122] Step 5, Adaptive Parameter Adjustment Phase. The parameter adjustment adopts a dynamic optimization strategy, including two aspects: weight coefficient update and learning rate adjustment. The update of the weight coefficient considers the historical gradient information, and smooths the parameter changes through the momentum term. The learning rate adopts an adaptive adjustment strategy and is dynamically adjusted according to the change of the loss function.

[0123] To prevent gradient explosion, a gradient clipping mechanism is introduced. At the same time, an early stopping strategy is designed. When the performance of the validation set has not improved for multiple consecutive rounds, the training is stopped in time to avoid overfitting.

[0124] Step 6, Model Evaluation and Validation Phase. In the evaluation phase, a multi-dimensional evaluation system is adopted, including multiple indicators such as root mean square error, mean absolute percentage error, and coefficient of determination, to comprehensively evaluate the model performance. The reliability of the evaluation results is ensured through cross-validation, and a model convergence judgment criterion is set.

[0125] It should be noted that during the model training process, various evaluation indicators are continuously monitored. When the evaluation indicators reach the preset threshold or there is no obvious improvement in multiple consecutive rounds of evaluation, the model training is completed. The finally output model not only has accurate load prediction ability, but also has good generalization ability and continuous learning ability.

[0126] Example 2, an embodiment of the present invention, provides a method for modeling the load of microgrid users based on deep transfer learning. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0127] First of all, this study uses MATLAB R2023a for algorithm simulation verification and conducts experiments based on the load data of an actual industrial park for two years. In the simulation process, the historical load data of the source domain (Industrial Park A) and the target domain (Industrial Park B) are first preprocessed and standardized, and then trained through a deep transfer learning model. The experimental results show that compared with traditional methods, the method of this patent has a significant improvement in performance:

[0128] Table 1 Comparison of prediction performance of different methods on the target domain test set

[0129]

[0130]

[0131] Table 2 Analysis of prediction errors at different load levels (MAPE%)

[0132]

[0133] Table 3 Analysis of model adaptability (percentage reduction of RMSE under different scenarios %)

[0134] Scene type TrAdaBoost DTL IDTL Seasonal change 15.6 18.9 24.3 Load mutation 12.8 16.5 21.8 New device access 14.2 17.8 23.5 Operation mode adjustment 13.9 17.2 22.9

[0135] The experimental results show that the improved DTL method has achieved significant advantages in prediction accuracy, with the RMSE dropping to 98.5 kW, the MAPE dropping to 4.12%, and the R 2 reaching 0.957, and it shows good adaptability under different load levels and various scenario changes, fully verifying the effectiveness and practical value of this method. The entire simulation process includes four main links: data preprocessing, model training, performance testing, and result analysis, which takes about 90 minutes. Among them, model training takes 75.2 minutes, and the response time in the prediction stage is less than 0.1 second, meeting the requirements of actual engineering applications.

[0136] Example 3, an embodiment of the present invention, provides a system for modeling the load of microgrid users based on deep transfer learning, including:

[0137] A data preprocessing module, which is responsible for data standardization, data augmentation (such as Gaussian noise), and model initialization (such as He initialization). The input is the original data of the source domain and the target domain. The output is the standardized data set, the enhanced training sample set, and the initialized network parameters.

[0138] Transfer learning module, which is responsible for implementing knowledge transfer between the source domain and the target domain, and conducts transfer learning through the feature extraction, domain adaptation, and task learning layers in the deep transfer learning framework. This module also includes an adversarial training mechanism to ensure the domain invariance of features. Input source domain data, target domain data, and initialize the network. Output optimized feature representations and feature maps with reduced inter-domain differences.

[0139] Load prediction module, which based on the transferred feature representations, uses a multi-layer perceptron (MLP) for load prediction, and combines an incremental learning method to ensure the model's ability to continuously learn new knowledge while avoiding catastrophic forgetting. Input optimized feature representations and incremental learning data. Output prediction results, optimized model parameters, and new knowledge during the incremental learning process.

[0140] Knowledge distillation module, which optimizes the model structure through knowledge distillation and utilizes knowledge transfer between the teacher model and the student model. It also combines adaptive adjustment mechanisms such as temperature adjustment, gradient clipping, and learning rate adaptive adjustment to ensure the stability of the model during the continuous learning process. Input the outputs of the teacher model and the student model, and the gradient information obtained during the training process. Output the distilled model, updated network weights, and optimized model parameters.

[0141] If a function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs, etc., which can store program codes.

[0142] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definitional sequence list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device or in connection with these instruction execution systems, apparatuses, or devices.

[0143] More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection (electronic device) having one or more wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which a program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other appropriate processing as necessary, and then stored in a computer memory.

[0144] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc. It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

[0145] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.

Claims

1. A microgrid user load modeling method based on deep transfer learning, characterized in that: include: Collect microgrid user data, perform data preprocessing and initialization; Conduct source domain pre-training and build a deep transfer learning framework; Use improved deep convolutional neural network for feature extraction; Calculate domain adaptation loss, introduce dual attention mechanism, and build load forecasting model; Set up incremental learning optimization to optimize the strategy by improving the algorithm.

2. The microgrid user load modeling method based on deep transfer learning according to claim 1, characterized in that: The deep transfer learning framework is constructed by designing a network structure containing three key components: a feature extraction layer for learning deep representation of data, a domain adaptation layer for ensuring domain invariance of features, and a task learning layer for specific prediction tasks; The loss function formula is expressed as: L=λ1L c +λ2L d +λ3L t Among them, L c Represents classification loss, using cross entropy loss for supervised learning tasks; L d represents the domain adaptation loss, ensuring the consistency of feature distribution between the source domain and the target domain; L t represents task-specific loss, which is aimed at the special needs of load forecasting tasks; λ1, λ2, and λ3 represent weight coefficients, which are dynamically adjusted through the verification set to balance the importance of each task.

3. The microgrid user load modeling method based on deep transfer learning as claimed in claim 2, characterized in that: The feature extraction comprises that the feature extraction module adopts an improved deep convolutional neural network, including multiple convolutional layers, pooling layers and batch normalization layers; The feature extraction process formula is expressed as: h(x)=σ(W*x+b) Among them, x represents the input data, W represents the convolution kernel parameters, b represents the bias term, and σ represents the activation function; a residual connection structure is adopted, and a batch normalization layer is added after each convolution layer; an improved MMD metric is introduced to reduce the distribution difference between the source domain and the target domain: Among them, X s ,X t Represents the source domain and target domain data respectively, n s 、n t Indicates the sample size.

4. The microgrid user load modeling method based on deep transfer learning as claimed in claim 3, characterized in that: The domain adaptation loss calculation includes: the domain adaptation layer adopts an adversarial learning strategy to achieve domain invariance of features through adversarial training of domain classifiers and feature extractors. The domain adaptation loss function is defined as: Among them, G f represents the feature extractor, G d represents the domain classifier, d i Indicates the domain label; In order to improve the training stability, the gradient reversal layer and feature regularization term are introduced; the feature extractor and domain classifier are optimized alternately to achieve Nash equilibrium.

5. The microgrid user load modeling method based on deep transfer learning according to claim 4, characterized in that: The load forecasting model is constructed as follows: the goal of the source domain pre-training stage is to fully utilize the source domain data to establish a basic model, build a deep neural network infrastructure including a feature extraction layer, a domain adaptation layer, and a task learning layer; calculate feature representation through forward propagation, and construct a pre-training loss function in combination with classification loss and regularization terms; Based on the feature representation of migration, a multi-layer perceptron is constructed for load forecasting. The formula is expressed as follows: y=f(W (L) h (L-1) (x)+b (L) ) The prediction error is evaluated using the root mean square error (RMSE): Among them, yi represents the actual value, represents the predicted value; The Adam optimizer is used in the training process to achieve rapid convergence by dynamically adjusting the learning rate. At this stage, the focus is on the performance of the model on the source domain data, the model performance is evaluated through the validation set, and the network structure and hyperparameters are adjusted in a timely manner.

6. The microgrid user load modeling method based on deep transfer learning according to claim 5, characterized in that: The setting of incremental learning optimization includes: in the incremental learning optimization stage, an incremental learning mechanism based on elastic weight integration is designed to enable the model to have continuous learning ability; parameter importance is evaluated through the Fisher information matrix, and the memory of existing knowledge is maintained while learning new knowledge; The knowledge distillation module adjusts the softness of the soft label by temperature, and the distillation loss function formula is expressed as: Among them, zs and zt represent the outputs of the teacher model and the student model respectively, T represents the temperature parameter, and KL represents the divergence; an adaptive temperature adjustment mechanism is introduced: T (t+1) =T (t) +α▽ T L kd The incremental learning process adopts a progressive approach. Each time the model receives new data, it updates the parameters. During the update process, the importance of the parameters is considered and the key parameters are protected. The experience replay mechanism is used to maintain partial memory of historical data. The He initialization method is used for network parameter initialization, and the parameters of the batch normalization layer are independently initialized to further improve training efficiency.

7. The microgrid user load modeling method based on deep transfer learning according to claim 6, characterized in that: The optimization strategy through improved algorithm includes processing source domain and target domain data and obtaining deep feature representation through feature extractor; To reduce the inter-domain differences, a dual domain adaptation mechanism based on maximum mean difference and adversarial learning is designed; The dual attention mechanism is introduced in the feature selection process, including channel attention and spatial attention, which can adaptively select the most relevant features. The comprehensive optimization of the model is achieved through the combination of multiple loss functions, including classification loss, domain adaptation loss, task-specific loss and knowledge distillation loss; The parameter adjustment adopts a dynamic optimization strategy, including weight coefficient update and learning rate adjustment. The update of weight coefficient takes into account the historical gradient information and smoothes the parameter changes through the momentum term. The learning rate adopts an adaptive adjustment strategy and is dynamically adjusted according to the changes in the loss function. Introduced a gradient clipping mechanism and designed an early stopping strategy to stop training in time when the performance of the validation set did not improve for several consecutive rounds; During the evaluation phase, a multi-dimensional evaluation system was used to comprehensively evaluate the model performance, including multiple indicators such as root mean square error, mean absolute percentage error, and determination coefficient. The reliability of the evaluation results was ensured through cross-validation, and the model convergence judgment criteria were set.

8. A system using the microgrid user load modeling method based on deep transfer learning as claimed in any one of claims 1 to 7, characterized in that: It includes data preprocessing module, transfer learning module, load forecasting module and adaptive adjustment module; The data preprocessing module is responsible for data standardization, data enhancement and model initialization; The transfer learning module is used to realize knowledge transfer between the source domain and the target domain, and performs transfer learning through feature extraction, domain adaptation and task learning layers in the deep transfer learning framework; it includes an adversarial training mechanism to ensure the domain invariance of features; The load forecasting module uses a multi-layer perceptron to perform load forecasting based on the migrated feature representation, and combines incremental learning methods to ensure the model's ability to continuously learn new knowledge while avoiding catastrophic forgetting; The knowledge distillation module optimizes the model structure by means of knowledge distillation, utilizing the knowledge transfer between the teacher model and the student model; and combines an adaptive adjustment mechanism to ensure the stability of the model during continuous learning.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the microgrid user load modeling method based on deep transfer learning described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the microgrid user load modeling method based on deep transfer learning described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Substation wireless access point anomaly detection method, system and device and medium

    CN121099365A

  • Direct-current power distribution network fault positioning method, system and device based on traveling wave analysis and medium

    CN121784464A

  • Semi-real-time prediction model updating method based on double-model parallel verification

    CN122114687A