A carbon emission prediction method, device and medium based on capturing relationships between variables
By combining the multicollinearity processing of Pearson, Spearman and VIF detection with the XGBoost and Transformer models, the problem of difficulty in capturing the nonlinear relationship between variables in traffic carbon emissions prediction is solved, a more accurate prediction effect is achieved, and the stability and prediction accuracy of the model are improved.
Patent Information
- Application Number
- CN202510571281.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-05-06
AI Technical Summary
Existing transportation carbon emission prediction methods have difficulty capturing the complex nonlinear relationships between influencing variables and are unable to accurately screen key variables, resulting in poor prediction accuracy.
A preliminary screening based on the Pearson correlation coefficient and the Spearman rank correlation coefficient was adopted, combined with the multicollinearity detection of the VIF index and the Pearson correlation coefficient. Nonlinear relationship analysis was performed using the XGBoost algorithm. The Transformer model was used for feature embedding and position encoding to capture long-distance dependencies and generate time series vectors for prediction.
It improves the accuracy and stability of transportation carbon emission predictions, enhances the model's predictive capabilities, enables a more comprehensive understanding of the dynamic relationship between transportation activities and carbon emissions, reduces the risk of overfitting, and promotes sustainable development in the transportation sector.
Smart Images

Figure CN120087979B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of transportation carbon emission prediction, and in particular to a carbon emission prediction method, device and medium based on capturing the relationship between variables. Background Art
[0002] With the continued development of the economy and the rapid advancement of transportation technology, the number of motor vehicles has increased significantly, and traffic is experiencing exponential growth. However, the current transportation system still relies heavily on traditional internal combustion engines powered by petroleum derivatives such as gasoline and diesel. This carbon-based energy-driven approach has led to a sharp increase in carbon emissions from the transportation sector, which continues to rise annually with the acceleration of urbanization.
[0003] Transportation carbon emissions forecasting aims to predict the carbon emissions level of transportation activities over a specific future period by integrating various types of transportation carbon emission impact data. Current research focuses on screening factors influencing transportation carbon emissions and developing transportation carbon emission prediction models. The Stochastic Impacts by Regression on Population, Affluence, and Technology (STIRPAT) model and driving factor decomposition methods, such as the Logarithmic Mean Divisia Index (LMDI), are commonly used methods for screening factors influencing transportation carbon emissions. However, these methods struggle to capture the complex nonlinear relationships between influencing variables. Furthermore, multicollinearity during factor screening can hinder the accurate separation of the independent contributions of each factor when constructing a transportation carbon emission prediction model, thus interfering with existing screening methods. A common approach to addressing multicollinearity is to calculate the degree of multicollinearity between factors using the Variance Inflation Factor (VIF), followed by regularization and principal component analysis (PCA). However, PCA produces certain information loss during the dimensionality reduction process; regularization introduces estimation bias and is highly dependent on the regularization parameter. Therefore, it is urgent to design a reasonable optimization strategy to handle variables with multicollinearity to ensure variable stability and enhance the model's predictive ability.
[0004] Recently, deep neural network architectures, such as long short-term memory (LSTM) networks and attention mechanisms, have significantly improved traffic carbon emissions prediction. However, these approaches still suffer from information forgetting, low computational efficiency, poor feature interaction, and overfitting. Therefore, there is an urgent need for a new method that can integrate multiple factors, accurately screen key variables, and efficiently predict traffic carbon emissions.
[0005] Through the above analysis, the problems and defects of the existing technology are as follows:
[0006] Existing technologies for predicting transportation carbon emissions have difficulty capturing the complex nonlinear relationships between influencing variables, including separating the independent contribution of each factor and failing to accurately screen key variables, which further leads to poor prediction accuracy. Summary of the Invention
[0007] The embodiments of the present application provide a carbon emission prediction method, device and medium based on capturing the relationship between variables, which can solve the problem that the existing technology of traffic carbon emission prediction is difficult to capture the complex nonlinear relationship between influencing variables, including separating the independent contribution of each factor and being unable to accurately screen key variables, which further leads to poor prediction accuracy.
[0008] In the first aspect, an embodiment of the present application provides a carbon emission prediction method based on capturing the relationship between variables, the method including: based on a preset set of traffic carbon emission influencing factors, calculating the correlation between the set of traffic carbon emission influencing factors and traffic carbon emissions, and performing preliminary screening to obtain a preliminary variable candidate pool; performing multicollinearity detection and updating on the preliminary variable candidate pool to generate a screened variable candidate pool; performing nonlinear relationship analysis on the screened variable candidate pool through the XGBoost algorithm to screen out a key variable sequence; inputting the key variable sequence and traffic carbon emissions into the Transformer model, performing feature embedding and position encoding, and generating a time series vector; predicting the traffic carbon emission levels at different levels for the time series vector, and the levels include low carbon, benchmark, and high carbon.
[0009] In one implementation of the present application, the correlation between the set of traffic carbon emission influencing factors and the traffic carbon emissions is calculated, and a preliminary screening is performed to obtain a preliminary variable candidate pool, specifically including: calculating the linear relationship between the set of traffic carbon emission influencing factors and the traffic carbon emissions by the Pearson correlation coefficient method to obtain the Pearson correlation coefficient; screening the first influencing variable whose Pearson correlation coefficient is greater than a first preset threshold; calculating the monotonic relationship between the set of traffic carbon emission influencing factors and the traffic carbon emissions by the Spearman rank correlation coefficient method to obtain the Spearman rank correlation coefficient; screening the second influencing variable whose Spearman rank correlation coefficient is greater than a second preset threshold; combining the first influencing variable and the second influencing variable to obtain a preliminary variable candidate pool.
[0010] In one implementation of the present application, a preliminary variable candidate pool is tested for multicollinearity and updated to generate a screened variable candidate pool, specifically including: calculating the VIF index of the first influencing variable and the second influencing variable to screen variables with multicollinearity; for the variables in the preliminary variable candidate pool, calculating the Pearson correlation coefficient between the variables with multicollinearity and the remaining variables; normalizing the Pearson correlation coefficient to obtain the weight coefficient of each variable; and performing weighted reconstruction on the variables with multicollinearity according to the weight coefficient to generate a screened variable candidate pool.
[0011] In one implementation of the present application, a nonlinear relationship analysis is performed on the filtered variable candidate pool through the XGBoost algorithm to obtain a key variable sequence, specifically including: data standardization and missing value processing of the variable data in the filtered variable candidate pool, and one-hot encoding of the level; the processed variable data is divided into a training set and a test set through a cross-validation method; the information gain value of the training set is calculated to obtain the contribution to carbon emission prediction; the information gain values are sorted to obtain a key variable sequence with a preset proportion.
[0012] In one implementation of the present application, the key variable sequence and traffic carbon emissions are input into the Transformer model for feature embedding and position encoding to generate a time series vector, specifically including: mapping the key variable sequence to a vector space of fixed dimension through a linear embedding layer to obtain an embedding vector; position encoding the key variable sequence; and adding the position encoding to the embedding vector to obtain a time series input vector.
[0013] In one implementation of the present application, the levels of traffic carbon emissions at different levels are predicted for time series vectors, specifically including: capturing the long-distance dependencies of time series vectors through a multi-head self-attention mechanism, and superimposing residual connections and normalization processing; inputting the normalized features into a feedforward neural network, and generating predicted values through a decoder.
[0014] In one implementation of the present application, before performing multicollinearity detection and updating on the preliminary variable candidate pool to generate a screened variable candidate pool, the method also includes: obtaining satellite remote sensing image data, extracting density features of the regional traffic network through a convolutional neural network; obtaining traffic monitoring video, extracting traffic flow features; combining density features and traffic flow features to generate a multi-source feature tensor; and performing multicollinearity detection on the multi-source feature tensor and a preset set of traffic carbon emission influencing factors to obtain a fused candidate variable pool.
[0015] In one implementation of the present application, before calculating the correlation between the set of transportation carbon emission influencing factors and transportation carbon emissions based on a preset set of transportation carbon emission influencing factors, the method also includes: obtaining transportation energy consumption data, transportation energy including coal, crude oil, gasoline and diesel; according to a preset standard coal conversion coefficient, uniformly converting the transportation energy consumption data into standard coal equivalent; combining the emission factors, and calculating the transportation carbon emissions through weighted summation.
[0016] In a second aspect, an embodiment of the present application also provides a carbon emission prediction device based on capturing the relationship between variables, the device including at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: calculate the correlation between the set of traffic carbon emission influencing factors and the traffic carbon emissions based on a preset set of traffic carbon emission influencing factors, and perform preliminary screening to obtain a preliminary variable candidate pool; perform multicollinearity detection and update on the preliminary variable candidate pool to generate a screened variable candidate pool; perform nonlinear relationship analysis on the screened variable candidate pool through the XGBoost algorithm to screen out a key variable sequence; input the key variable sequence and traffic carbon emissions into the Transformer model, perform feature embedding and position encoding, and generate a time series vector; predict the traffic carbon emission levels at different levels for the time series vector, and the levels include low carbon, benchmark, and high carbon.
[0017] On the third aspect, an embodiment of the present application also provides a non-volatile computer storage medium for carbon emission prediction based on capturing the relationship between variables, which stores computer executable instructions, and the computer executable instructions are set to: based on a preset set of traffic carbon emission influencing factors, calculate the correlation between the set of traffic carbon emission influencing factors and traffic carbon emissions, and perform preliminary screening to obtain a preliminary variable candidate pool; perform multicollinearity detection and update on the preliminary variable candidate pool to generate a screened variable candidate pool; perform nonlinear relationship analysis on the screened variable candidate pool through the XGBoost algorithm to screen out a key variable sequence; input the key variable sequence and traffic carbon emissions into the Transformer model, perform feature embedding and position encoding, and generate a time series vector; predict the traffic carbon emission levels at different levels for the time series vector, and the levels include low carbon, benchmark, and high carbon.
[0018] The embodiment of the present application provides a carbon emission prediction method, device and medium based on capturing the relationship between variables. First, a new multicollinearity processing strategy is designed based on two screenings. For variables with multicollinearity, the strategy calculates the weight relationship between them and the remaining variables, thereby reconstructing and optimizing the variables, dynamically adjusting the variable combination weights and generating optimized new variables, effectively balancing the feature explanatory power and model stability, ensuring the scientific nature of the variable screening process and the reliability of model construction, and thus enhancing the prediction ability of the model; after preliminary screening of the variables and multicollinearity processing, XGBoost is used to capture nonlinear relationships and interactions. This multi-level screening method can improve the model's ability to identify factors affecting transportation carbon emissions, increase The model achieves strong prediction accuracy and stability, while providing more accurate input features for subsequent Transformer models. Given selected factors influencing traffic carbon emissions, the Transformer uses parallel computing to capture their cyclical and trending changes. A multi-head self-attention mechanism captures the complex long-range dependencies and interactive features in traffic carbon emissions data, enabling the model to simultaneously focus on relationships across different time steps, thereby more comprehensively understanding the dynamic relationship between traffic activity and carbon emissions and delivering more comprehensive and accurate predictions. Using factors highly correlated with traffic carbon emissions as input, the model uses deep learning techniques to predict carbon emission levels at future time points, employing cross-validation and regularization to reduce the risk of overfitting. This model is of great significance for optimizing traffic planning and management and promoting sustainable development in the transportation sector, achieving effective traffic carbon emissions management. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 A flowchart of a carbon emission prediction method based on capturing relationships between variables provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of the overall logical architecture of a carbon emission prediction method based on capturing relationships between variables provided in an embodiment of the present application;
[0022] Figure 3 A flowchart of screening factors affecting traffic carbon emissions based on a carbon emissions prediction method that captures relationships between variables provided in an embodiment of the present application;
[0023] Figure 4 A Transformer neural network model diagram of a carbon emission prediction method based on capturing relationships between variables provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the internal structure of a carbon emission prediction device based on capturing the relationship between variables provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0026] The embodiments of the present application provide a carbon emission prediction method, device and medium based on capturing the relationship between variables, which solves the problem that the existing technology of traffic carbon emission prediction is difficult to capture the complex nonlinear relationship between influencing variables, including separating the independent contribution of each factor and failing to accurately screen key variables, which further leads to poor prediction accuracy.
[0027] The technical solutions proposed in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0028] Figure 1 This is a flow chart of a carbon emission prediction method based on capturing the relationship between variables provided in the embodiment of the present application. Figure 1 As shown, the embodiment of the present application provides a carbon emission prediction method based on capturing the relationship between variables, which specifically includes the following steps:
[0029] Step 10: Based on the preset set of factors influencing transportation carbon emissions, calculate the correlation between the set of factors influencing transportation carbon emissions and transportation carbon emissions, and perform preliminary screening to obtain a preliminary variable candidate pool.
[0030] In this step, if Figure 2 As shown, the preset set of factors affecting transportation carbon emissions can be factors that affect transportation carbon emissions from the perspectives of economic development, social factors, transportation, technological development, policies and environmental factors, including population size, number of motor vehicles, per capita GDP, passenger and cargo turnover, transportation development level, and energy intensity. All data can be obtained through the "China Energy Statistical Yearbook", "China Statistical Yearbook", "Transportation Industry Statistical Bulletin", etc.
[0031] As an optional embodiment, before calculating the correlation between the set of traffic carbon emission influencing factors and traffic carbon emissions based on a preset set of traffic carbon emission influencing factors, the method may also include: obtaining traffic energy consumption data, traffic energy including raw coal, gasoline, kerosene, diesel, fuel oil, liquefied petroleum gas, natural gas, heat and electricity; according to a preset standard coal conversion coefficient, uniformly converting the traffic energy consumption data into standard coal equivalent; combining the emission factors, and calculating the traffic carbon emissions by weighted summation.
[0032] In this step, since it is necessary to quickly simulate the macro-level transportation carbon emission trends, the carbon emissions of relevant influencing factors are calculated according to the "top-down method" shown in the "National Greenhouse Gas Inventory Guidelines". Starting from the total energy consumption related to transportation, the carbon emissions are calculated in combination with emission factors. The energy consumption can be obtained through the "China Energy Statistical Yearbook".
[0033] To unify the calculation units, this step converts different energy consumption data into standard coal data:
[0034]
[0035] Where: Indicates the calculated carbon emissions in 10,000 tons; Refers to a collection of different types of energy, mainly including coal, crude oil, gasoline, diesel, etc. Indicates the The amount of data on energy consumption, unit: 10,000 tons; Refers to the coefficient converted into unit standard coal; It is the emission factor, and the data comes from the Guidelines for National Greenhouse Gas Inventories published by the IPCC.
[0036] As an optional embodiment, the correlation between the set of factors affecting traffic carbon emissions and the amount of traffic carbon emissions is calculated, and preliminary screening is performed to obtain a preliminary variable candidate pool, which may specifically include: Step 101: Calculate the linear relationship between the set of factors affecting traffic carbon emissions and the amount of traffic carbon emissions by using the Pearson correlation coefficient method to obtain the Pearson correlation coefficient; Step 102: Screen the first influencing variable whose Pearson correlation coefficient is greater than the first preset threshold.
[0037] In this step, the Pearson correlation coefficient method is used to preliminarily screen the factors affecting carbon emissions, such as Figure 3 As shown, specifically, the Pearson correlation coefficient method is intended to measure the linear relationship between two variables. In this step, it is used to calculate the Pearson correlation coefficient between each influencing factor and traffic carbon emissions:
[0038]
[0039] Where: Indicates the Observed values of various factors affecting carbon emissions; is the mean; similarly, and represents the observed and mean values of transportation carbon emissions.
[0040] Furthermore, after obtaining the Pearson correlation coefficient between each influencing factor and traffic carbon emissions, a threshold is set to filter out influencing factors with high correlation, such as setting a threshold , , the factors that meet the threshold are proved to have a strong significant correlation with traffic carbon emissions. For factors with no significant correlation, that is, factors with a p-value greater than 0.05, they can be considered to be eliminated from the model to obtain screening variables .
[0041] Step 103: Calculate the monotonic relationship between the set of influencing factors of traffic carbon emissions and traffic carbon emissions using the Spearman rank correlation coefficient method to obtain the Spearman rank correlation coefficient; Step 104: Filter a second influencing variable whose Spearman rank correlation coefficient is greater than a second preset threshold;
[0042] In this step, since the Pearson correlation coefficient can only measure linear relationships and may not be sensitive enough to nonlinear relationships, the Spearman rank correlation coefficient method is needed for further screening. The Spearman rank correlation coefficient is a non-parametric statistical method used to measure the monotonic relationship between two variables: traffic carbon emissions and their influencing factors. Specifically, the observed values of each variable are sorted from small to large, and then a rank is assigned to each observed value. The rank difference of each pair of variables is calculated:
[0043]
[0044] Where, It is The rank difference of samples; and They are and The ranks of two variables.
[0045] Furthermore, the Spearman rank correlation coefficient is calculated:
[0046]
[0047] Where: is the sample size.
[0048] Generally speaking, The closer it is to 1, the stronger the correlation between the two variables. Therefore, the threshold can be set. To screen the factors with high correlation with traffic carbon emissions, similarly, by setting To verify whether each correlation coefficient is significant, get the screening variable .
[0049] Step 105: Combine the first influencing variable and the second influencing variable to obtain a preliminary variable candidate pool.
[0050] In this step, combined and Build a preliminary variable candidate pool .
[0051] Step 20: Perform multicollinearity detection on the preliminary variable candidate pool and update it to generate a screened variable candidate pool.
[0052] As an optional embodiment, multicollinearity detection is performed on the preliminary variable candidate pool and updated to generate a screened variable candidate pool, which may specifically include: Step 201: Calculate the VIF index of the first influencing variable and the second influencing variable to screen variables with multicollinearity.
[0053] In this step, the multicollinearity between variables is eliminated by weighting method. First, the variables in the preliminary candidate pool are VIF (Variance Inflation Factor) test was performed to calculate the VIF index between variables. If the VIF index is greater than 10, it is considered that the variables have serious multicollinearity.
[0054]
[0055] Where: Indicates factors affecting transportation carbon emissions; Indicates that the The degree of correlation between the two when one independent variable is used as the dependent variable and all other independent variables are used as independent variables.
[0056] Step 202: For the variables in the preliminary variable candidate pool, calculate the Pearson correlation coefficient between the variables with multicollinearity and the remaining variables.
[0057] In this step, the Pearson correlation coefficient is calculated between the variables with multicollinearity and other variables:
[0058]
[0059] Where: Indicates the existence of multicollinearity variables. Represents the remaining variables. and are the means of the multicollinearity variables and the remaining variables, respectively.
[0060] Step 203: Normalize the Pearson correlation coefficient to obtain the weight coefficient of each variable;
[0061] Then the Pearson correlation coefficient of the variables was normalized to calculate the weights.
[0062]
[0063] Where: are the weights of the remaining variables.
[0064] Step 204: Perform weighted reconstruction on the variables with multicollinearity according to the weight coefficients to generate a filtered variable candidate pool.
[0065] In this step, the variables with multicollinearity are optimized based on weighted average and the variable candidate pool is updated. :
[0066]
[0067] Where: is the updated variable, is the variable value.
[0068] Step 30: Use the XGBoost algorithm to perform nonlinear relationship analysis on the filtered variable candidate pool to obtain the key variable sequence.
[0069] In this step, after eliminating the impact of multicollinearity through weight analysis, XGBoost is used for secondary screening. XGBoost is a gradient boosting-based ensemble learning algorithm that trains a gradient boosting tree (GBDT) model to determine the relative importance of each variable (influencing factor) on transportation carbon emissions.
[0070] As an optional embodiment, nonlinear relationship analysis is performed on the filtered variable candidate pool by using the XGBoost algorithm to screen out key variable sequences, which may specifically include: step 301: performing data standardization and missing value processing on the variable data in the filtered variable candidate pool, and performing one-hot encoding on the level;
[0071] In this step, XGBoost uses Gain to represent the contribution of each variable, and sets an absolute threshold after sorting each Gain value to screen out important factors affecting traffic carbon emissions. Specifically, for the variables in the candidate pool, Perform data preprocessing, including filling missing values with the mean; standardizing data of different dimensions so that each feature has the same scale; and performing one-hot encoding on categorical data, such as low, medium, and high.
[0072] Step 302: Divide the processed variable data into a training set and a test set by cross-validation method; Step 303: Calculate the information gain value of the training set to obtain the contribution to carbon emission prediction;
[0073] In this step, an XGBoost model is constructed to screen the features that have the greatest impact on carbon emission prediction. The XGBoost model can be expressed as:
[0074]
[0075] Where: It is Transportation carbon emission values of samples; Indicates the number of iterations; It is The predicted value of the round tree.
[0076] The loss function of XGBoost can be expressed as:
[0077]
[0078] Where: It is used to measure the predicted value and actual value The error between can be expressed using mean square error; It is a regularization term that controls the complexity of the model and prevents overfitting.
[0079] Furthermore, XGBoost uses a gradient boosting algorithm to train the model. Each iteration adjusts the predictions based on the residuals from the previous iteration. In each iteration, XGBoost updates the model by calculating the optimal output value for each leaf node in the tree. By calculating the importance of each feature, it selects those with the greatest impact on carbon emissions prediction. Information gain is a commonly used feature importance scoring method in XGBoost. It represents the information gain brought by a feature. A higher importance indicates a greater contribution to the model's predictions.
[0080] Step 304: Sort the information gain values to obtain a key variable sequence with a preset ratio.
[0081] In this step, for example, the top 50% of the influencing factors of traffic carbon emissions are selected and expressed as:
[0082]
[0083] Where: GL is the sum of the gradients of all samples in the left child node, GR is the sum of the gradients of all samples in the right child node, HL is the sum of the second-order derivatives of all samples in the left child node, and HR is the sum of the second-order derivatives of all samples in the right child node. represents the sum of the gradients (first-order derivatives) of the parent nodes, represents the sum of the Hessian matrix (second-order derivatives); and They represent the L2 regularization coefficient and the minimum gain threshold for splitting, respectively. Based on the feature importance score, the features that have the greatest impact on carbon emission prediction can be screened out.
[0084] Step 40: Input the key variable sequence and traffic carbon emissions into the Transformer model for feature embedding and position encoding to generate a time series vector.
[0085] In this step, the key factors affecting transportation carbon emissions are obtained after a series of variable screening. , is a data set, Is one of the data, The historical data of traffic carbon emissions are input into Transformer for training, and a traffic carbon emission prediction model based on Transformer is constructed, such as Figure 4 shown.
[0086] As an optional embodiment, the key variable sequence and traffic carbon emissions are input into the Transformer model for feature embedding and position encoding to generate a time series vector. Specifically, the following steps may be performed:
[0087] Step 401: Map the key variable sequence to a fixed-dimensional vector space through a linear embedding layer to obtain an embedding vector.
[0088] In this step, Transformer has a strong feature extraction capability, which can fully understand the dynamic relationship between influencing factors and carbon emissions, and the key factors of traffic carbon emissions , it needs to be mapped to a fixed-dimensional vector space through a linear embedding layer. The formula is:
[0089]
[0090] Where: is the embedding matrix; is bias; is the resulting embedding vector.
[0091] Step 402: Position-encode the key variable sequence.
[0092] In this step, position encoding is required to preserve the position information in the sequence. Position encoding is used to introduce position awareness to each input feature. By adding time step information to the representation of the input feature, the model can understand the order of the input features in the time series. The formula is:
[0093]
[0094]
[0095] Where: Indicates the location of the current feature; Represents the index of each element in the current vector; Represents the dimension of the position encoding vector.
[0096] Step 403: Add the position code to the embedding vector to obtain a time series input vector.
[0097] In this step, the position code is added to the embedding vector to obtain the input vector with enhanced sequence information , the formula is:
[0098]
[0099] Step 50: Forecast the transportation carbon emission levels at different levels for the time series vector, including low carbon, baseline, and high carbon.
[0100] As an optional embodiment, predicting the traffic carbon emission levels at different levels for the time series vector may specifically include: Step 501: capturing the long-distance dependency of the time series vector through a multi-head self-attention mechanism, and superimposing residual connections and normalization processing.
[0101] In this step, the input vector The data is fed into an encoder to capture long-range dependencies in the sequence data. The encoder consists of multiple encoder layers, each of which includes a multi-head self-attention mechanism and a feedforward neural network. The multi-head attention mechanism computes self-attention multiple times and then concatenates the results to capture features in different subspaces. The self-attention mechanism is the core of the Transformer. It captures global dependencies by calculating the weight of each position in the input sequence. Specifically:
[0102]
[0103] Where: Represents the dimension of the vector; , and By input vector Obtained through linear transformation.
[0104] The multi-head self-attention mechanism consists of multiple self-attention mechanisms, with the goal of integrating dependencies from different angles.
[0105]
[0106] Where: represents the learnable weight matrix; is the number of heads of the multi-head self-attention mechanism.
[0107] The feature representation output by the multi-head self-attention mechanism enhances the stability and training efficiency of the model through residual connections and normalization:
[0108]
[0109] Step 502: Input the normalized features into the feedforward neural network and generate prediction values through the decoder.
[0110] In this step, a feedforward neural network is used to further process the features:
[0111]
[0112] Where: , and is a learnable parameter.
[0113] The output of the feedforward neural network will be connected again through a residual connection and normalized to obtain the output feature representation of the encoder. , then, according to the output feature representation of the encoder , design a decoder to generate the predicted value. The decoder includes time series aggregation and an output layer with a fully connected layer as the core. Time series aggregation is to take the average of the output sequence of all time steps. The formula is:
[0114]
[0115] The output layer uses a fully connected layer to map the aggregation results to the predicted values. The formula is:
[0116]
[0117] Finally, under three different scenarios: low-carbon, baseline, and high-carbon, the low-carbon scenario involves statistically analyzing factors influencing transportation carbon emissions and conducting screening and forecasting tasks in the context of implementing energy-saving and emission-reduction policies, improving energy efficiency, promoting new energy vehicles, and optimizing transportation structure. The baseline scenario involves continuing the existing policy development model and laws and forecasting transportation carbon emissions under the current status and level. The high-carbon scenario corresponds to a scenario in which the operation of the transportation sector is still highly dependent on carbon-based energy, and carbon control measures lag behind, resulting in a continuous increase in carbon emissions. The purpose of developing different forecasting scenarios is to provide a comprehensive perspective on carbon emissions forecasting, reveal the sensitivity of key influencing factors to carbon emissions, and thus provide a basis for policy formulation.
[0118] Therefore, the embodiment of the present application predicts the future development level of transportation carbon emissions under three different scenarios and obtains three different carbon emission trajectories.
[0119] As an optional embodiment, before performing multicollinearity detection and updating on the preliminary variable candidate pool to generate a screened variable candidate pool, the method may further include: obtaining satellite remote sensing image data, and extracting density features of the regional traffic network through a convolutional neural network; obtaining traffic monitoring video, and extracting traffic flow features; combining density features and traffic flow features to generate a multi-source feature tensor; and performing multicollinearity detection on the multi-source feature tensor and a preset set of traffic carbon emission influencing factors to obtain a fused candidate variable pool.
[0120] In this step, satellite remote sensing images can provide large-scale, macro-level information on transportation infrastructure, such as road distribution and the location of transportation hubs. Convolutional layers are used to automatically learn spatial patterns in images, such as road density and the number of intersections, and to quantify the physical characteristics of the transportation network, such as the length of roads per square kilometer. Traffic monitoring videos and traffic flow statistics extract real-time traffic flow characteristics and capture dynamic traffic behavior, such as the number of vehicles, speed, and congestion. Video analysis algorithms are used to generate time series data, such as hourly traffic flow. Intersection cameras can also count the number of vehicles passing through each minute to reflect the level of traffic congestion and quantify the dynamic usage characteristics of the transportation network, such as peak-hour traffic flow. Static (satellite) and dynamic (video) feature data are integrated to form a multi-dimensional feature representation. The multi-source feature tensor combines the traffic network density (static) with the traffic flow (dynamic) to form a three-dimensional tensor containing spatiotemporal information, which includes both spatial structure and temporal changes.
[0121] Furthermore, the variable screening process and the aforementioned set of factors influencing transportation carbon emissions are combined to construct a fused candidate variable pool to screen key influencing factors. This set of factors influencing transportation carbon emissions provides socioeconomic context, such as population, GDP, and vehicle ownership. Static features (satellite) reflect long-term trends, while dynamic features (video) capture short-term fluctuations. This allows for the complementary use of multi-source data to build a more comprehensive and accurate transportation characteristics model, providing a scientific basis for transportation planning, carbon emissions forecasting, and policy optimization.
[0122] In summary, training a Transformer-based traffic carbon emissions prediction model involves first normalizing the influencing factors and historical traffic carbon emissions data filtered by XGBoost, including data normalization and missing value handling. A traffic carbon emissions dataset is then constructed. 70% of the data is then randomly selected as the training set, 20% as the test set, and 10% as the validation set. Backpropagation is used to adjust the values of the model's parameters and weights. The learning rate can be dynamically adjusted using the Adam optimizer. Stochastic gradient descent is used to optimize the loss function, expressed as mean squared error. Training is considered complete when the loss function approaches a minimum or remains unchanged for multiple passes, resulting in the optimal traffic carbon emissions prediction model.
[0123] The above is an embodiment of the method proposed in this application. Based on the same inventive concept, this application embodiment also provides a carbon emission prediction device based on capturing the relationship between variables, and its structure is as follows: Figure 5 shown.
[0124] Figure 5 This is a schematic diagram of the internal structure of a carbon emission prediction device based on capturing the relationship between variables provided in an embodiment of the present application. Figure 5 As shown, the equipment includes:
[0125] at least one processor 501;
[0126] and, a memory 502 in communication with the at least one processor;
[0127] Among them, the memory 502 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 501 so that the at least one processor 501 can: calculate the correlation between the set of traffic carbon emission influencing factors and traffic carbon emissions based on a preset set of traffic carbon emission influencing factors, and perform preliminary screening to obtain a preliminary variable candidate pool; perform multicollinearity detection and update the preliminary variable candidate pool to generate a screened variable candidate pool; perform nonlinear relationship analysis on the screened variable candidate pool through the XGBoost algorithm to screen out a key variable sequence; input the key variable sequence and traffic carbon emissions into the Transformer model, perform feature embedding and position encoding, and generate a time series vector; and predict the traffic carbon emission levels at different levels for the time series vector, and the levels include low carbon, benchmark, and high carbon.
[0128] Some embodiments of the present application provide corresponding Figure 1 A non-volatile computer storage medium for carbon emission prediction based on capturing the relationship between variables stores computer executable instructions, wherein the computer executable instructions are configured to: calculate the correlation between the set of traffic carbon emission influencing factors and traffic carbon emissions based on a preset set of traffic carbon emission influencing factors, and perform preliminary screening to obtain a preliminary variable candidate pool; perform multicollinearity detection on the preliminary variable candidate pool and update it to generate a screened variable candidate pool; perform nonlinear relationship analysis on the screened variable candidate pool through the XGBoost algorithm to screen out a key variable sequence; input the key variable sequence and traffic carbon emissions into a Transformer model for feature embedding and position encoding to generate a time series vector; and predict traffic carbon emission levels at different levels for the time series vector, where the levels include low carbon, benchmark, and high carbon.
[0129] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences from the other embodiments. In particular, the IoT device and media embodiments are generally similar to the method embodiments, so their description is relatively simple. For relevant portions, refer to the description of the method embodiments.
[0130] The system and medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and medium also have similar beneficial technical effects to their corresponding methods. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.
[0131] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0132] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0135] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0136] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0137] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0138] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0139] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A carbon emission prediction method based on capturing the relationship between variables, characterized in that: The method comprises: Obtain satellite remote sensing image data and extract the density characteristics of the regional transportation network through convolutional neural networks; Obtain traffic surveillance videos and extract traffic flow characteristics; Combining the density feature and the traffic flow feature to generate a multi-source feature tensor; Based on a preset set of factors influencing traffic carbon emissions, the correlation between the set of factors influencing traffic carbon emissions and traffic carbon emissions is calculated, and preliminary screening is performed to obtain a preliminary variable candidate pool, specifically including: Calculating the linear relationship between the set of factors influencing traffic carbon emissions and traffic carbon emissions using the Pearson correlation coefficient method to obtain a Pearson correlation coefficient; Screening a first influencing variable whose Pearson correlation coefficient is greater than a first preset threshold; Calculating the monotonic relationship between the set of influencing factors of traffic carbon emissions and traffic carbon emissions using the Spearman rank correlation coefficient method to obtain the Spearman rank correlation coefficient; Screening the second influencing variable whose Spearman rank correlation coefficient is greater than a second preset threshold; Combining the first influencing variable and the second influencing variable to obtain a preliminary variable candidate pool; Performing multicollinearity detection on the multi-source feature tensor and the preliminary variable candidate pool to obtain a fused candidate variable pool; Perform multicollinearity detection on the fusion candidate variable pool and update it to generate a screened variable candidate pool, specifically including: Calculate the VIF index of the first influencing variable and the second influencing variable to screen out variables with multicollinearity; For the variables in the fusion candidate variable pool, calculating the Pearson correlation coefficient between the variable with multicollinearity and the remaining variables; Normalizing the Pearson correlation coefficient to obtain the weight coefficient of each variable; Performing weighted reconstruction on the variables with multicollinearity according to the weight coefficients to generate the screened variable candidate pool; Performing nonlinear relationship analysis on the filtered variable candidate pool using the XGBoost algorithm to obtain a key variable sequence; Input the key variable sequence and traffic carbon emissions into the Transformer model, perform feature embedding and position encoding, and generate a time series vector; The time series vector is used to predict the transportation carbon emission levels at different levels, where the levels include low carbon, baseline, and high carbon.
2. A carbon emission prediction method based on capturing the relationship between variables according to claim 1, characterized in that: The XGBoost algorithm is used to perform nonlinear relationship analysis on the candidate variable pool after screening to obtain a key variable sequence, specifically including: Performing data standardization and missing value processing on the variable data in the screened variable candidate pool, and performing one-hot encoding on the level; The processed variable data are divided into training set and test set through cross-validation method; Calculating the information gain value of the training set to obtain the contribution to carbon emission prediction; The information gain values are sorted to obtain a key variable sequence with a preset ratio.
3. The carbon emission prediction method based on capturing the relationship between variables according to claim 1 is characterized in that: The key variable sequence and traffic carbon emissions are input into the Transformer model for feature embedding and position encoding to generate a time series vector, specifically including: Mapping the key variable sequence to a vector space of fixed dimension through a linear embedding layer to obtain an embedding vector; Position encoding the key variable sequence; The positional encoding is added to the embedding vector to obtain a temporal input vector.
4. The carbon emission prediction method based on capturing the relationship between variables according to claim 1 is characterized in that: The time series vector is used to predict the traffic carbon emission levels at different levels, specifically including: The long-distance dependencies of the time series vectors are captured through a multi-head self-attention mechanism, and residual connections and normalization processing are superimposed; The normalized features are input into the feedforward neural network and the predicted values are generated through the decoder.
5. The carbon emission prediction method based on capturing the relationship between variables according to claim 1 is characterized in that: Before calculating the correlation between the set of traffic carbon emission influencing factors and traffic carbon emissions based on a preset set of traffic carbon emission influencing factors, the method further includes: Obtaining consumption data of transportation energy, wherein the transportation energy includes coal, crude oil, gasoline, and diesel; The transportation energy consumption data is uniformly converted into standard coal equivalent according to a preset standard coal conversion coefficient; The transportation carbon emissions are calculated by weighted summation in combination with the emission factors.
6. A carbon emission prediction device based on capturing the relationship between variables, characterized in that: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: Execute the steps of a carbon emission prediction method based on capturing the relationship between variables as described in any one of claims 1 to 5.
7. A non-volatile computer storage medium for carbon emission prediction based on capturing relationships between variables, storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Execute the steps of a carbon emission prediction method based on capturing the relationship between variables as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Construction and prediction method of carbon emission prediction model based on Stacking algorithm and medium
CN115860173A
Electric power spot market day-ahead electricity price prediction method and electronic equipment
CN117745318A