Carbon emission prediction method and system based on multi-source heterogeneous data contrast learning
By adopting a multi-source heterogeneous data comparison learning method in carbon emission prediction, and using improved CNN-ISDAE network and comparison learning technology, the problem of insufficient comprehensive processing of multi-source heterogeneous data in the existing technology is solved, and the accuracy of carbon emission prediction is improved.
Patent Information
- Application Number
- CN202411601928.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-04
AI Technical Summary
The prior art is difficult to effectively process multi-source heterogeneous carbon emission data, which leads to the inability of deep learning models to deeply explore the correlation information between the data when predicting carbon emissions, and the prediction results are not accurate enough.
The carbon emission prediction method based on multi-source heterogeneous data comparison learning is adopted. By acquiring and preprocessing carbon emission data, the feature selection method is used to extract features, and an improved CNN-ISDAE network is built for time series data learning and fusion, and the comparison learning optimization prediction results are introduced.
The accuracy of carbon emission prediction is improved, the timing and multi-source heterogeneity of carbon emissions are fully taken into account, and the timing feature information of different time scales can be more effectively learned and fused.
Smart Images

Figure CN119558678A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of carbon emission prediction, and in particular to a carbon emission prediction method and system based on multi-source heterogeneous data comparative learning. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] In the current electricity consumption context, carbon emission data is multi-source and heterogeneous, with complex influencing factors. With the expansion of electricity consumption, the rapid increase in data volume and the emergence of complex correlations between different indicators, the prediction of carbon emissions has become increasingly difficult. With the continuous advancement of artificial intelligence and deep learning technology, deep learning technology has gradually been applied to the solution of carbon emission related problems.
[0004] Studies have shown that data of different dimensions will affect the learning effect of neural networks, so further processing is required when using multivariate heterogeneous data. In addition, since data usually has significant time series, when predicting carbon emissions, it is necessary not only to extract key features from the data, but also to accurately capture its time series information to improve the accuracy of the prediction. At present, due to the complexity of carbon emission data, deep learning does not process multi-source heterogeneous data comprehensively, and cannot deeply mine the correlation information between data, resulting in inaccurate prediction results. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a carbon emission prediction method and system based on comparative learning of multi-source heterogeneous data, which fully considers the temporal series and multi-source heterogeneity of carbon emissions, integrates temporal feature information from different time scales, and introduces comparative learning methods to learn more effective feature representation vectors, thereby improving the accuracy of carbon emission prediction.
[0006] In order to achieve the above object, the present invention is implemented through the following technical solutions:
[0007] A first aspect of the present invention provides a carbon emission prediction method based on multi-source heterogeneous data comparative learning, comprising the following steps:
[0008] Obtain the carbon emission data to be predicted and pre-process the carbon emission data;
[0009] The features of the preprocessed carbon emission data are extracted using feature selection methods to obtain an enhanced representation vector;
[0010] The enhanced representation vector is processed by using the carbon emission prediction model to obtain the carbon emission prediction result, wherein the process of processing the enhanced representation vector by using the carbon emission prediction model includes: performing time series data learning and fusion on the enhanced representation vector to obtain a comprehensive representation vector and a weighted fusion vector, using the comprehensive representation vector and the weighted fusion vector to predict carbon emissions, and using contrastive learning to calculate the comprehensive representation vector, and optimizing the carbon emission prediction result according to the calculation result.
[0011] Further, the carbon emission data includes electricity generation data, fuel consumption data, historical carbon emission data, and weather and climate data.
[0012] Furthermore, the preprocessing step includes normalizing the data.
[0013] Furthermore, the specific steps of extracting the features of the preprocessed carbon emission data using the feature selection method are as follows:
[0014] A feature selector based on Spearman correlation analysis is used to select the features most relevant to carbon emission prediction and obtain an enhanced representation vector.
[0015] Furthermore, the construction process of the carbon emission prediction model includes:
[0016] Obtain known data sets with data at different time scales, and perform preprocessing and feature selection operations on the known data sets;
[0017] Construct a carbon emission prediction model and use the data after feature selection to train the carbon emission prediction model, where the training process includes time series data learning, carbon emission prediction and carbon emission prediction model parameter optimization;
[0018] The trained carbon emission prediction model is tested using data that has not participated in the training, and the parameters of the carbon emission prediction model are adjusted according to the test results.
[0019] Furthermore, the data of different time scales include three time scales of data: current time, the same time of the previous week, and the same period of last year.
[0020] Furthermore, the steps of time series data learning include:
[0021] Use convolutional neural networks to extract features from data at different time scales;
[0022] The attention mechanism is used to fuse the extracted features to obtain a weighted fusion vector;
[0023] A shallow denoising autoencoder is used to extract features from the weighted fusion vector to obtain a comprehensive representation vector.
[0024] Furthermore, the steps of carbon emission forecasting include:
[0025] The deep neural network was used to process the weighted fusion vector and the comprehensive representation vector to obtain the carbon emission prediction results.
[0026] Furthermore, the carbon emission prediction model parameter optimization steps include:
[0027] Calculate the first loss value of the comprehensive representation vector using contrastive learning;
[0028] Calculate the second loss value of the predicted value using the discriminant function;
[0029] Add the first loss value and the second loss value to get the overall loss function value;
[0030] The minimum overall loss function value is iteratively solved to obtain the learning parameters of the carbon emission prediction model.
[0031] A second aspect of the present invention provides a carbon emission prediction system based on multi-source heterogeneous data comparative learning, comprising:
[0032] A data preprocessing module is configured to obtain carbon emission data to be predicted and preprocess the carbon emission data;
[0033] A feature selection module is configured to extract features of the preprocessed carbon emission data using a feature selection method to obtain an enhanced representation vector;
[0034] A model processing module is configured to process the enhanced representation vector using a carbon emission prediction model to obtain a carbon emission prediction result;
[0035] Among them, the model processing module includes:
[0036] A time series data learning module is configured to perform time series data learning and fusion on the enhanced representation vector to obtain a comprehensive representation vector and a weighted fusion vector;
[0037] A carbon emission prediction module is configured to perform carbon emission prediction using a comprehensive representation vector and a weighted fusion vector;
[0038] The contrastive learning module is configured to calculate the comprehensive representation vector using contrastive learning and optimize the carbon emission prediction result according to the calculation result.
[0039] One or more of the above technical solutions have the following beneficial effects:
[0040] The present invention discloses a carbon emission prediction method and system based on comparative learning of multi-source heterogeneous data, which fully considers the temporal nature of carbon emissions, collects data at three time scales: the current time node, the previous week, and the same period of the previous year, and introduces a feature selector based on Spearman correlation analysis (SCA) to select and filter feature inputs for training.
[0041] Based on the information obtained at three time scales, the present invention proposes an improved CNN-ISDAE network to better learn and fuse the temporal feature information from different time scales to generate a comprehensive representation vector; introduces contrastive learning, calculates the contrastive learning loss value, increases the distance between the representation vectors of abnormal samples and normal samples, and shortens the distance between the representation vectors of positive samples, thereby improving the accuracy of showdown prediction.
[0042] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0044] Figure 1 A flowchart of a carbon emission prediction model construction process of a carbon emission prediction method according to a first embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of a data stream processing process of a carbon emission prediction method according to a first embodiment of the present invention;
[0046] Figure 3 This is a flow chart of a carbon emission prediction method according to Embodiment 1 of the present invention;
[0047] Figure 4 This is a schematic diagram of the structure of a carbon emission prediction system according to Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0048] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0049] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "include" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or their combinations;
[0050] Embodiment 1:
[0051] The first embodiment of the present invention provides a carbon emission prediction method based on multi-source heterogeneous data comparative learning, constructs a carbon emission prediction model that can fully process multi-source heterogeneous carbon emission data, and uses the carbon emission prediction model to accurately predict the carbon emission data to be predicted. Figure 1 As shown in the figure, for the construction process of the carbon emission prediction model, firstly, based on the historical communication data, the collected raw data is normalized by applying the min-max normalization method to make each indicator at the same order of magnitude; then, the data of the three normalized time scales are used to screen the data features using the feature selector based on Spearman correlation analysis (SCA) to select the features most relevant to the carbon emission prediction; using the enhanced representation vectors on the three time scales obtained, an improved CNN-LSTM network based on multiple time scales is proposed for feature learning; specifically, a one-dimensional convolutional neural network is first used to extract features, and redundant information is removed to obtain a network containing only The representative low-dimensional representation vector of key information is obtained; then, the low-dimensional representation vectors on the three time scales are obtained, and the attention mechanism feature fusion method is used to assign different attention weights to them for fusion, so as to generate a weighted fused representation vector; then, ISDAE feature extraction is used to learn the fused weighted fusion vector to obtain a comprehensive representation vector; then, the obtained comprehensive representation vector is sent to the contrast learning module and the carbon emission prediction module respectively. The contrast learning module constructs a set of positive and negative samples through data labels, and calculates the contrast loss value between positive and negative samples; the carbon emission prediction module uses the DNN network optimized by IPSO to predict carbon emissions, and calculates the Huber Loss loss function to obtain the carbon emission prediction loss value; then, based on the obtained contrast loss value and carbon emission prediction loss value, the gradient back propagation algorithm is used to adjust the parameters in the model; after the model training is completed, the data that did not participate in the training process is used for testing, the model test results are compared with the actual situation, and the model is optimized and adjusted, so as to continuously optimize the weight data in the model and continuously improve the accuracy of carbon emission prediction.
[0052] The data processing process in this embodiment is as follows Figure 2As shown, after the maximum and minimum normalization operation, the power data is represented by a vector, and after feature selection, it is input into a convolutional neural network module based on multiple time scales. For the three currently selected time series of different scales (current time series 1, current time series 2, current time series 3), the current low-dimensional representation vector, the low-dimensional representation vector of one week, and the low-dimensional representation vector of one year are obtained through the convolutional neural network layer respectively. The three vectors are fused using the attention feature, and feature extraction is performed. After that, the extracted features are subjected to comparative learning and improved parameter optimization. The improved parameter optimization steps are as follows: the IPSO optimization method is used to dynamically adjust the parameters based on the initialization of the Chebyshev function, and then the objective function of minimizing the prediction error is used to output the optimal parameters. The output optimal parameters are input into the prediction engine to obtain the final prediction results. This embodiment uses the DNN network results as the prediction engine.
[0053] The method specifically comprises the following steps:
[0054] Step 1: Obtain the carbon emission data to be predicted and preprocess the carbon emission data.
[0055] Step 1.1: Obtain carbon emission data to be predicted, wherein the carbon emission data includes electricity generation data, fuel consumption data, historical carbon emission data, and weather and climate data.
[0056] Step 1.2: The preprocessing step involves normalizing the data.
[0057] Due to the wide coverage of the data, there are different dimensions and dimensional units between data indicators, which affects the data analysis results. In order to eliminate the impact of dimensions between different data indicators, the Min-Max normalization method is first applied to each dimension of the collected feature data x to normalize them so that each indicator is at the same order of magnitude:
[0058]
[0059] Among them, max() is a method for taking the maximum value of a certain dimension of eigenvalues, min() is a method for taking the minimum value of the eigenvalues of that dimension, and x′ is the normalized data.
[0060] Step 2: Use feature selection method to extract the features of preprocessed carbon emission data and obtain enhanced representation vector.
[0061] In this embodiment, the normalized data is used to select the features most relevant to the carbon emission prediction using a feature selector based on Spearman correlation analysis to obtain an enhanced representation vector.
[0062] Step 2.1: Based on the feature data x′ of each dimension preprocessed in step 1, the feature representation vector V of carbon emissions at a certain moment can be obtained, as follows:
[0063] V=[x′1,x′2,...x′ n ]
[0064] where x′ i Represents each feature x i The normalized value is taken from the Min-Max normalization formula in step 1.2.
[0065] Based on the historical data of carbon emissions, different features have different relevance to carbon emissions. By using Spearman correlation analysis (SCA) to perform feature selection on the time series enhancement vector, the SCA level of each feature is calculated, and the features most relevant to carbon emission prediction are screened out. Among them, the relevance of carbon emissions in this embodiment is measured by the rank correlation between the feature value and the carbon emissions. The Spearman correlation coefficient is a non-parametric statistical method used to measure the monotonic relationship between two variables, and is particularly suitable for time series data with nonlinear relationships. In this method, the correlation between different features and carbon emission data is quantified as a correlation coefficient, which is used to determine the importance of the feature. The feature space of the time series enhancement representation vector is much larger than the original time series feature space, which will be beneficial to identify the most representative features in a larger feature space through SCA, thereby improving the effectiveness of subsequent feature extraction and model training.
[0066] With two vectors: A = [a1, a2, ..., a n ] and B=[b1,b2,…,b n ] For example, first assign ranks to all elements of the two vectors, with the smallest element being assigned the lowest rank and vice versa. The rank ranges from 1 to the length of the vector. After assigning ranks, two new vectors are obtained, containing the ranks of vectors A and B respectively. The two new vectors are X = [x1, x2, …, x n ] and Y=[y1,y2,…,y n ] The SCA grade calculation formula is as follows:
[0067]
[0068]
[0069] Among them, SCA.Grade A,B represents the SCA level of vectors A and B, xt is the standard deviation of the level value of vector X, which represents the degree of dispersion of the data level in vector X, yt is the standard deviation of the level value of vector Y, which represents the degree of dispersion of the data level in vector Y, and xt is the standard deviation of the level value of vector Y. i and iare the i-th elements of the level vectors X and Y respectively, and n is the total number of elements.
[0070] After calculating the SCA level of all features, a threshold is set. If the SCA level of a feature is greater than the specified threshold, the feature is selected, otherwise the feature is excluded from the input of the prediction model. The feature selection formula is as follows:
[0071]
[0072] Step 3: Use the carbon emission prediction model to process the enhanced representation vector to obtain the carbon emission prediction result.
[0073] like Figure 3 As shown, we first need to build a carbon emission prediction model and train and evaluate it:
[0074] Step 3.1: Obtain a known data set with data of different time scales, and perform preprocessing and feature selection operations on the known data set. The data of different time scales include three time scale data of the current time, the same time of the previous week, and the same period of last year. In this embodiment, power data is collected through a power monitoring system to obtain sample data.
[0075] Step 3.1.1: Based on the data collected by the present invention at three time scales, namely, the current time, the same time of the previous week, and the same period of last year, the collected data are normalized using the min-max normalization method so that each indicator is at the same order of magnitude.
[0076] In a specific implementation, based on factual research, current carbon emission forecasts need to consider not only the current weather, but also other factors such as weather in different seasons or important times that may affect carbon emissions.
[0077] Therefore, a large amount of carbon emission data indicators are collected, including power generation data, fuel consumption data, historical carbon emission data, weather and climate data and other features at three time scales: current time, the same time of the previous week, and the same period of last year. In this embodiment, the three time scale data are marked as t1, t2, and t3 respectively. The acquired data is preprocessed, including data cleaning, missing value completion, and data normalization.
[0078] Specifically, it is based on data provided by a Chinese power company from June 28, 2020 to June 28, 2023. The data includes information such as power generation, fuel consumption, historical carbon emissions, and weather and climate at a certain point in time.
[0079] Step 3.1.2: Due to the wide coverage of the data, there are different dimensions and dimensional units between the data indicators, which affects the data analysis results. In order to eliminate the impact of the dimensions between different data indicators, the Min-Max normalization method is first used to normalize each dimension of the collected feature data x, and data cleaning and missing value filling operations are performed to make each indicator at the same order of magnitude:
[0080]
[0081] Among them, max() is a method for taking the maximum value of a certain dimension of eigenvalues, min() is a method for taking the minimum value of the eigenvalues of that dimension, and x′ is the normalized data.
[0082] Step 3.1.3: Using the normalized data of the three time scales, a feature selector based on Spearman correlation analysis is used to select the features most relevant to carbon emission prediction to obtain an enhanced representation vector.
[0083] In this embodiment, the same method as in step 2 is used to extract features to obtain an enhanced representation vector, which will not be described in detail here.
[0084] Step 3.2: Build a carbon emission prediction model and use the data after feature selection to train the carbon emission prediction model. The training process includes time series data learning, carbon emission prediction and carbon emission prediction model parameter optimization; then use the data that did not participate in the training to test the trained carbon emission prediction model, and adjust the carbon emission prediction model parameters according to the test results.
[0085] Step 3.2.1: Based on the enhanced representations at three time scales, the enhanced vectors are learned using the improved multi-time scale based CNN-ISDAE network.
[0086] Specifically, a one-dimensional convolutional neural network is first used to extract features and remove redundant information to obtain a low-dimensional representation vector that only contains representative key information; then, the low-dimensional representation vectors on three time scales are obtained, and the attention mechanism (Attention Mechanism) feature fusion method is used to assign different attention weights to the low-dimensional representation vectors on the three time scales for fusion, generating a weighted fused representation vector; finally, the weighted fusion vector is used to construct an ISDAE neural network, and the fused weighted fusion vector is learned to obtain a comprehensive representation vector.
[0087] The specific steps of time series data learning include:
[0088] Step 3.2.1.1: Use convolutional neural network to extract features of data at different time scales.
[0089] Based on the time series enhancement vectors T on three time scales, t1 , T t2 and T t3 , concatenate the rows of the time series enhancement vector on each time scale to obtain H i Matrix, H i The matrix contains all the feature information on this time scale, and its size is 2*8*k. Then, a one-dimensional convolutional neural network is applied to extract the obtained features, remove redundant information to obtain a low-dimensional representation vector containing only key information that has a significant impact on carbon emission prediction. In this embodiment, the convolution kernel size is set to 3, and the process is calculated as shown in the following formula:
[0090] L t1 =Conv 1D (Concat(T t1 )),
[0091] L t2 =Conv 1D (Concat(T t2 )),
[0092] L t3 =Conv 1D (Concat(T t3 )).
[0093] Among them, L t1 , L t2 , L t3 Represents the low-dimensional representation vectors on three time scales, Conv 1D represents a one-dimensional convolutional neural network extraction operation, and Concat represents a concatenation operation.
[0094] Step 3.2.1.2: Use the attention mechanism to fuse the extracted features and obtain a weighted fusion vector.
[0095] Based on the generated low-dimensional representation vectors on the three time scales, considering that the information obtained on different time scales has different effects on the final result, the present embodiment adopts the Attention Mechanism feature fusion method to assign different attention weights to them for fusion. The fusion calculation formula is as follows:
[0096]
[0097] Among them, L w L is considered as a high-level vector representation for a fixed query “what is the vector containing important information”, which is randomly initialized and learned during training; tsis the feature vector obtained by one-dimensional convolution operation on time scale s, which contains the key information on this time scale; Norm() represents the layer normalization operation; d embedding represents the dimension of the low-dimensional representation vector, L t It is the weighted fusion vector representation obtained after fusion.
[0098] Step 3.2.1.3: Use a shallow denoising autoencoder to extract features from the weighted fusion vector to obtain a comprehensive representation vector.
[0099] Based on the obtained weighted fusion vector after fusion, it is input into ISDAE (Improved Shallow Denoising Autoencoder) for feature extraction. ISDAE can effectively capture and enhance relevant features from the data. The objective function of the ISDAE feature extraction process is as follows:
[0100]
[0101] in, is the reconstruction error, σ() is the sigmoid activation function of the hidden layer, also known as the encoding function, W1 is the weight matrix, X is the input, is the network output of the reconstructed input, represents the Moore-Penrose inverse, f WPD () is the activation function (decoding function) of the output layer. The WPD function denoises the input signal. It decomposes the input signal by applying high-pass (g(n)) and low-pass (b(n)) orthogonal mirror filters and forms a matrix containing detail coefficients (cD j ) and the approximation coefficient (cA j ) binary tree of frequency wavelets. At each tree level, the approximation and detail coefficients are further decomposed into their detail and approximation sub-coefficients. This process is repeated until the nth level is reached. During the reconstruction of the signal, some frequency wavelets will be set to zero for denoising if their values exceed a threshold.
[0102] Step 3.2.2: The steps for carbon emission prediction include:
[0103] Step 3.2.2.1: Use a deep neural network to process the weighted fusion vector and the comprehensive representation vector to obtain the carbon emission prediction results.
[0104] Based on the comprehensive representation vector X obtained after ISDAE feature extraction and the weighted fusion vector obtained after fusion, the two are input into the DNN network for carbon emission prediction.
[0105] The DNN network calculation formula is as follows:
[0106] h t =ReLU(Wh ·X+b n ),
[0107] y t =Softmax(W y ·h t +b y ).
[0108] Among them, W h , W y , b n , b y Both represent weight parameter matrices, where the initial weights and biases of the hidden fully connected layer are optimized using the IPSO algorithm, and h t is the hidden layer representation vector. This vector is the feature representation obtained by linear transformation and nonlinear activation of the input data X, which contains the activation value of the input data in the hidden layer. The ReLU() function represents the rectified linear unit activation function, and Softmax() applies the softmax activation function in the output layer. t Represents the prediction result of carbon emission prediction. Based on the historical training sample set data, the model continuously adjusts the prediction result y by iteratively optimizing the objective function. t , in order to finally obtain the optimal carbon emission prediction value.
[0109] Carbon emissions are predicted for the power data samples to be tested, and the results are compared with the actual situation. This embodiment uses the normalized root mean square error (NRMSE), mean absolute error (MAE) and mean square error (MSE) as evaluation indicators. The comparison results are shown in Table 1:
[0110] Table 1 Comparison of carbon emission forecasts
[0111] NRMSE MAE MSE ISDAE IPSO DNN 0.3137 0.1632 13.3848 SCAIPSO DNN 0.1761 0.0867 3.7572 IPSO DNN 0.3171 0.1578 21.7883 PSO DNN 0.3962 0.2016 22.6872 This embodiment 0.1730 0.0852 3.2824
[0112] Based on the experimental results in Table 1, it can be seen that the carbon emission prediction method proposed in this embodiment performs better than other methods.
[0113] Step 3.2.3: Optimize the parameters of the carbon emission prediction model. Using the obtained comprehensive representation vector, the idea of contrastive learning is introduced to calculate the contrastive learning loss value, so as to distance the abnormal samples (negative samples) from the representation vector, and close the distance between the normal samples (positive samples) and the representation vector, and learn more effective feature representation vectors. By making the representation vector and the positive sample close to each other, the model learns the common characteristics of these samples. This common feature can well represent the normal law of carbon emissions; increasing the distance between negative samples and positive samples can help the model identify abnormal samples; the increase in this distance enables the model to better distinguish between normal and abnormal data and improve the ability to detect abnormal situations; at the same time, the IPSO-optimized DNN network is used for carbon emission prediction; then, based on the obtained contrast loss value and carbon emission prediction loss value, the gradient back propagation algorithm is used to adjust the parameters in the model to continuously optimize the accuracy of carbon emission prediction.
[0114] The carbon emission prediction model parameter optimization steps include:
[0115] Step 3.2.3.1: Use contrastive learning to calculate the first loss value of the comprehensive representation vector.
[0116] Based on the comprehensive representation vector X obtained after ISDAE feature extraction, this embodiment uses a supervised contrast learning method. First, the normal data samples and abnormal data samples are divided into positive sample sets and negative sample sets according to the sample labels, where normal data samples refer to data that conform to the historical carbon emission law. Usually, these data will follow certain seasonal, cyclical or trend characteristics and conform to the normal fluctuation range of carbon emissions. Abnormal data samples refer to data that deviates from the normal carbon emission pattern and manifests as obvious abnormal fluctuations. Then, use its comprehensive representation vector X t Calculate the contrastive learning loss value, increase the distance between the representation vectors of abnormal samples and normal samples, and decrease the distance between the representation vectors of positive samples to learn more effective feature representation vectors. The contrastive learning calculation formula is as follows:
[0117] w=Proj(X).
[0118] Where Proj(·) represents a single linear network, called the mapping network. This network maps out to w and applies normalization at the end, i.e., n = w / ||w||.
[0119]
[0120] Among them, L sup represents the loss value calculated by contrastive learning, that is, the first loss value, j∈J≡{1…N} represents the index value of the sample, X jRepresents the output value of the jth sample after the mapping network. · Represents the dot product operation. τ∈R + is a set real number parameter (>0). In this embodiment, it is set to τ = 0.1. For A(j) = J-{j}, it means that the set A(j) contains all elements in J except element j. The index value j is called the anchor, and p is the index value of all positive samples. It should be noted that for any anchor j, it may have multiple positive samples. P(j)≡{p∈A{j}:y p =y j} represents the index set of all positive samples except j, where y j represents the label corresponding to the sample with index j, and |P(j)| represents its cardinality.
[0121] Step 3.2.3.2: Use the discriminant function to calculate the second loss value for the predicted value.
[0122] Huber loss is used as the loss function for model discrimination, and the loss function is defined as follows:
[0123]
[0124] Among them, y is the true value, is the predicted value, δ is a hyperparameter used to adjust the shape of the loss function, L Huber Represents the calculated cross entropy loss value, that is, the second loss value.
[0125] Step 3.2.3.3: Add the first loss value and the second loss value to get the overall loss function value.
[0126] The overall loss function of the model is defined as follows:
[0127] L=L sup +L Huber .
[0128] Among them, L is the overall loss function value of the model.
[0129] Step 3.2.3.4: Iteratively solve the minimum overall loss function value to obtain the learning parameters of the carbon emission prediction model.
[0130] By iteratively solving the second loss value and the overall loss function value, L is continuously minimized, so that the model can better distinguish normal data samples from abnormal data samples, and provide robustness so that the model can tolerate certain outliers and avoid affecting the overall prediction effect due to a small number of abnormal samples, thereby obtaining the learning parameters of the CNN-ISDAE network and DNN model based on multiple time scales.
[0131] Step 3.3: After the model training is completed, use data that did not participate in the training process for testing, compare the model test results with the actual situation, and optimize the model to continuously optimize the weight data in the model and continuously improve the accuracy of carbon emission prediction.
[0132] Step 3.4: Use the trained carbon emission prediction model to process the enhanced representation vector. The steps include: performing time series data learning and fusion on the enhanced representation vector to obtain a comprehensive representation vector and a weighted fusion vector, using the comprehensive representation vector and the weighted fusion vector to predict carbon emissions, and using contrastive learning to calculate the comprehensive representation vector, and optimizing the carbon emission prediction result based on the calculation result.
[0133] Embodiment 2:
[0134] Embodiment 2 of the present invention provides a carbon emission prediction system based on multi-source heterogeneous data comparative learning, such as Figure 4 As shown, it includes a data preprocessing module, a feature selection module, a time series data learning module, a carbon emission prediction module, a comparative learning module and a feedback update module.
[0135] The data preprocessing module is configured to obtain the carbon emission data to be predicted and preprocess the carbon emission data.
[0136] The feature selection module is configured to extract features of the preprocessed carbon emission data using a feature selection method to obtain an enhanced representation vector.
[0137] The model processing module is configured to process the enhanced representation vector using the carbon emission prediction model to obtain a carbon emission prediction result.
[0138] The feedback update module is configured to test the model using data that did not participate in the training process after the model is trained, compare the model test results with the actual situation, and optimize and adjust the model, continuously optimize the weight data in the model, and continuously improve the accuracy of carbon emission prediction.
[0139] Among them, the model processing module includes.
[0140] The time series data learning module is configured to perform time series data learning and fusion on the enhanced representation vector to obtain a comprehensive representation vector and a weighted fusion vector.
[0141] The carbon emission prediction module is configured to perform carbon emission prediction using a comprehensive representation vector and a weighted fusion vector.
[0142] The contrastive learning module is configured to calculate the comprehensive representation vector using contrastive learning and optimize the carbon emission prediction result according to the calculation result.
[0143] The steps involved in the above embodiment 2 correspond to those in the method embodiment 1. For the specific implementation method, please refer to the relevant description part of the embodiment 1.
[0144] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0145] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A carbon emission prediction method based on contrastive learning of multi-source heterogeneous data, characterized in that: The following steps are involved: Obtain the carbon emission data to be predicted and pre-process the carbon emission data; The features of the preprocessed carbon emission data are extracted using feature selection methods to obtain an enhanced representation vector; The enhanced representation vector is processed by using the carbon emission prediction model to obtain the carbon emission prediction result, wherein the process of processing the enhanced representation vector by using the carbon emission prediction model includes: performing time series data learning and fusion on the enhanced representation vector to obtain a comprehensive representation vector and a weighted fusion vector, using the comprehensive representation vector and the weighted fusion vector to predict carbon emissions, and using contrastive learning to calculate the comprehensive representation vector, and optimizing the carbon emission prediction result according to the calculation result.
2. The carbon emission prediction method based on multi-source heterogeneous data contrast learning according to claim 1 is characterized in that: Carbon emissions data includes electricity generation data, fuel consumption data, historical carbon emissions data, and weather and climate data.
3. The carbon emission prediction method based on multi-source heterogeneous data contrast learning according to claim 1 is characterized in that: The preprocessing step involves normalizing the data.
4. The carbon emission prediction method based on multi-source heterogeneous data contrast learning according to claim 1 is characterized in that: The specific steps of extracting the features of the preprocessed carbon emission data using the feature selection method are: A feature selector based on Spearman correlation analysis is used to select the features most relevant to carbon emission prediction and obtain an enhanced representation vector.
5. The carbon emission prediction method based on multi-source heterogeneous data contrast learning according to claim 1 is characterized in that: The process of building a carbon emission prediction model includes: Obtain known data sets with data at different time scales, and perform preprocessing and feature selection operations on the known data sets; Construct a carbon emission prediction model and use the data after feature selection to train the carbon emission prediction model, where the training process includes time series data learning, carbon emission prediction and carbon emission prediction model parameter optimization; The trained carbon emission prediction model is tested using data that has not participated in the training, and the parameters of the carbon emission prediction model are adjusted according to the test results.
6. The carbon emission prediction method based on multi-source heterogeneous data contrast learning according to claim 5 is characterized in that: Data of different time scales include the current time, the same time of the previous week, and the same period of last year.
7. The carbon emission prediction method based on multi-source heterogeneous data contrast learning according to claim 5 is characterized in that: The steps of time series data learning include: Use convolutional neural networks to extract features from data at different time scales; The attention mechanism is used to fuse the extracted features to obtain a weighted fusion vector; A shallow denoising autoencoder is used to extract features from the weighted fusion vector to obtain a comprehensive representation vector.
8. The carbon emission prediction method based on multi-source heterogeneous data contrast learning according to claim 7 is characterized in that: The steps of carbon emission forecasting include: The deep neural network was used to process the weighted fusion vector and the comprehensive representation vector to obtain the carbon emission prediction results.
9. The carbon emission prediction method based on multi-source heterogeneous data contrast learning according to claim 8, characterized in that: The carbon emission prediction model parameter optimization steps include: Calculate the first loss value of the comprehensive representation vector using contrastive learning; Calculate the second loss value of the predicted value using the discriminant function; Add the first loss value and the second loss value to get the overall loss function value; The minimum overall loss function value is iteratively solved to obtain the learning parameters of the carbon emission prediction model.
10. A carbon emission prediction system based on comparative learning of multi-source heterogeneous data, characterized in that: include: A data preprocessing module is configured to obtain carbon emission data to be predicted and preprocess the carbon emission data; A feature selection module is configured to extract features of the preprocessed carbon emission data using a feature selection method to obtain an enhanced representation vector; A model processing module is configured to process the enhanced representation vector using a carbon emission prediction model to obtain a carbon emission prediction result; The model processing module includes: A time series data learning module is configured to perform time series data learning and fusion on the enhanced representation vector to obtain a comprehensive representation vector and a weighted fusion vector; A carbon emission prediction module is configured to perform carbon emission prediction using a comprehensive representation vector and a weighted fusion vector; The contrastive learning module is configured to calculate the comprehensive representation vector using contrastive learning and optimize the carbon emission prediction result according to the calculation result.
Citation Information
Cited By
Power distribution network structure dynamic deduction method and system based on time sequence dynamic analysis
CN119419791A
Electric power carbon emission factor dynamic uncertainty evaluation method
CN121481217A
Power grid line loss carbon emission analysis processing method, system, equipment and medium
CN121859029A
Carbon emission monitoring method and system based on multi-source monitoring data
CN122087772A
Carbon emission monitoring method and system based on multi-source monitoring data
CN122087772B