A carbon emission prediction method and system based on federated learning and differential privacy protection

By employing federated learning and differential privacy protection methods, the problems of carbon emission data silos and privacy leaks are solved, achieving high-precision and robust carbon emission prediction, and improving the model's cross-domain adaptability and prediction efficiency.

CN120910914BActive Publication Date: 2026-01-02JIANGSU OPEN UNIVERSITY (THE CITY VOCATIONAL COLLEGE OF JIANGSU)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511438071.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2026-01-02
Estimated Expiration
2045-10-10

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as data silos in carbon emissions, privacy leaks, insufficient modeling accuracy, and difficulties in convergence under non-independent and identically distributed data, resulting in insufficient model stability and generalization ability when applied across regions and industries.

Method used

We employ a federated learning and differential privacy-preserving approach, through local training, reliability scoring, dynamic privacy budget allocation, and quality-aware noise adjustment, to adaptively improve the aggregation strategy of the global model and generate a high-precision, robust carbon emission prediction model.

Benefits of technology

It achieves improved model accuracy and robustness while protecting data privacy, reduces training rounds and communication overhead, supports cross-domain adaptation for multiple scenarios, and improves the accuracy and efficiency of carbon emission prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120910914B_ABST
    Figure CN120910914B_ABST
Patent Text Reader

Abstract

The application discloses a carbon emission prediction method and system based on federated learning and differential privacy protection, and belongs to the technical field of carbon emission prediction. The method comprises the following steps: performing reliability analysis on local models of each participant; dynamically allocating privacy budget and adjusting quality-aware noise to protect the differential privacy of the local model parameters; adaptively improving the aggregation strategy of the global model, and aggregating the model parameters of all participants after privacy protection to generate a new global model; optimizing the global model in the form of multi-round iterative training under the framework of federated learning until the final global model is generated; and using the final global model to predict the carbon emission of each participant. The application can solve the problems of data silos, privacy leakage, insufficient modeling accuracy and convergence difficulty under non-independent and identically distributed data in the prior art, and can realize high-precision and strong-robustness carbon emission prediction under the premise of protecting data privacy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of carbon emission prediction, and particularly relates to a carbon emission prediction method and system based on federated learning and differential privacy protection. BACKGROUND

[0002] Carbon emission monitoring covers power, industry, transportation and building scenarios, and the data sources are scattered, various and updated frequently. Due to data compliance and business sensitivity, it is difficult to concentrate the original data, centralized modeling is easy to form a data island, and the model is not stable and has insufficient generalization ability when applied across regions and industries. Actual business also requires to support emission prediction, anomaly identification, accounting checking and other tasks, and has clear requirements for timeliness, robustness and auditability.

[0003] There are mainly two types of traditional solutions: one is to gather data to the center and do desensitization processing, which has the risk of re-identification and high governance cost. The second is to use homomorphic encryption or secure multi-party computation, which has high security, but the calculation and communication overhead is prominent in large-scale and low-latency scenarios.

[0004] In order to balance data security and communication overhead, federated learning has become one of the mainstream means because it can be trained cooperatively without data leaving the domain, but the traditional federated learning uses a general aggregation algorithm to aggregate the parameters of each participant, which leads to slow convergence, precision decline and interference by abnormal uploads under the conditions of non-independent and identically distributed, device heterogeneity and unstable online participation. SUMMARY

[0005] The present application provides a carbon emission prediction method and system based on federated learning and differential privacy protection, which can solve the problems of data island, privacy leakage, insufficient modeling precision and convergence difficulty under non-independent and identically distributed data in the prior art, and realize high-precision and strong-robustness carbon emission prediction under the premise of protecting data privacy.

[0006] The present application provides the following technical solutions:

[0007] In a first aspect, a carbon emission prediction method based on federated learning and differential privacy protection is provided, comprising:

[0008] Respectively training local models of each participant involved in cooperative modeling, the local model being an initialized global model, and respectively preprocessing historical carbon emission monitoring data of each participant during local training;

[0009] Reliability analysis of the local model after local training from the aspects of data quality and model quality to obtain a reliability score;

[0010] The local model parameters trained by each participant are protected by differential privacy by using the reliability scores of the participants for dynamic privacy budget allocation and quality-aware noise adjustment.

[0011] The aggregation strategy of the global model is improved adaptively according to the reliability scores of the participants and the anomaly detection of the obtained local model parameters, and the model parameters of all participants after privacy protection are aggregated based on the improved aggregation strategy to generate a new global model; the global model is optimized in the framework of federated learning in a multi-round iterative training manner until a final global model is generated.

[0012] Based on the carbon emission monitoring data of each participant, the final global model is used to predict the carbon emissions of each participant.

[0013] Optionally, the reliability analysis specifically includes:

[0014] In terms of data quality, scores of three indicators of integrity, consistency and time sequence stability are obtained, in terms of model quality, scores of two indicators of training quality and parameter convergence stability are obtained, and scores of all indicators are weighted and fused to obtain the reliability score of each participant. Specifically, the reliability score of the participant is :

[0015] ;

[0016] wherein, is the reliability score of the participant , is the score of the th indicator of the participant , is the weight of .

[0017] Optionally, the score of the data integrity indicator of the participant is :

[0018] ;

[0019] The score of the data consistency indicator of the participant is :

[0020] ;

[0021] The score of the data time sequence stability indicator of the participant is :

[0022] ;

[0023] Participants The score of the local model training quality indicator of the participant is:

[0024]

[0025] The score of the model parameter convergence stability indicator of the participant is:

[0026]

[0027] wherein, is the total number of missing data points, is the total length of the monitoring data time series of the participant is the total dimension of the carbon emission monitoring data, and are the skewness coefficient and the coefficient of variation of the carbon emission monitoring data in dimension d and are the carbon emission prediction values and the label values output by the participant after local model training at time t and are the pre-processed and un-processed carbon emission monitoring data, respectively; is the variance function, is the time series derivative of the normalized data in dimension d is the gradient of the loss function with respect to the local model parameters is the square of the L2 norm, is the natural exponential function. Optionally, the reliability score of each participant is used to dynamically allocate privacy budgets and adjust quality-aware noise to protect the local model parameters after local training of each participant with differential privacy, specifically:

[0028] The convergence-aware factor at the

[0029] th global iteration is constructed as:

[0030]

[0031] wherein, and are the global model parameters at the th and th global iteration, is the convergence judgment variance parameter,​​​​​​​​​​ The square of the L2 norm, It is a natural exponential function;

[0032] Dynamic privacy budget allocation is performed using the reliability scores and convergence perception factors of each participant;

[0033] ;

[0034] in, for Dynamic privacy budget allocated during the next global iteration Based on privacy budget, The mean of the reliability scores for all participants. This represents the total number of iterations in the global iteration. , and They are respectively , and The corresponding weights;

[0035] Using the reliability scores of each participant, a quality-perceived noise adjustment function is constructed, the noise variance is calculated, and adaptive noise is added to the parameters after training the Benley model.

[0036] ;

[0037] ;

[0038] ;

[0039] in, As a participant The quality-perceived noise adjustment function, As a participant Reliability rating, The set reliability score threshold, As a participant In the The variance of the Gaussian noise added during global training. This represents the failure probability in differential privacy. This represents the change in the squared global sensitivity after the gradient or parameter update. In the first Participants in global training Local model parameters, In the first Participants in global training Local model parameters after adding noise; It is the identity matrix. With a mean of 0, the covariance matrix is a multivariate Gaussian distribution.

[0040] Optionally, the anomaly detection of the local model parameters according to the reliability scores of the participants and the anomaly detection adaptively improves the aggregation strategy of the global model, and the model parameters of all participants after privacy protection are aggregated based on the improved aggregation strategy, specifically:

[0041] performing anomaly detection on the local model parameters after adding noise and obtaining an anomaly detection comprehensive score ;

[0042] According to the reliability score and the anomaly detection comprehensive score of each participant, the weight of the model parameter aggregation of each participant is adaptively adjusted;

[0043] ;

[0044] wherein, is the aggregation weight of the participant , is the reliability score of the participant , is the sample size of the participant , , is the temporary index of the current participant; is the median of the local model parameters of all participants at the th global iteration, is the median distance adjustment variance, is the square of the L2 norm, is the natural exponential function; The model parameters of all participants after privacy protection are aggregated to obtain the parameters of the new global model;

[0045]

[0046] ;

[0047] wherein, is the global model parameter at the th global iteration, is the local model parameter after adding noise, is the total number of participants, is the indicator function.

[0048] Optionally, the anomaly detection includes LOF anomaly detection and isolated forest anomaly detection; the anomaly detection comprehensive score is:

[0049] ; ​​

[0050] in, and Participants The LOF anomaly detection score and the isolated forest anomaly detection score.

[0051] Optionally, the preprocessing of historical carbon emission monitoring data for each participant includes standardizing the carbon emission monitoring data using a time-series correlation sensing method.

[0052] ;

[0053] ;

[0054] in, for Participants at the time Standardized dimensions d Monitoring data, These are the raw carbon emission monitoring data observations before standardization. and Participants Dimensions d The time-series mean and time-series labeled difference of the monitoring data. This is a parameter for adjusting time-series correlation. The attenuation coefficient is... The number of time lag steps. As a participant The total length of the monitoring data time series, for Participants at the time Dimensions before standardization d Carbon emission monitoring data observations, It is a natural exponential function.

[0055] Secondly, a carbon emission prediction system based on federated learning and differential privacy protection is provided, including:

[0056] Local training module: Local training is performed on the local models of each participant in the collaborative modeling. The local model is the initialized global model. During local training, the historical carbon emission monitoring data of each participant are preprocessed.

[0057] Reliability scoring module: Performs reliability analysis on the local model after local training from the perspectives of data quality and model quality, and obtains a reliability score;

[0058] Differential privacy protection module: It uses the reliability scores of each participant to perform dynamic privacy budget allocation and quality-aware noise adjustment in order to perform differential privacy protection on the local model parameters trained locally by each participant.

[0059] federated learning module: adaptively improving the aggregation strategy of the global model according to the reliability scores of the participants and the anomaly detection of the obtained local model parameters, and aggregating the model parameters of all participants after privacy protection based on the improved aggregation strategy to generate a new global model; and optimizing the global model in the framework of federated learning in a multi-round iterative training manner until a final global model is generated;

[0060] prediction module: predicting the carbon emissions of each participant based on the carbon emission monitoring data of each participant using the final global model.

[0061] In a third aspect, a computer device is provided, comprising a processor and a memory; wherein the processor implements the steps of the carbon emission prediction method based on federated learning and differential privacy protection according to any one of the first aspect when executing the computer program stored in the memory.

[0062] In a fourth aspect, a computer readable storage medium is provided for storing a computer program; the computer program is executed by a processor to implement the steps of the carbon emission prediction method based on federated learning and differential privacy protection according to any one of the first aspect.

[0063] Compared with the prior art, the beneficial effects of the present application are:

[0064] The federated learning architecture is adopted in the present application, and the original carbon emission data is always kept locally in each participant, which fundamentally avoids the leakage risk caused by data centralization; the dynamic differential privacy budget allocation and quality-aware noise adjustment are innovatively combined to realize a personalized privacy protection strategy, and the privacy protection strength is greatly improved compared with the fixed noise scheme; the adaptive learning rate and dynamic privacy budget allocation mechanism of the present application greatly improve the model convergence speed compared with the traditional federated average algorithm, and reduce the training rounds and communication overhead; the present application supports multiple carbon emission monitoring scenarios such as power, industry, transportation and construction, has good cross-domain adaptability, and improves the robustness; the present application adaptively improves the aggregation strategy of the global model according to the reliability scores of the participants and the anomaly detection of the local model parameters, which can effectively eliminate anomalies, thereby improving the model precision and improving the carbon emission prediction precision. BRIEF DESCRIPTION OF DRAWINGS

[0065] Figure 1 is a flowchart of the carbon emission prediction method based on federated learning and differential privacy protection of the present application;

[0066] Figure 2 is the final global model precision distribution thermograph of embodiment 2 of the present application;

[0067] Figure 3is a privacy-accuracy and quality trade-off space diagram of embodiment 2 of the present application;

[0068] Figure 4 is a dynamic privacy budget allocation schematic diagram of embodiment 2 of the present application;

[0069] Figure 5 is a reliability score schematic diagram of multiple participants of embodiment 2 of the present application;

[0070] Figure 6 is a visual analysis schematic diagram of a dynamic convergence process of embodiment 2 of the present application;

[0071] Figure 7 is a monitoring schematic diagram of anomaly detection of embodiment 2 of the present application;

[0072] Figure 8 is a participant contribution and quality analysis schematic diagram of embodiment 2 of the present application. DETAILED DESCRIPTION

[0073] The present application will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the protection scope of the present application. It should be noted that the terms "comprise" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0074] Embodiment 1

[0075] As shown in Figure 1 , a carbon emission prediction method based on federated learning and differential privacy protection includes the following steps:

[0076] S1: respectively train local models of each participant participating in collaborative modeling, the local model is an initialized global model, and when training locally, respectively preprocess historical carbon emission monitoring data of each participant.

[0077] Participants refer to various institutions that have carbon emission monitoring data, including power companies, industrial enterprises, environmental protection departments, third-party detection institutions, etc. The sources of carbon emission monitoring data of each participant include: power plant unit emission data, power grid load data of power companies; production process emission data, energy consumption data of industrial enterprises; regional environmental monitoring data, emission inventory data of environmental protection departments; third-party detection data, authentication data of detection institutions.

[0078] The preprocessing is to convert the original carbon emission monitoring data into a standardized format suitable for training, specifically, the carbon emission monitoring data is standardized by a time correlation aware method, it is worth noting that the preprocessing also includes other common contents such as denoising, enhancement, etc.

[0079] S11: Based on the original data statistical calculation:

[0080] ;

[0081] .

[0082] S12: Standardization processing:

[0083] ;

[0084] ;

[0085] wherein, is the participant the monitoring data after standardization processing, d is the original carbon emission monitoring data observation value before standardization processing, and are the time sequence mean and time sequence label difference of the monitoring data of the participant dimension , d is the time sequence correlation adjustment parameter, is the decay coefficient, usually selected as 0.1, is the time lag step number, is the total length of the monitoring data time sequence of the participant , is the carbon emission monitoring data observation value of the participant dimension before standardization processing. d S13: The initialized global model, as an optional LSTM-Attention hybrid architecture, fully excavates the time sequence pattern and long-term dependence relationship of the carbon emission data, and ensures that the model can accurately predict and has good generalization ability through a composite loss function.

[0086] Specifically, the composite loss function of the local model is:

[0087]

[0088] ;

[0089] wherein, , ,​​ and These are the corresponding loss weights, which can be optionally... ; For mean square error loss, For regularization loss, such as L2 regularization, For timing loss, This refers to attention loss; specifically, the methods for obtaining various losses can refer to existing technologies.

[0090] In this application, the adaptive learning rate parameter is updated as follows:

[0091] ;

[0092] in, For adaptive learning rate, For local iteration Next time participants Model parameters.

[0093] S2: Perform a reliability analysis on the local model after local training from the perspectives of data quality and model quality, and obtain a reliability score.

[0094] In this embodiment, in terms of data quality, scores for three indicators—completeness, consistency, and temporal stability—are obtained; in terms of model quality, scores for two indicators—training quality and parameter convergence stability—are obtained. The scores of all indicators are weighted and fused to obtain the reliability score of each participant.

[0095] Specifically, the participating parties Reliability rating for:

[0096] ;

[0097] in, As a participant The reliability score ranges from [0,1]. As a participant The The scores of each indicator for The weight, as an option, .

[0098] Among them, the participating parties Data integrity index score for:

[0099] ;

[0100] Participants Data consistency index score is:

[0101] ;

[0102] the score of the data time series stability indicator of the participant is:

[0103] ;

[0104] the score of the local model training quality indicator of the participant is:

[0105] ;

[0106] the score of the model parameter convergence stability indicator of the participant is:

[0107] ;

[0108] wherein, is the total number of missing data points, is the total length of the monitoring data time series of the participant is the total dimension of the carbon emission monitoring data, and are the skewness coefficient and the coefficient of variation of the carbon emission monitoring data in dimension d , respectively; and are the carbon emission prediction value and the label value outputted by the participant t and are the pre-processed and non-pre-processed carbon emission monitoring data, respectively; is the variance function, is the time series derivative of the normalized data in dimension d is the gradient of the loss function with respect to the local model parameter is the square of the L2 norm, is the natural exponential function.

[0109] S3: Utilize the reliability score of each participant to perform dynamic privacy budget allocation and quality-aware noise adjustment to protect the local model parameters of each participant after local training with differential privacy.

[0110] ​​​​​​​​Before uploading the model parameters to the federated server in each participating direction, the model parameters are protected by differential privacy based on the reliability score of step S2. Through dynamic privacy budget allocation and quality-aware noise adjustment, the model utility is maximized while protecting data privacy.

[0111] Step S3 is specifically:

[0112] S31: Construct Convergence-aware factor at the time of sub-global iteration :

[0113] ;

[0114] Wherein, and are and global model parameters at the time of sub-global iteration, is the convergence judgment variance parameter, which can be 0.01.

[0115] S32: Use the reliability score and the convergence-aware factor of each participant to perform dynamic privacy budget allocation.

[0116] ;

[0117] Wherein, is the dynamic privacy budget allocated at the time of sub-global iteration, is the basic privacy budget, which is optionally 0.1, is the mean of the reliability scores of all participants, is the total number of global iterations, , and are , and corresponding weights.

[0118] S33: Use the reliability score of each participant to construct a quality-aware noise adjustment function, calculate the noise variance, and add adaptive noise to the parameters after training the model.

[0119] ;

[0120] ;

[0121] ;

[0122] Wherein, is the quality-aware noise adjustment function of participant , reliability score threshold, preferably 0.6, parties In the first round of global training, the variance of the Gaussian noise added, failure probability in differential privacy, preferably , change in global sensitivity squared after gradient or parameter update, local model parameters of the parties in the first round of global training, local model parameters after adding noise; identity matrix, noise with mean 0 and covariance matrix .

[0123] S4: adaptively improve the aggregation strategy of the global model according to the reliability scores of the parties and the anomaly detection results of the obtained local model parameters, and aggregate the model parameters of all parties after privacy protection based on the improved aggregation strategy to generate a new global model; optimize the global model in the framework of federated learning in the form of multiple rounds of iterative training until the final global model is generated.

[0124] The specific steps of aggregation are:

[0125] E1: perform anomaly detection on the local model parameters after adding noise, and obtain an anomaly detection comprehensive score .

[0126] Anomaly detection includes LOF anomaly detection and Isolation Forest anomaly detection, which can be referred to in the prior art. The anomaly detection comprehensive score is:

[0127] ;

[0128] wherein, and are the LOF anomaly detection score and the Isolation Forest anomaly detection score of the party , respectively.

[0129] E2: adaptively adjust the weight of the aggregation of the model parameters of each party according to the reliability score and the anomaly detection comprehensive score of each party;

[0130] ;

[0131] wherein, is the aggregation weight of the party , is the aggregation weight of the party the number of samples, , is the temporary index of the current participant; is the local model parameter of the current participant at the th global iteration is the median of the is the median distance adjusted variance;

[0132] E3: aggregate the model parameters of all participants after privacy protection to obtain the parameters of the new global model;

[0133] ;

[0134] wherein, is the global model parameter at the th global iteration, is the local model parameter after adding noise, is the total number of participants, is the indicator function.

[0135] Convergence judgment is performed on the generated new global model parameters, and comparison analysis is performed with historical parameters. If it is judged that it has not converged, the global parameters are distributed to each participant, and the step S1 is returned to continue training. If it has converged, the final model is output, and the entire collaborative modeling process is completed.

[0136] Multi-index convergence judgment: ;

[0137] Stability convergence judgment: ;

[0138] Model update decision: if or the maximum number of rounds is reached, the training is ended. Otherwise, the is distributed to each participant, and the step S1 is returned to continue training until the global model meets the convergence requirement. Wherein, is the logical AND operator.

[0139] S5: based on the carbon emission monitoring data of each participant, the final global model is used to predict the carbon emissions of each participant.

[0140] Embodiment 2

[0141] A specific example of applying the prediction method of the present application to predict the carbon emissions of a certain region is provided.

[0142] There are 5 participants in total: power company A, which has data of thermal power unit operation; industrial enterprise B, which has data of new energy power generation; environmental protection department C, which has regional environmental monitoring data; third-party detection agency D, which has carbon emission verification data; and power company E, which has data of coal-fired power plant emissions.

[0143] Step 1: Local data preprocessing and standardization of each participant.

[0144] Take participant 1 as an example to explain the data preprocessing process in detail.

[0145] 1.1 Raw data input: the raw time series data set of participant 1 is represented as: ;

[0146] wherein, is the number of hours in a year, is the number of data dimensions. The specific meanings of each dimension are as follows: dimension 1: power generation, unit MWh; dimension 2: coal consumption, unit tons; dimension 3: unit load rate, unit %; dimension 4: environmental temperature, unit ℃. Specific data examples are as follows: , , , .

[0147] 1.2 Calculation of statistical parameters.

[0148] Calculate the statistical parameters of the power generation of dimension 1.

[0149] Time series mean:

[0150] Time series standard deviation: .

[0151] 1.3 Calculation of time series correlation parameters

[0152] Calculate the adjustment parameter : ;

[0153] wherein . The specific calculation process is as follows: for : the autocorrelation coefficient is 0.85; for to : the autocorrelation coefficients are 0.72, 0.58, 0.45, 0.33, 0.22, 0.15, 0.09, 0.05, 0.02, respectively. Therefore: .

[0154] 1.4 Time series correlation perception standardization

[0155] The standardization calculation of the data of the first hour and the first dimension is as follows: ; output: standardized dataset , and the standardization value ranges of each dimension are [-2.1, 2.3], [-1.8, 2.0], [-1.5, 1.9], and [-2.2, 2.1], respectively.

[0156] Step 2: Local deep learning model training by each participant

[0157] Take participant 1 as an example to illustrate the local model training process.

[0158] 2.1 Training data preparation

[0159] The input data includes a standardized feature matrix: a carbon emission label vector: , where represents the CO2 emissions (unit: tons) of the first hour.

[0160] 2.2 Composite loss function construction

[0161] Loss function formula: ; where , , , . Mean squared error loss calculation: ; specific numerical examples: for the first 3 time points, , , the error square is 19.36; the calculated .

[0162] 2.3 Adaptive learning rate parameter update

[0163] Parameter update rule: 1st round: 10th round: ; 50th round:

[0164] Update of a certain weight parameter: ; Step output: after 80 rounds of training convergence, the local model parameters , training loss , and validation accuracy are obtained.

[0165] Step 3: Local data quality evaluation by each participant

[0166] Take participant 1 as an example to illustrate the reliability evaluation calculation process.

[0167] 3.1 Data integrity index calculation ;

[0168] Specific calculation: missing data points: Total data points: Skewness of each dimension: , and 0.05 respectively. Therefore: .

[0169] 3.2 Data consistency index calculation

[0170] Coefficient of variation of each dimension: , and 0.156 respectively. Therefore: .

[0171] 3.3 Time series stability calculation

[0172] Time series derivative approximation calculation: ; the variance of the time series derivative of each dimension is 0.045, 0.038, 0.052, and 0.041 respectively. Therefore: .

[0173] 3.4 Model fitting quality calculation

[0174] Relative error calculation example: ; the average relative error is 0.0082. Therefore: .

[0175] 3.5 Parameter convergence stability calculation

[0176] The gradient norm calculation is 0.0025. Therefore: .

[0177] 3.6 Reliability score calculation

[0178] Where the weight coefficient , , , . Calculation: .

[0179] Step output: the reliability score of participant 1 .

[0180] Step 4: Local differential privacy protection for each participant

[0181] Take participant 1 in the 15th round of training as an example to illustrate the differential privacy protection process.

[0182] 4.1 Dynamic privacy budget calculation, where , , . Convergence awareness factor calculation: ; the average quality of the current round: . Therefore: .

[0183] 4.2 Quality-aware noise adjustment

[0184] Since , adopt high-quality branch: .

[0185] 4.3 Noise variance calculation

[0186] Where sensitivity , failure probability , calculated: .

[0187] 4.4 Differential privacy noise addition

[0188] Add independent Gaussian noise to each component of the model parameter. Take a weight parameter as an example: ; Step output: noisy model parameters of party 1 after adding noise .

[0189] Step 5: Federated server robust aggregation and anomaly detection

[0190] 5.1 Data reception: the federated server receives the data uploaded by each party: disturbance parameters: Quality score: Sample size: .

[0191] 5.2 Anomaly detection: LOF and Isolation Forest anomaly score calculation results of each party: Party 1: , Party 2: , Party 3: , Party 4: , Party 5: , . Comprehensive anomaly score: ; Party 5 is judged as an anomaly and will be excluded.

[0192] 5.3 Robust weight calculation: calculate the distance of each party to the median 0.015, set , after excluding the abnormal party 5, the normalized weight is: .

[0193] 5.4 Adaptive aggregation: since , exclude party 5, and perform weighted aggregation on the remaining parties: ; Step output: aggregated global model parameters .

[0194] Step 6: Federal server convergence judgment and model distribution

[0195] 6.1 Parameter convergence judgment: The parameter convergence condition is not met.

[0196] 6.2 Loss convergence judgment: The loss convergence condition is not met.

[0197] 6.3 Stability judgment: The stability condition is not met.

[0198] 6.4 Training decision: according to the multi-index convergence judgment in the disclosure: Since it is not converged and the current round is 15 < 100, continue training. Distribute to each participant, and return to step 2.

[0199] Iterative training process: 16th round to 84th round training, each participant receives the global parameter , updates the local model, repeats steps 2 to 6, and stops at the 85th round.

[0200] 85th round convergence judgment, parameter convergence check: Loss convergence check: Stability check: Convergence judgment Training is completed, and the final model is output .

[0201] Table 1: Carbon emission monitoring data statistics of each participant

[0202]

[0203] Comparison of other existing federated learning methods with the method of the present application:

[0204] Table 2: Performance comparison experimental results of different federated learning methods

[0205]

[0206] According to Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 , Figure 8As can be seen from Table 2, in terms of model performance indicators, the method of the present application 0.0847, 31.4% higher than FedAvg, mean absolute error (MAE): 0.0623, optimal in the federal learning method, determination coefficient (R2): 0.9456, indicating that the model has strong explanation ability; in terms of training efficiency, convergence rounds: 42 rounds of convergence, 46.2% faster than FedAvg, 55.8% faster than the fixed DP method. Training time: 34.5 minutes, efficiency is significantly improved, saving 34.0% compared with the traditional method. Communication overhead: 187.3MB, saving 37.3% compared with FedAvg, the communication compression effect is obvious. In terms of resource consumption, memory usage: 1.78GB, resource friendly; CPU utilization: 68.2%, reasonable resource utilization, avoiding overload; in terms of security, privacy protection strength: 0.952, it is the only high-performance federal learning method that provides strong privacy protection. Abnormal detection rate: 95.7%, significantly better than other methods, effectively identifying malicious participants. Poisoning resistance: 0.87, still maintains high performance under the condition of 30% malicious participants. In terms of economic benefits, cost saving rate: 56.2%, considering the communication, calculation, storage, compliance and other costs, the overall total cost is significantly reduced compared with the prior art.

[0207] Embodiment 3

[0208] A carbon emission prediction system based on federal learning and differential privacy protection comprises:

[0209] A local training module: locally trains local models of each participant involved in collaborative modeling, wherein the local model is an initialized global model, and the historical carbon emission monitoring data of each participant is preprocessed during local training;

[0210] A reliability scoring module: performs reliability analysis on the local model after local training from the aspects of data quality and model quality to obtain a reliability score;

[0211] A differential privacy protection module: performs dynamic privacy budget allocation and quality-aware noise adjustment using the reliability score of each participant to protect the local model parameters of each participant after local training by differential privacy;

[0212] A federal learning module: adaptively improves the aggregation strategy of the global model according to the reliability score of each participant and the abnormal detection situation of the obtained local model parameters, and aggregates the model parameters of all participants after privacy protection based on the improved aggregation strategy to generate a new global model; the global model is optimized in the framework of federal learning in a multi-round iterative training manner until the final global model is generated;

[0213] Prediction module: based on the carbon emission monitoring data of each participant, the final global model is used to predict the carbon emissions of each participant.

[0214] Embodiment 4

[0215] The present application provides a computer device, comprising a processor and a memory; wherein the processor implements the steps of the above-mentioned carbon emission prediction method based on federated learning and differential privacy protection when executing the computer program stored in the memory.

[0216] The more specific process of the above method can refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.

[0217] Embodiment 5

[0218] The present application provides a computer readable storage medium for storing a computer program; the computer program is executed by the processor to implement the steps of the above-mentioned carbon emission prediction method based on federated learning and differential privacy protection.

[0219] The more specific process of the above method can refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.

[0220] In the present specification, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between each embodiment can be referred to each other. For the system, device and storage medium disclosed by the embodiments, since it corresponds to the method disclosed by the embodiments, the description is relatively simple, and the related part can be referred to the method part.

[0221] Those skilled in the art can clearly understand that the technology in the embodiments of the present application can be realized by means of software and necessary general hardware platform. Based on such understanding, the technical solutions in the embodiments of the present application can be embodied in the form of software product, which can be stored in storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including a plurality of instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the method described in the embodiments of the present application or some parts of the embodiments.

[0222] The above is only the preferred embodiment of the present application, and the protection scope of the present application is not limited to the above-mentioned embodiments. Any technical solution falling within the idea of the present application shall fall within the protection scope of the present application. It should be noted that, for ordinary skilled in the art, some improvements and refinements without departing from the principle of the present application shall be regarded as the protection scope of the present application.

Claims

1. A carbon emission prediction method based on federated learning and differential privacy protection, characterized in that, include: Local training is performed on the local models of each participant in the collaborative modeling. The local models are initialized global models. During local training, the historical carbon emission monitoring data of each participant are preprocessed. The reliability of the locally trained model is analyzed from both data quality and model quality perspectives to obtain a reliability score. Dynamic privacy budget allocation and quality-aware noise adjustment are performed using the reliability scores of each participant to provide differential privacy protection for the local model parameters trained locally by each participant; specifically: Build Convergence perception factor during subglobal iteration : ; in, and They are respectively and Global model parameters during the next global iteration To determine the variance parameter for convergence, The square of the L2 norm. It is a natural exponential function; Dynamic privacy budget allocation is performed using the reliability scores and convergence perception factors of each participant; ; in, for Dynamic privacy budget allocated during the next global iteration Based on privacy budget, The mean of the reliability scores for all participants. This represents the total number of iterations in the global iteration. , and They are respectively , and The corresponding weights; Using the reliability scores of each participant, a quality-perceived noise adjustment function is constructed, the noise variance is calculated, and adaptive noise is added to the parameters after training the Benley model. ; ; ; in, As a participant The quality-perceived noise adjustment function, As a participant Reliability rating, The set reliability score threshold, As a participant In the The variance of the Gaussian noise added during global training. This represents the failure probability in differential privacy. This represents the change in the squared global sensitivity after the gradient or parameter update. In the first Participants in global training Local model parameters, In the first Participants in global training Local model parameters after adding noise; It is the identity matrix. With a mean of 0, the covariance matrix is Noise with a multivariate Gaussian distribution; Based on the reliability scores of each participant and the anomaly detection of the obtained local model parameters, an aggregation strategy is adopted to adaptively improve the global model. Based on the improved aggregation strategy, the privacy-preserving model parameters of all participants are aggregated to generate a new global model. The global model is optimized through multiple rounds of iterative training under the framework of federated learning until the final global model is generated. Based on the carbon emission monitoring data of each participant, the final global model is used to predict the carbon emissions of each participant separately.

2. The carbon emission prediction method based on federated learning and differential privacy protection according to claim 1, characterized in that, The reliability analysis specifically includes: Regarding data quality, scores are obtained for three indicators: completeness, consistency, and temporal stability. Regarding model quality, scores are obtained for two indicators: training quality and parameter convergence stability. The scores of all indicators are weighted and fused to obtain a reliability score for each participant. Specifically, the participants... Reliability rating for: ; in, As a participant Reliability rating, As a participant The The scores of each indicator for The weight.

3. The carbon emission prediction method based on federated learning and differential privacy protection according to claim 2, characterized in that, Participants Data integrity index score for: ; Participants Data consistency index score for: ; Participants Data time series stability index score for: ; Participants The score of the local model training quality metric for: ; Participants The model parameter convergence stability index score for: ; in, This represents the total number of missing data points. As a participant The total length of the monitoring data time series, The overall dimension of carbon emission monitoring data. and Dimensions d The skewness coefficient and coefficient of variation of carbon emission monitoring data; and They are respectively t Participants at the time Carbon emission predictions and label values ​​output by the local model; and These are carbon emission monitoring data with and without pretreatment, respectively. It is the variance function. For dimension d The time derivative of standardized data, For the loss function with respect to local model parameters gradient, The square of the L2 norm. It is a natural exponential function.

4. The carbon emission prediction method based on federated learning and differential privacy protection according to claim 1, characterized in that, The aggregation strategy, which adaptively improves the global model based on the reliability scores of each participant and the anomaly detection results of the acquired local model parameters, and aggregates the privacy-preserving model parameters of all participants based on the improved aggregation strategy, specifically involves: Anomaly detection is performed on the parameters of the local model after adding noise, and a comprehensive anomaly detection score is obtained. ; The weights of the aggregated model parameters of each participant are adaptively adjusted based on the reliability scores and anomaly detection scores of each participant. ; in, As a participant Aggregate weights, As a participant Reliability rating, As a participant The number of samples, , A temporary index for the current participants; In order to be in Local model parameters of all participants during the next global iteration the median of The variance is adjusted by the median distance. The square of the L2 norm. It is a natural exponential function; Aggregate the privacy-protected model parameters of all participants to obtain the parameters of a new global model; ; in, for Global model parameters during the next global iteration These are the parameters of the local model after adding noise. The total number of participants. This is an indicator function.

5. The carbon emission prediction method based on federated learning and differential privacy protection according to claim 4, characterized in that, The anomaly detection includes: LOF anomaly detection and Isolated Forest anomaly detection; the anomaly detection comprehensive score... for: ; in, and Participants The LOF anomaly detection score and the isolated forest anomaly detection score.

6. The carbon emission prediction method based on federated learning and differential privacy protection according to claim 1, characterized in that, The preprocessing of historical carbon emission monitoring data for each participant includes standardizing the carbon emission monitoring data using a time-series correlation sensing method. ; ; in, for Participants at the time Standardized dimensions d Monitoring data, These are the raw carbon emission monitoring data observations before standardization. and Participants Dimensions d The time-series mean and time-series labeled difference of the monitoring data. This is a parameter for adjusting time-series correlation. The attenuation coefficient is... The number of time lag steps. As a participant The total length of the monitoring data time series, for Participants at the time Dimensions before standardization d Carbon emission monitoring data observations, It is a natural exponential function.

7. A carbon emission prediction system based on federated learning and differential privacy protection, characterized in that, include: Local training module: Local training is performed on the local models of each participant in the collaborative modeling. The local model is the initialized global model. During local training, the historical carbon emission monitoring data of each participant are preprocessed. Reliability scoring module: Performs reliability analysis on the local model after local training from the perspectives of data quality and model quality, and obtains a reliability score; Differential privacy protection module: It uses the reliability scores of each participant to perform dynamic privacy budget allocation and quality-aware noise adjustment in order to perform differential privacy protection on the local model parameters trained locally by each participant. Federated learning module: Based on the reliability scores of each participant and the anomaly detection of the acquired local model parameters, it adaptively improves the aggregation strategy of the global model, and aggregates the privacy-preserving model parameters of all participants based on the improved aggregation strategy to generate a new global model; under the framework of federated learning, it optimizes the global model through multiple rounds of iterative training until the final global model is generated. Prediction module: Based on the carbon emission monitoring data of each participant, the module uses the final global model to predict the carbon emissions of each participant separately. The differential privacy protection module utilizes the reliability scores of each participant to dynamically allocate the privacy budget and adjust the quality-aware noise, thereby protecting the local model parameters trained locally by each participant. Specifically: Build Convergence perception factor during subglobal iteration : ; in, and They are respectively and Global model parameters during the next global iteration To determine the variance parameter for convergence, The square of the L2 norm. It is a natural exponential function; Dynamic privacy budget allocation is performed using the reliability scores and convergence perception factors of each participant; ; in, for Dynamic privacy budget allocated during the next global iteration Based on privacy budget, The mean of the reliability scores for all participants. This represents the total number of iterations in the global iteration. , and They are respectively , and The corresponding weights; Using the reliability scores of each participant, a quality-perceived noise adjustment function is constructed, the noise variance is calculated, and adaptive noise is added to the parameters after training the Benley model. ; ; ; in, As a participant The quality-perceived noise adjustment function, As a participant Reliability rating, The set reliability score threshold, As a participant In the The variance of the Gaussian noise added during global training. This represents the failure probability in differential privacy. This represents the change in the squared global sensitivity after the gradient or parameter update. In the first Participants in global training Local model parameters, In the first Participants in global training Local model parameters after adding noise; It is the identity matrix. With a mean of 0, the covariance matrix is Noise with a multivariate Gaussian distribution.

8. A computer device, characterized in that, It includes a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the steps of the carbon emission prediction method based on federated learning and differential privacy protection as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, Used to store computer programs; when executed by a processor, the computer programs implement the steps of the carbon emission prediction method based on federated learning and differential privacy protection as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Privacy protection type data joint modeling method based on federal learning

    CN120744982A