Cross-time-domain non-intrusive load monitoring method fusing federated learning and Mama

By integrating federated learning and Mamba into a cross-temporal non-intrusive load monitoring method, the privacy leakage and data imbalance issues of the NILM method in cross-scenario applications are solved, achieving efficient and privacy-preserving energy management, improving the model's generalization ability and adaptability, and ensuring stability and accuracy at different time granularities.

CN121580360APending Publication Date: 2026-02-27YANSHAN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511810350.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing NILM methods suffer from privacy risks, data imbalance, and insufficient model generalization ability in cross-scenario applications. In particular, they are difficult to achieve efficient and privacy-preserving energy management in scenarios with multiple appliances and multiple houses.

Method used

We adopt a cross-temporal non-intrusive load monitoring method that integrates federated learning and Mamba. By constructing cross-temporal clients, weighted random client selection, MambaNILM model and weighted aggregation mechanism, we can achieve local training of model parameters and efficient data integration. Combined with multi-scale data segmentation and event batch sampling strategies, we can improve the generalization ability and adaptability of the model.

Benefits of technology

It significantly improves the accuracy and efficiency of the model, reduces communication overhead, enhances adaptability to different data distributions, and ensures the stability and accuracy of the model at different time granularities through a multi-scale evaluation framework.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121580360A_ABST
    Figure CN121580360A_ABST
Patent Text Reader

Abstract

The invention provides a time-domain-crossing non-intrusive load monitoring method fusing federated learning and Mama, and the method comprises the steps: dividing UK-DALE data into a time-domain-crossing client data set according to a time period, and carrying out the normalization preprocessing at a local side; the method comprises the following steps of: constructing a non-intrusive load monitoring model based on a Mama structure by utilizing Mama state space modeling and long sequence dependence capture capability; under a federated learning framework, each client executes local training and designs a diversity correction strategy to inhibit the influence of data heterogeneity on model convergence, and meanwhile, global model parameters are optimized through weighted aggregation. According to the method, the problems of privacy leakage risk, insufficient model generalization ability, overweight calculation burden and the like existing in traditional load monitoring are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power load identification and energy management, in particular, especially relates to a cross-time domain non-intrusive load monitoring method fusing federated learning and Mamba. BACKGROUND

[0002] With the intelligent development of the power system, the demand for monitoring the running state of each electrical appliance is increasing. Non-intrusive load monitoring (NILM) is an intelligent technology that analyzes the total power consumption data of a home or building to decompose the power consumption characteristics and running state of each electrical appliance, and is widely used in energy management, smart home and power system optimization. Traditional NILM methods usually need to collect a large amount of centralized training data, but this brings significant challenges: first, user power consumption data contains sensitive information, and centralized storage and processing poses a risk of privacy leakage; second, the types and usage patterns of electrical appliances in different homes differ greatly, resulting in insufficient generalization ability of the model trained centrally when applied across scenes; third, the original data of different users varies in size, with some being relatively dense and others being relatively sparse, which increases the complexity of data integration and model training and may affect the accuracy of the analysis results. Based on this, promoting the combination of NILM and federated learning has become an effective way to achieve efficient and privacy-protected energy management.

[0003] Federated learning (FL) is an emerging distributed machine learning method that trains models on local devices and only uploads model parameters rather than raw data, significantly reducing privacy risks and communication costs. However, the application of FL in NILM tasks is still in its early stages, especially in complex scenarios with multiple electrical appliances and multiple houses, which still faces technical challenges such as global normalization processing, client selection strategy, and model parameter aggregation mechanism. In existing solutions, data imbalance, aggregation mechanism ignoring client performance differences, and lack of efficient sequence models limit the accuracy and generalization ability of the system. How to further improve the generalization ability and adaptability of the model while ensuring accuracy and efficiency is still a key problem that needs to be broken through in the field of NILM. SUMMARY

[0004] In view of the technical problems of privacy leakage, data imbalance and model generalization deficiency in the prior art proposed above, a cross-time domain non-intrusive load monitoring method fusing federated learning and Mamba is provided.

[0005] The technical means adopted by the present application are as follows: A non-intrusive, cross-temporal load monitoring method integrating federated learning and Mamba, characterized by the following steps: S1. Construct cross-time domain clients under the federated learning framework, divide the UK-DALE dataset into multiple time scales, and divide the data of each household into multiple independent time periods. Each independent time period is regarded as a virtual client, which stores normalized parameters and training data locally. In each round of global training, the central server selects some clients to participate in training according to the amount of data of each virtual client using a weighted random strategy. S2. Before training on the selected client, perform local mean and variance normalization on the training and validation sets for each time period; construct an approximately balanced event batch sampling strategy, and ensure that each batch contains at least one positive sample through constraints to avoid gradient vanishing or model bias problems. S3. Each virtual client is trained locally using the MambaNILM model based on the preprocessed data. The MambaNILM model first processes the input features through dilated convolution, adaptive average pooling, Mamba layers and attention mechanism, and then uses upsampling, one-dimensional convolution and fully connected layers to realize feature reconstruction and result output, decomposing the energy consumption and switching status of individual electrical appliances from the aggregated power signal. S4. After training, each client only uploads the model parameters to the server. The central server performs weighted aggregation, which allocates weights according to the size of the client's dataset. A probability correction mechanism is introduced to ensure that clients with smaller sample sizes still retain a certain weight in the aggregation, so that the global model can cover short-term, medium-term and long-term load trends. S5. The aggregated global model first adopts a comprehensive scoring mechanism to integrate model accuracy and convergence trend to guide updates. Then, it is distributed to the next round of clients participating in training to update the local model weights and biases, and training continues until the preset maximum number of iterations is reached. The global model is evaluated on data that has not participated in training and validation at different time scales and validated by error indicators of predicted energy consumption and actual energy consumption, and performance indicators of predicted on / off states and actual states.

[0006] Furthermore, in S1, the multi-timescale division adopts three granularities: day, week, and month; the UK-DALE dataset is divided into several time periods according to the multi-timescale division, and each independent time period is regarded as a virtual client, with normalized parameters and training data stored locally; to improve the diversity and fairness of client participation, a weighted random strategy is used to select some clients to participate in training, then the... Wheel Client The probability of being selected is defined as: ; in, Indicates the first Wheel Client The probability of being selected. Indicates client The amount of data, The total number of all virtual clients. It is a smoothing constant. This represents the smoothed sum of sample sizes.

[0007] Furthermore, in S2, a constraint is introduced in batch sampling to ensure that each batch contains at least one positive sample, in order to avoid gradient vanishing or bias problems. Let the batch size be... The proportion of positive samples is Then the number of positive and negative samples in each batch are respectively: ; ; in, This indicates the number of positive samples in each batch. This indicates the number of negative samples in each batch. This indicates the rounding operation, used to round to the nearest integer based on the proportion of positive samples. Calculate the number of positive samples to be sampled. Ensure that each batch contains at least one positive sample by randomly sampling from the set of positive and negative samples: ; ; ; in, Represents the set of positive samples. Represents the set of negative samples. This means randomly drawing a specified number of samples without replacement from a specified sample set. This represents the subset of positive samples obtained from the current batch. This represents the subset of negative samples obtained from the current batch. This represents the final complete set of batch samples. This indicates that the order within a batch is randomly shuffled to ensure diversity in training order.

[0008] Furthermore, in S3, the MambaNILM model processes the input data through a multi-layer structure, including dilated convolution, adaptive average pooling, Mamba layers, and an attention mechanism. Finally, it outputs an energy consumption prediction through upsampling, convolution, and fully connected layers. and state prediction : ; ; ; ; ; in, This represents the input time-series energy consumption data. This represents the feature representation obtained after dilated convolution. This represents the downsampled features after adaptive average pooling. This represents the cross-temporal state-space characteristics after processing by the Mamba layer. This represents the weighted feature representation obtained through the attention mechanism. This represents the features restored to the original time scale after upsampling and convolution. and This represents the fully connected transformation between the first and second layers. This represents the output fully connected layer corresponding to the energy consumption prediction branch. This represents the output fully connected layer corresponding to the state prediction branch. This represents the hyperbolic tangent activation function.

[0009] Furthermore, in step S4, after training, the client only uploads the model parameters to the server, and the central server performs weighted aggregation. The aggregation strategy incorporates diversity correction while considering the amount of client data to reduce communication and storage overhead and improve the generalization ability of the global model. The formula for weighted aggregation of model parameters based on the amount of client data is: ; in, Represented as the first The global model parameters after one round of training. Indicates client In the The model parameters are completed after local training. Indicates the first The set of clients selected to participate in training in the round. Indicates assignment to the client The weighting coefficients are calculated as follows: To further enhance the influence of small dataset clients in aggregation and improve the diversity of participating clients, a probability correction mechanism is introduced in the client selection and parameter aggregation process. The adjusted weighting coefficient calculation method is as follows: ; in, This represents the balance factor, used to adjust the weights between "weighted by data volume" and "uniform weighting". At that time, more emphasis was placed on clients with large amounts of data. At that time, it is even more important to emphasize the equal participation of all clients.

[0010] Furthermore, in S5, the comprehensive scoring mechanism integrates model accuracy and convergence trend using a weighted approach: ; ; ; in, Indicates the first The overall score used in each round of training to determine whether to update the optimal model. Indicates the first The average F1 score of all selected clients in the round. Indicates the first Global loss after wheel smoothing Indicates the weighting coefficient. Indicates the first The loss value of the global model after round aggregation on the validation set. Indicates calculation The number of rounds accumulated backwards, Indicates the first The number of clients participating in the round. Indicates client In the The F1 score of the round.

[0011] Compared with the prior art, the present invention has the following advantages: 1. This invention divides data into multiple time scales and constructs virtual clients, combining probability correction and weighted random sampling client selection strategies to ensure the effective participation of small dataset clients and enhance the adaptability of the global model to different data distributions.

[0012] 2. This invention adopts a federated learning framework, which only uploads model parameters to the central server and reduces communication overhead through weighted average aggregation. At the same time, multi-scale data segmentation and event batch sampling strategies improve the computational efficiency of local training.

[0013] 3. This invention proposes the MambaNILM model and constructs a corresponding encoder-decoder structure. By combining dilated convolution, adaptive average pooling, Mamba layers, attention mechanism, upsampling and one-dimensional convolution, it achieves joint modeling of electrical energy consumption regression and switch state classification, effectively improving the accuracy and robustness of non-intrusive load monitoring. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a schematic diagram of the non-intrusive load monitoring system described in this invention; Figure 2 This is a flowchart of the cross-temporal non-intrusive load monitoring method based on the MambaNILM model and diversity-corrected federated learning described in this invention. Figure 3 This is a schematic diagram of the interaction process between the federated learning server and the client described in this invention. Detailed Implementation

[0016] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0017] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0018] Reference Figure 1 and Figure 2 This invention discloses a non-intrusive load monitoring method that integrates federated learning and Mamba, comprising the following steps: S1. During data preprocessing and client construction, the UK-DALE dataset is divided and resampled according to multiple time scales. The load data for each household is segmented into several independent time periods, and each time period is treated as a virtual client, with normalized parameters and training data stored locally.Figure 2 As shown. In each round of global training, the central server selects a portion of clients to participate in training according to a weighted random strategy based on the amount of data from each virtual client, thereby effectively reducing communication and computing overhead while ensuring data diversity; To enhance the diversity and fairness of client participation, a client selection strategy based on data-weighted random sampling is adopted. Then, the... Wheel Client The probability of being selected is defined as: ; in, It is the first Wheel Client The probability of being selected. Indicates client The amount of data, The total number of all virtual clients. It is a smoothing constant. This represents the smoothed sum of sample sizes.

[0019] S2. Before training on the selected client, local mean and variance normalization is performed on the training and validation sets for each time period, taking into account the power distribution characteristics of different time periods, to improve the model's adaptability to time-varying characteristics. Simultaneously, to mitigate training bias caused by uneven distribution of positive and negative samples, an approximately balanced event batch sampling strategy is constructed. Constraints ensure that each batch contains at least one positive sample, avoiding gradient vanishing or model bias issues. Furthermore, an adjustable positive-to-negative sample ratio control mechanism achieves a balance and optimization between training stability and convergence speed.

[0020] First, the input data for each time period... Perform local normalization and calculate the mean. and standard deviation and normalize it to The formula is as follows: ; ; ; in, It is the number of data points within a time period. Prevent division by zero.

[0021] Then set the time window. The state is ,in This indicates that at least one appliance is on. Therefore: Let and represent the sets of positive and negative sample indices, respectively. Let the batch size be . The proportion of positive samples is Then the number of positive and negative samples in each batch are respectively: ; ; in, This indicates the number of positive samples in each batch. This indicates the number of negative samples in each batch. This indicates the rounding operation, used to round to the nearest integer based on the proportion of positive samples. Calculate the number of positive samples to be sampled. Ensure that each batch contains at least one positive sample by randomly sampling from the set of positive and negative samples: ; ; ; in, Represents the set of positive samples. Represents the set of negative samples. This means randomly drawing a specified number of samples without replacement from a specified sample set. This represents the subset of positive samples obtained from the current batch. This represents the subset of negative samples obtained from the current batch. This constitutes the final complete batch sample set. This indicates that the order within a batch is randomly shuffled to ensure diversity in training order.

[0022] When the number of remaining samples is insufficient to form a complete batch, priority is given to ensuring balanced sampling of positive and negative samples, and all remaining samples are merged to generate a final small batch.

[0023] ; ; ; in, This indicates the number of positive samples in the last batch, i.e., the number of appliances turned on; This indicates the number of negative samples in the last batch, i.e., the number of appliances that were turned off. This represents the final set of samples in the last batch. For the remaining batch size, This represents the total number of remaining positive samples. This represents the total number of remaining negative samples.

[0024] S3. Based on the preprocessed data, each client, such as Figure 2As shown, the MambaNILM model is used for local training. The MambaNILM model first processes the input features through dilated convolution, adaptive average pooling, Mamba layers, and an attention mechanism. Then, it utilizes upsampling, one-dimensional convolution, and fully connected layers to reconstruct the features and output the results, decomposing the energy consumption and switching state of individual appliances from the aggregated power signal. Through a dual-branch output structure, the model performs both energy consumption regression prediction and switching state classification, thus achieving joint modeling in both energy consumption estimation and state detection. Mamba is a selective state-space model that captures long-range dependencies by discretizing continuous dynamic systems into efficient linear recursions and supports parallel computation, thereby simulating the memory and forgetting mechanisms of sequences. The MambaNILM model constructed in this invention is based on the Mamba neural network and employs an encoder-decoder structure of "downsampling, sequence modeling, and upsampling" to extract the temporal features of power signals, achieving multi-task output of energy regression and state classification.

[0025] First, dilated convolution combined with adaptive average pooling is used to compress the input sequence in the time dimension, while extracting its local temporal features, thus achieving an effect similar to the downsampling stage of an encoder: ; in, This represents the input time-series energy consumption data. This represents the feature representation obtained after dilated convolution. This represents the downsampled features after adaptive average pooling.

[0026] Based on the compressed feature sequences, a Mamba layer and attention mechanism are introduced to more effectively capture deep temporal dependencies, thereby achieving fine-grained modeling of intermediate representations: ; ; in, This represents the cross-temporal state-space characteristics after processing by the Mamba layer. This represents the weighted feature representation obtained through the attention mechanism.

[0027] Finally, by combining upsampling with one-dimensional convolution, the feature map is restored to the original temporal resolution, which is equivalent to the reconstruction stage of the decoder, thereby reconstructing the temporal structure features of the input signal: ; in, This represents the features restored to the original time scale after upsampling and convolution.

[0028] This network employs an encoder-decoder framework: the front end extracts and compresses high-dimensional features through a downsampling module, the middle sequence modeling module captures global dependencies, and the back end reconstructs the features through an upsampling module, thereby achieving end-to-end modeling and accurate prediction of the input load signal. ; ; in, This indicates the output energy consumption prediction. Indicates state prediction, and This represents the fully connected transformation between the first and second layers. This represents the output fully connected layer corresponding to the energy consumption prediction branch. This represents the output fully connected layer corresponding to the state prediction branch. This represents the hyperbolic tangent activation function.

[0029] S4. In a federated learning framework, after training, the client only uploads the model parameters to the server, and the central server performs weighted aggregation, such as... Figure 3 As shown, the aggregation strategy introduces diversity correction while considering the amount of client data, in order to reduce communication and storage overhead and improve the generalization ability of the global model.

[0030] In the At the start of each round, each client receives the global model, completes training locally, obtains the updated parameters, and then uploads them to the server. ; here, Indicates the first Round global model, It is a client No. The model parameters obtained after the first round of training. Indicates the local learning rate. Indicates the client loss function in The gradient at that point, the server will send the parameters of each client. Aggregation is performed to obtain a new global model. .

[0031] Based on the parameters of the weighted aggregation model using client data volume, the formula is: ; in, Represented as the first The global model parameters after one round of training. Indicates client In the The model parameters are completed after local training. Indicates the first The set of clients selected to participate in training in the round. Indicates assignment to the client The weighting coefficients.

[0032] To further enhance the influence of small dataset clients in aggregation and improve the diversity of participating clients, a probability correction mechanism is introduced in the client selection and parameter aggregation process. The adjusted weighting coefficient calculation method is as follows: ; in, This represents the balance factor, used to adjust the weights between "weighted by data volume" and "uniform weighting". At that time, more emphasis was placed on clients with large amounts of data. At that time, it is even more important to emphasize the equal participation of all clients.

[0033] S5. The aggregated global model first employs a comprehensive scoring mechanism, fusing model accuracy (F1-score) and convergence trend (Loss) to guide updates. It is then distributed to the next round of training clients to update local model weights and biases, and training continues until the preset maximum number of iterations is reached. The comprehensive scoring mechanism achieves this by weightedly fusing model accuracy and convergence trend. ; ; ; in, Indicates the first The overall score used in each round of training to determine whether to update the optimal model. Indicates the first The average F1 score of all selected clients in the round. Indicates the first Global loss after wheel smoothing Indicates the weighting coefficient. Indicates the first The loss value of the global model after round aggregation on the validation set. Indicates calculation The number of rounds accumulated backwards, Indicates the first The number of clients participating in the round. Indicates client In the The F1 score of the round.

[0034] To comprehensively evaluate the robustness of the model across different time scales, this invention designs a multi-scale evaluation framework. Test data is grouped by day, week, month, and complete data, and the aforementioned metrics are calculated for multiple data segments at each scale. This framework quantifies the model's generalization ability at different time granularities by evaluating the global model's performance on a fixed validation set, ensuring the stability of identifying intermittent and constantly on electrical appliances in practical deployments. Simultaneously, to evaluate the model's performance in identifying appliance switch states, this invention uses F1 score and accuracy as classification metrics. The F1 score combines precision and recall, effectively measuring the model's overall performance when facing unbalanced data on appliance switch states; while accuracy evaluates the model's overall ability to correctly identify switch states. Mean relative error (MRE) and mean absolute error (MAE) are also introduced as regression metrics to evaluate the model's accuracy in predicting appliance power. The calculation formulas for each metric are as follows: ; ; ; in, , , , These represent the number of positive samples classified as positive, the number of negative samples classified as positive, the number of negative samples classified as negative, and the number of positive samples classified as negative, respectively.

[0035] In order to evaluate the effectiveness of the MambaNILM model proposed in this invention, several state-of-the-art architectures were compared, including SAED, OneToManyCNN, and BERT4NILM.

[0036] 1. SAED Method: SAED is a self-attention-based encoder-decoder model. This method first uses a convolutional encoder to extract local features from the aggregated power sequence, then models temporal dependencies through a GRU layer, and combines a dot product attention mechanism to highlight key contextual information; finally, the decoder completes feature restoration and outputs the predicted energy consumption of electrical appliances.

[0037] 2. OneToManyCNN Method: OneToManyCNN is a convolutional neural network model. This method first extracts local patterns and short-term dependencies from the input sequence through multiple convolutional networks, gradually forming a hierarchical feature representation. Then, it integrates the extracted high-dimensional features using fully connected layers and combines a dropout mechanism to suppress overfitting and improve the model's generalization ability. Finally, the model outputs a prediction of the energy consumption of electrical appliances, thus achieving a mapping from overall power to the energy distribution of multiple electrical appliances.

[0038] 3. BERT4NILM Method: BERT4NILM is a Transformer-based model. First, it extracts local features of the sequence through convolutional and pooling layers, and then adds positional embeddings to enable the model to perceive temporal order information. Next, multiple Transformer blocks model global dependencies through a self-attention mechanism, thereby strengthening the interaction between different time segments. Finally, deconvolutional layers are used to restore the sequence dimension and generate energy consumption predictions, achieving a refined decomposition of the original power signal.

[0039] The three networks were modified to have the same hyperparameters as the MambaNILM model proposed in this invention, and then the above four models were trained until convergence. The general hyperparameter settings of the algorithm are shown in Table 1.

[0040] Table 1

[0041] Table 2 shows the comparison results between different algorithms and the MambaNILM model proposed in this invention (the best results in the experiments are marked in bold black font). As can be seen from Table 2, the proposed method, taking dishwasher as an example, generally outperforms the comparison methods in terms of performance.

[0042] Table 2

[0043] In the above embodiments, this invention provides a non-intrusive load monitoring method across time domains that integrates federated learning and Mamba, significantly improving the accuracy and robustness of power load decomposition. Addressing the shortcomings of traditional methods, this invention uses multi-scale data preprocessing to segment the UK-DALE dataset into virtual clients according to daily, weekly, and monthly time scales, enhancing data diversity. Weighted random sampling and probability correction mechanisms ensure the participation of clients with smaller datasets, optimizing the generalization ability of the global model while reducing communication and computational overhead. In model design, the MambaNILM model combines dilated convolution, attention mechanisms, and dual-branch output. It extracts features through downsampling, captures long-range dependencies, and reconstructs sequences, achieving joint optimization of energy consumption regression and on / off state classification. The event batch sampling strategy alleviates imbalance by forcibly including positive samples and adjusting the sample ratio, improving training stability and convergence speed. The federated learning framework further enhances practicality; clients only upload model parameters, while the central server uses data-weighted aggregation and probability correction to promote diversity. The multi-scale evaluation framework evaluates performance using F1 scores, accuracy, relative error, and absolute error at daily, weekly, monthly, and overall scales. The model update is optimized by combining accuracy and loss scoring to ensure performance balance at different time granularities.

[0044] In summary, this invention achieves significant progress in reducing communication overhead, improving model diversity, and enhancing prediction accuracy, providing an efficient and practical solution for non-intrusive load monitoring in smart grids and energy management. The above embodiments are merely preferred embodiments of this invention, intended to illustrate its core concepts and technical advantages, and not to limit the scope of the invention. All improvements and modifications made by those skilled in the art based on the technical solutions of this invention without departing from its design philosophy should be covered within the scope of protection of this invention. The technical content claimed in this invention is fully embodied in the claims.

[0045] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the above embodiments of the present invention, the descriptions of each embodiment have their own emphasis; parts not described in detail in a certain embodiment can be referred to in the relevant descriptions of other embodiments. It should be understood that the disclosed technical content in the several embodiments provided in this application can be implemented in other ways.

[0046] Finally, 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 foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A cross-temporal non-intrusive load monitoring method integrating federated learning and Mamba, characterized in that, Includes the following steps: S1. Construct a cross-time domain client under the federated learning framework, divide the UK-DALE dataset into multiple time scales, divide the data of each family into multiple independent time periods, and treat each independent time period as a virtual client, storing normalization parameters and training data locally. In each round of global training, the central server selects a portion of clients to participate in training based on the amount of data from each virtual client using a weighted random strategy. S2. Before training on the selected client, perform local mean and variance normalization on the training and validation sets for each time period; construct an approximately balanced event batch sampling strategy, and ensure that each batch contains at least one positive sample through constraints to avoid gradient vanishing or model bias problems. S3. Each virtual client is trained locally using the MambaNILM model based on the preprocessed data. The MambaNILM model first processes the input features through dilated convolution, adaptive average pooling, Mamba layers and attention mechanism, and then uses upsampling, one-dimensional convolution and fully connected layers to realize feature reconstruction and result output, decomposing the energy consumption and switching status of individual electrical appliances from the aggregated power signal. S4. After training, each client only uploads the model parameters to the server, and the central server performs weighted aggregation, which allocates weights according to the size of the client's dataset. In addition, a probability correction mechanism is introduced to ensure that clients with smaller sample sizes still retain a certain weight in the aggregation, so that the global model can cover short-term, medium-term and long-term load trends. S5. The aggregated global model first adopts a comprehensive scoring mechanism to integrate model accuracy and convergence trend to guide updates. Then, it is distributed to the next round of clients participating in training to update the local model weights and biases, and training continues until the preset maximum number of iterations is reached. The global model is evaluated on data that has not participated in training and validation at different time scales and validated by error indicators of predicted energy consumption and actual energy consumption, and performance indicators of predicted on / off states and actual states.

2. The cross-temporal non-intrusive load monitoring method integrating federated learning and Mamba as described in claim 1, characterized in that: In S1, the multi-timescale division adopts three granularities: day, week, and month. The UK-DALE dataset is divided into several time periods according to the multi-timescale division, and each independent time period is regarded as a virtual client, with normalized parameters and training data stored locally. To improve the diversity and fairness of client participation, a weighted random strategy is used to select some clients to participate in training. Wheel Client The probability of being selected is defined as: ; in, Indicates the first Wheel client The probability of being selected. Indicates the client The amount of data, The total number of all virtual clients. It is a smoothing constant. This represents the smoothed sum of sample sizes.

3. The cross-temporal non-intrusive load monitoring method integrating federated learning and Mamba as described in claim 1, characterized in that: In step S2, a constraint is introduced in batch sampling to ensure that each batch contains at least one positive sample, thus avoiding gradient vanishing or bias problems. Let the batch size be... The proportion of positive samples is Then the number of positive and negative samples in each batch are respectively: ; ; in, This indicates the number of positive samples in each batch. This indicates the number of negative samples in each batch. This indicates the rounding operation, used to round to the nearest integer based on the proportion of positive samples. Calculate the number of positive samples to be sampled. Ensure that each batch contains at least one positive sample by randomly sampling from the set of positive and negative samples: ; ; ; in, Represents the set of positive samples. Represents the set of negative samples. This means randomly drawing a specified number of samples without replacement from a specified sample set. This represents the subset of positive samples obtained from the current batch. This represents the subset of negative samples obtained from the current batch. This represents the final complete set of batch samples. This indicates that the order within a batch is randomly shuffled to ensure diversity in training order.

4. The cross-temporal non-intrusive load monitoring method integrating federated learning and Mamba as described in claim 1, characterized in that: In S3, the MambaNILM model processes input data through a multi-layer structure, including dilated convolution, adaptive average pooling, Mamba layers, and an attention mechanism. Finally, it outputs energy consumption predictions through upsampling, convolution, and fully connected layers. and state prediction : ; ; ; ; ; in, This represents the input time-series energy consumption data. This represents the feature representation obtained after dilated convolution. This represents the downsampled features after adaptive average pooling. This represents the cross-temporal state-space characteristics after processing by the Mamba layer. This represents the weighted feature representation obtained through the attention mechanism. This represents the features restored to the original time scale after upsampling and convolution. and This represents the fully connected transformation between the first and second layers. This represents the output fully connected layer corresponding to the energy consumption prediction branch. This represents the output fully connected layer corresponding to the state prediction branch. This represents the hyperbolic tangent activation function.

5. The cross-temporal non-intrusive load monitoring method integrating federated learning and Mamba as described in claim 1, characterized in that: In step S4, after training, the client only uploads the model parameters to the server, and the central server performs weighted aggregation. The aggregation strategy incorporates diversity correction while considering the amount of client data to reduce communication and storage overhead and improve the generalization ability of the global model. The model parameters are weighted and aggregated based on the amount of client data, using the following formula: ; in, Represented as the first The global model parameters after one round of training. Indicates the client In the The model parameters are completed after local training. Indicates the first The set of clients selected to participate in training in the round. Indicates assignment to the client The weighting coefficients are calculated as follows: To further enhance the influence of small dataset clients in aggregation and improve the diversity of participating clients, a probability correction mechanism is introduced in the client selection and parameter aggregation process. The adjusted weighting coefficient calculation method is as follows: ; in, This represents the balance factor, used to adjust the weights between "weighted by data volume" and "uniform weighting". At that time, more emphasis was placed on clients with large amounts of data. At that time, it is even more important to emphasize the equal participation of all clients.

6. The cross-temporal non-intrusive load monitoring method integrating federated learning and Mamba as described in claim 1, characterized in that: In S5, the comprehensive scoring mechanism integrates model accuracy and convergence trend through weighted fusion: ; ; ; in, Indicates the first The overall score used in each round of training to determine whether to update the optimal model. Indicates the first The average F1 score of all selected clients in the round. Indicates the first Global loss after wheel smoothing Indicates the weighting coefficient. Indicates the first The loss value of the global model after round aggregation on the validation set. Indicates calculation The number of rounds accumulated backwards, Indicates the first The number of clients participating in the round. Indicates the client In the The F1 score of the round.

Citation Information

Cited By

  • A method for predicting the health of an electric vehicle battery based on federated transfer learning

    CN122218549A