Carbon emission prediction method and device based on relation between capture variables and medium

By designing multicollinear processing strategies in traffic carbon emission prediction and using XGBoost and Transformer models, the problem of difficulty in capturing nonlinear relationships and accurately screening key variables in the prior art is solved, and prediction accuracy and stability are improved.

CN120087979AActive Publication Date: 2025-06-03SHANDONG UNIV OF SCI & TECH

Patent Information

Application Number
CN202510571281.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-06-03
Estimated Expiration
2045-05-06

AI Technical Summary

Technical Problem

The prior art is difficult to capture the complex nonlinear relationships between influencing variables, resulting in poor prediction accuracy of transportation carbon emissions, and it is difficult to separate the independent contribution of each factor and accurately screen key variables.

Method used

By calculating the correlation and performing preliminary screening based on the preset set of factors affecting traffic carbon emissions, the variables are then multicollinearly detected and updated, nonlinear relationship analysis is performed using the XGBoost algorithm, key variable sequences are screened out, and input them into the Transformer model for feature embedding and position encoding, and time series vectors are generated for prediction.

Benefits of technology

Effectively capturing the nonlinear relationship between variables enhances the prediction ability of the model, improves the accuracy and stability of traffic carbon emission prediction, and ensures the scientificity of the variable screening process and the reliability of model construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120087979A_ABST
    Figure CN120087979A_ABST
Patent Text Reader

Abstract

The invention discloses a carbon emission prediction method and device based on the relation between capture variables and a medium, and relates to the technical field of traffic carbon emission prediction. The method comprises the following steps: based on a preset traffic carbon emission influence factor set, calculating the correlation between the traffic carbon emission influence factor set and the traffic carbon emission, and carrying out preliminary screening to obtain a preliminary variable candidate pool; performing multi-collinearity detection on the preliminary variable candidate pool and updating the preliminary variable candidate pool to generate a screened variable candidate pool; performing nonlinear relation analysis on the screened variable candidate pool through an XGBoost algorithm, and screening to obtain a key variable sequence; inputting the key variable sequence and the traffic carbon emission into a Transform model, carrying out feature embedding and position coding, and generating a time sequence vector; and respectively predicting traffic carbon emission levels under different levels for the time sequence vectors. According to the method, the scientificity of the variable screening process and the reliability of model construction are ensured, and then the prediction capability of the model is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of traffic carbon emission prediction, and particularly to a carbon emission prediction method, device and medium based on capturing the relationship between variables. Background Art

[0002] With the continuous development of the economy and the rapid progress of transportation technology, the number of motor vehicles has increased significantly, and traffic has shown an exponential growth trend. However, the current transportation system still highly relies on traditional internal combustion engine vehicles powered mainly by petroleum derivatives such as gasoline and diesel. This driving method centered on carbon-based energy has caused a sharp rise in carbon emissions in the transportation field, and it has been increasing year by year with the acceleration of the urbanization process.

[0003] Traffic carbon emission prediction aims to predict the carbon emission level of traffic activities in a future period by integrating various traffic carbon emission impact data. The current research mainly focuses on two aspects: screening traffic carbon emission impact factors and establishing traffic carbon emission prediction models. The STIRPAT (Stochastic Impacts by Regression on Population, Affluence, and Technology) model and the driving factor decomposition method represented by LMDI (Logarithmic Mean Divisia Index) are commonly used methods for screening traffic carbon emission impact factors. However, these methods are difficult to capture the complex non-linear relationships between influencing variables. In addition, during the process of screening impact factors, the existence of multicollinearity makes it difficult to accurately separate the independent contributions of each factor when constructing a traffic carbon emission prediction model, thereby interfering with the existing screening methods of prediction results. A common processing strategy is to calculate the degree of multicollinearity between impact factors through the Variance Inflation Factor (VIF), and then perform processing through regularization, PCA (Principal Component Analysis), etc. However, PCA will cause specific information loss during the dimension reduction process; regularization introduces estimation bias and has a large dependence on regularization parameters. Therefore, there is an urgent need to design a reasonable optimization strategy to process variables with multicollinearity to ensure the stability of variables, thereby enhancing the prediction ability of the model.

[0004] Recently, deep neural network architectures represented by Long Short-Term Memory (LSTM) and attention mechanisms have significantly improved traffic carbon emission prediction results. However, problems such as information forgetting, low computational efficiency, poor feature interaction ability, and easy overfitting still exist. Therefore, there is an urgent need to construct a new method that can comprehensively consider multiple factors, accurately screen key variables, and efficiently predict traffic carbon emissions.

[0005] Through the above analysis, the problems and defects existing in the prior art are as follows: Traffic carbon emission prediction in the prior art is difficult to capture the complex non-linear relationships between influencing variables, including separating the independent contributions of each factor, unable to accurately screen key variables, which further leads to poor prediction accuracy. Summary of the Invention

[0006] The embodiments of the present application provide a carbon emission prediction method, device, and medium based on capturing relationships between variables, which can solve the problems in the prior art that traffic carbon emission prediction is difficult to capture the complex non-linear relationships between influencing variables, including separating the independent contributions of each factor, unable to accurately screen key variables, and further leading to poor prediction accuracy.

[0007] In a first aspect, the embodiments of the present application provide a carbon emission prediction method based on capturing relationships between variables. The method includes: 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, 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 non-linear 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 a Transformer model for feature embedding and position encoding to generate a time series vector; predicting the traffic carbon emission levels at different level levels for the time series vector, where the level levels include low carbon, baseline, and high carbon.

[0008] 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 preliminarily screened to obtain a preliminary variable candidate pool, which specifically includes: calculating the linear relationship between the set of traffic carbon emission influencing factors and the traffic carbon emissions through the Pearson correlation coefficient method to obtain the Pearson correlation coefficient; screening the first influencing variables with the Pearson correlation coefficient greater than the first preset threshold; calculating the monotonic relationship between the set of traffic carbon emission influencing factors and the traffic carbon emissions through the Spearman rank correlation coefficient method to obtain the Spearman rank correlation coefficient; screening the second influencing variables with the Spearman rank correlation coefficient greater than the second preset threshold; combining the first influencing variables and the second influencing variables to obtain the preliminary variable candidate pool.

[0009] In one implementation of the present application, the preliminary variable candidate pool is subjected to multicollinearity detection and updated to generate a screened variable candidate pool, which specifically includes: calculating the VIF index of the first influencing variables and the second influencing variables, and screening the variables with multicollinearity; calculating the Pearson correlation coefficient between the variables with multicollinearity and the remaining variables for the variables in the preliminary variable candidate pool; normalizing the Pearson correlation coefficient to obtain the weight coefficients of each variable; and performing weighted reconstruction on the variables with multicollinearity according to the weight coefficients to generate the screened variable candidate pool.

[0010] In one implementation of the present application, the screened variable candidate pool is analyzed for non-linear relationships through the XGBoost algorithm to screen out the key variable sequence, which specifically includes: 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; dividing the processed variable data into a training set and a test set through the cross-validation method; calculating the information gain value of the training set to obtain the contribution degree to carbon emission prediction; and sorting the information gain values to obtain the key variable sequence of the preset proportion.

[0011] In one implementation of the present application, the key variable sequence and the traffic carbon emissions are input into the Transformer model for feature embedding and position encoding to generate a time series vector, which specifically includes: mapping the key variable sequence to a vector space of a fixed dimension through a linear embedding layer to obtain an embedding vector; performing position encoding on the key variable sequence; and adding the position encoding and the embedding vector to obtain the time series input vector.

[0012] In one implementation of the present application, the traffic carbon emission levels at different levels are predicted for the time series vector, which specifically includes: capturing the long-distance dependence relationship of the time series vector through the multi-head self-attention mechanism, and superimposing residual connection and normalization processing; inputting the normalized features into the feed-forward neural network, and generating the predicted values through the decoder.

[0013] In an implementation manner of the present application, before performing multicollinearity detection and updating on the preliminary variable candidate pool to generate a filtered variable candidate pool, the method further includes: obtaining satellite remote sensing image data, and extracting density features of the regional traffic network through a convolutional neural network; obtaining traffic monitoring videos, and extracting traffic flow features; combining the density features and traffic flow features to generate a multi-source feature tensor; performing multicollinearity detection on the multi-source feature tensor and a preset set of traffic carbon emission influencing factors together to obtain a fusion-type candidate variable pool.

[0014] In an implementation manner of the present application, 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 traffic energy, where the traffic energy includes coal, crude oil, gasoline, and diesel; uniformly converting the consumption data of traffic energy into standard coal equivalent according to a preset standard coal conversion coefficient; combining emission factors and calculating traffic carbon emissions through weighted summation.

[0015] In a second aspect, an embodiment of the present application further provides a carbon emission prediction device based on capturing relationships between variables. The device includes 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 to enable the at least one processor 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 and update on the preliminary variable candidate pool to generate a filtered variable candidate pool; perform non-linear relationship analysis on the filtered 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 to perform feature embedding and positional encoding to generate a time series vector; predict traffic carbon emission levels at different level levels for the time series vector, where the level levels include low carbon, benchmark, and high carbon.

[0016] In a third aspect, an embodiment of the present application further provides a non-volatile computer storage medium for carbon emission prediction based on capturing relationships between variables, storing computer-executable instructions, and the computer-executable instructions are configured 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 non-linear 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 positional encoding to generate a time series vector; predict traffic carbon emission levels at different level levels for the time series vector, and the level levels include low carbon, baseline, and high carbon.

[0017] An embodiment of the present application provides a carbon emission prediction method, device, and medium based on capturing relationships between variables. First, a new multicollinearity processing strategy is designed based on two screenings. For variables with multicollinearity, this 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 interpretability and model stability, ensuring the scientific nature of the variable screening process and the reliability of model construction, and further enhancing the prediction ability of the model; after preliminary screening and multicollinearity processing of variables, XGBoost is used to capture non-linear relationships and interactions. This multi-level screening method can improve the model's ability to identify traffic carbon emission influencing factors, enhance prediction accuracy and stability, and at the same time provide more accurate input features for the subsequent Transformer model; given the screened traffic carbon emission influencing factors, Transformer uses parallel computing to capture their periodic and trend changes, and captures complex long-distance dependence relationships and interaction features in traffic carbon emission data through the multi-head self-attention mechanism, enabling the model to simultaneously focus on the relationships between different time steps, thereby more comprehensively understanding the dynamic association between traffic activities and carbon emissions, and bringing more comprehensive and accurate prediction results; using the influencing factors highly correlated with traffic carbon emissions as inputs, the carbon emission levels at future time nodes are predicted through deep learning techniques, and cross-validation and regularization are used to reduce the risk of overfitting. It is of great significance for optimizing traffic planning and management and promoting the sustainable development of the traffic field, and realizes good traffic carbon emission management. Description of the Drawings

[0018] The drawings described herein are used to provide a further understanding of the present application, form a part of the present application, and the illustrative embodiments and descriptions of the present application are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings: Figure 1 Flow chart of a carbon emission prediction method based on capturing relationships between variables provided by an embodiment of the present application; Figure 2 Schematic diagram of the overall logical architecture of a carbon emission prediction method based on capturing relationships between variables provided by an embodiment of the present application; Figure 3 Flow chart of screening of traffic carbon emission influencing factors of a carbon emission prediction method based on capturing relationships between variables provided by an embodiment of the present application; Figure 4 Transformer neural network model diagram of a carbon emission prediction method based on capturing relationships between variables provided by an embodiment of the present application; Figure 5 Schematic diagram of the internal structure of a carbon emission prediction device based on capturing relationships between variables provided by an embodiment of the present application. Detailed implementation manners

[0019] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0020] An embodiment of the present application provides a carbon emission prediction method, device, and medium based on capturing relationships between variables, which solves the problem in the prior art that it is difficult to capture the complex non-linear relationships between influencing variables in traffic carbon emission prediction, including separating the independent contributions of each factor and being unable to accurately screen key variables, further resulting in poor prediction accuracy.

[0021] The technical solutions proposed in the embodiments of the present application will be described in detail below with reference to the drawings.

[0022] Figure 1 Flow chart of a carbon emission prediction method based on capturing relationships between variables provided by an embodiment of the present application. As Figure 1 shown, a carbon emission prediction method based on capturing relationships between variables provided by an embodiment of the present application specifically includes the following steps: Step 10: 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.

[0023] In this step, as Figure 2As shown in the figure, the preset set of traffic carbon emission influencing factors can be factors that affect traffic carbon emissions statistically from perspectives such as economic development, social factors, transportation, technological development, policies, and environmental factors, including population size, motor vehicle ownership, per capita GDP, passenger and freight turnover, traffic development level, and energy intensity. All data can be obtained from "China Energy Statistical Yearbook", "China Statistical Yearbook", "Statistical Bulletin of the Transportation Industry", etc.

[0024] As an alternative embodiment, before calculating the correlation between the set of traffic carbon emission influencing factors and traffic carbon emissions based on the preset set of traffic carbon emission influencing factors, the method may further include: obtaining data on the consumption of traffic energy, where traffic energy includes raw coal, gasoline, kerosene, diesel, fuel oil, liquefied petroleum gas, natural gas, heat, and electricity; according to the preset standard coal conversion coefficient, uniformly converting the data on the consumption of traffic energy into standard coal equivalent; combining the emission factors and calculating the traffic carbon emissions through weighted summation.

[0025] In this step, since it is necessary to quickly simulate the traffic carbon emission trend at the macro level, 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 by combining the emission factors, where the energy consumption can be obtained from the "China Energy Statistical Yearbook".

[0026] To unify the calculation unit, in this step, different energy consumption data are uniformly converted into standard coal data:

[0027] In the formula: represents the calculated carbon emissions, in ten thousand tons; refers to the set of different energy types, mainly including coal, crude oil, gasoline, diesel, etc.; represents the th type of energy consumption data volume, unit: ten thousand tons; refers to the coefficient converted into unit standard coal; is the emission factor, and the data is from the "National Greenhouse Gas Inventory Guidelines" published by the IPCC.

[0028] As an alternative embodiment, calculate the correlation between the set of traffic carbon emission influencing factors and traffic carbon emissions, and conduct a preliminary screening to obtain a preliminary variable candidate pool, which may specifically include: Step 101: Calculate the linear relationship between the set of traffic carbon emission influencing factors and traffic carbon emissions through the Pearson correlation coefficient method to obtain the Pearson correlation coefficient; Step 102: Screen the first influencing variables whose Pearson correlation coefficient is greater than the first preset threshold.

[0029] In this step, the Pearson correlation coefficient method is used to preliminarily screen the influencing factors of carbon emissions. As Figure 3 shown, specifically, the Pearson correlation coefficient method aims to measure the linear relationship between two variables and is used in this step to calculate the Pearson correlation coefficient between each influencing factor and the traffic carbon emissions:

[0030] In the formula: represents the observed value of the th influencing factor of carbon emissions; is the mean value. Similarly, and represent the observed value and the mean value of the traffic carbon emissions.

[0031] Furthermore, after obtaining the Pearson correlation coefficient between each influencing factor and the traffic carbon emissions, a threshold is set to screen out the influencing factors with high correlation. For example, a threshold is set, . The influencing factors that meet the threshold are proved to have a strong significant correlation with the traffic carbon emissions. For the factors with insignificant correlation, that is, the p-value is greater than 0.05, they can be considered for removal from the model to obtain the screened variables .

[0032] Step 103: Calculate the monotonic relationship between the set of traffic carbon emission influencing factors and the traffic carbon emissions through the Spearman rank correlation coefficient method to obtain the Spearman rank correlation coefficient; Step 104: Screen out the second influencing variables with the Spearman rank correlation coefficient greater than the second preset threshold; In this step, since the Pearson correlation coefficient can only measure the linear relationship and may not be sensitive enough to the non-linear relationship, the Spearman rank correlation coefficient method needs to be used for further screening. The Spearman rank correlation coefficient is a non-parametric statistical method used to measure the monotonic relationship between two variables: the traffic carbon emissions and their influencing factors. Specifically: Sort the observed values of each variable from smallest to largest, then assign a rank to each observed value, and calculate the rank difference of each pair of variables:

[0033] In the formula, is the rank difference of the th sample; and are the ranks of and for the two variables respectively.

[0034] Further, calculate the Spearman rank correlation coefficient:

[0035] In the formula: is the number of samples.

[0036] Generally speaking, the closer it is to 1, the stronger the correlation between the two variables. Therefore, a threshold can be set to screen out the influencing factors with high correlation with traffic carbon emissions. Similarly, by setting to verify whether each correlation coefficient is significant, the screened variables are obtained.

[0037] Step 105: Combine the first influencing variable and the second influencing variable to obtain a preliminary variable candidate pool.

[0038] In this step, combine and to construct a preliminary variable candidate pool .

[0039] Step 20: Perform multicollinearity detection and update on the preliminary variable candidate pool to generate a screened variable candidate pool.

[0040] As an optional embodiment, perform multicollinearity detection and update on the preliminary variable candidate pool 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, and screen out the variables with multicollinearity.

[0041] In this step, eliminate the multicollinearity between variables by the weighting method. First, perform VIF (Variance Inflation Factor) detection on the variables in the preliminary candidate pool , calculate the VIF index between variables. If the VIF index is greater than 10, it is considered that the variable has severe multicollinearity.

[0042]

[0043] In the formula: represents the influencing factor of traffic carbon emissions; represents the degree of correlation between the th independent variable as the dependent variable and all other independent variables as independent variables.

[0044] Step 202: Calculate the Pearson correlation coefficient between the variables with multicollinearity and the remaining variables for the variables in the preliminary variable candidate pool.

[0045] In this step, calculate the Pearson correlation coefficient between the variables with multicollinearity and other variables:

[0046] In the formula: represents the variable with multicollinearity, represents the remaining other variables. and represent the means of the variables with multicollinearity and the remaining variables respectively.

[0047] Step 203: Normalize the Pearson correlation coefficient to obtain the weight coefficients of each variable; Then, normalize the Pearson correlation coefficient of the variables to calculate the weights.

[0048]

[0049] In the formula: is the weight of the remaining variables.

[0050] Step 204: According to the weight coefficients, perform weighted reconstruction on the variables with multicollinearity to generate a candidate pool of screened variables.

[0051] In this step, optimize and update the candidate pool of variables according to the weighted average for the variables with multicollinearity :

[0052] In the formula: is the updated variable, is the variable value.

[0053] Step 30: Perform non - linear relationship analysis on the candidate pool of screened variables through the XGBoost algorithm to screen out the key variable sequence.

[0054] In this step, after eliminating the influence of multicollinearity through the weight analysis method, use XGBoost for secondary screening. XGBoost is an ensemble learning algorithm based on gradient boosting, which determines the relative importance of each variable (influence factor) on traffic carbon emissions by training a gradient - boosting decision tree (GBDT) model.

[0055] As an optional embodiment, perform non - linear relationship analysis on the candidate pool of screened variables through the XGBoost algorithm to screen out the key variable sequence, which may specifically include: Step 301: Perform data standardization and missing - value processing on the variable data in the candidate pool of screened variables, and perform one - hot encoding on the level. In this step, XGBoost uses the gain to represent the contribution of each variable. After sorting each gain value, an absolute threshold is set to screen out the important influencing factors of traffic carbon emissions. Specifically, for the variables in the candidate pool perform data preprocessing, including filling missing values with the mean; standardizing data with different dimensions so that each feature has the same scale; for categorical data, such as low, medium, and high, perform one-hot encoding.

[0056] Step 302: Divide the processed variable data into a training set and a test set by the cross-validation method; Step 303: Calculate the information gain value of the training set to obtain the contribution degree to carbon emission prediction; In this step, an XGBoost model is constructed to screen out the features that have the greatest impact on carbon emission prediction. The XGBoost model can be expressed as:

[0057] In the formula: is the traffic carbon emission value of the th sample; represents the number of iterations; is the predicted value of the th round of the tree.

[0058] The loss function of XGBoost can be expressed as:

[0059] In the formula: is used to measure the error between the predicted value and the actual value and can be represented by the mean squared error; is the regularization term, which controls the complexity of the model and prevents overfitting.

[0060] Furthermore, XGBoost uses the gradient boosting algorithm to train the model. In each round of iteration, the prediction is adjusted through the residuals of the previous round. In each round of iteration, XGBoost updates the model by calculating the optimal output value of the leaf nodes of each tree. By calculating the importance of each feature, the features that have the greatest impact on carbon emission prediction are screened out. Information gain is a commonly used feature importance scoring method in XGBoost, which represents the information gain brought by the feature. The greater the importance, the greater the contribution of the feature to the model prediction.

[0061] Step 304: Sort the information gain values to obtain a key variable sequence with a preset ratio.

[0062] In this step, for example, take the top 50% as the screened influencing factors of traffic carbon emissions, which is expressed as:

[0063] 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 node, represents the sum of the Hessian matrices (second-order derivatives); and represent the L2 regularization coefficient and the minimum gain threshold for splitting, respectively. According to the feature importance scores, the features that have the most impact on carbon emission prediction can be screened out.

[0064] Step 40: Input the key variable sequence and traffic carbon emissions into the Transformer model for feature embedding and positional encoding to generate a time series vector.

[0065] In this step, after a series of variable screenings, the key factors affecting traffic carbon emissions , which is a data set, is one of the data. Input and the historical traffic carbon emission data into the Transformer for training to construct a traffic carbon emission prediction model based on the Transformer, as shown in Figure 4 .

[0066] As an optional embodiment, inputting the key variable sequence and traffic carbon emissions into the Transformer model for feature embedding and positional encoding to generate a time series vector may specifically include: Step 401: Map the key variable sequence to a vector space of a fixed dimension through a linear embedding layer to obtain an embedding vector.

[0067] In this step, the Transformer has strong feature extraction capabilities and can comprehensively understand the dynamic relationship between influencing factors and carbon emissions. For the key factors of traffic carbon emissions , it is necessary to map them to a vector space of a fixed dimension through a linear embedding layer. The formula is:

[0068] where: is the embedding matrix; is the bias; is the obtained embedding vector.

[0069] Step 402: Perform positional encoding on the key variable sequence.

[0070] In this step, in order to preserve the position information in the sequence, position encoding is required. Position encoding is used to introduce position awareness for each input feature. By adding the 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 as follows:

[0071]

[0072] In the formula: represents the position of the current feature; represents the index of each element in the current vector; represents the dimension of the position encoding vector.

[0073] Step 403: Add the position encoding and the embedding vector to obtain the time series input vector.

[0074] In this step, add the position encoding and the embedding vector to obtain the input vector that enhances the sequential information , and the formula is:

[0075] Step 50: Predict the traffic carbon emission levels at different level levels for the time series vector. The level levels include low carbon, baseline, and high carbon.

[0076] As an optional embodiment, predicting the traffic carbon emission levels at different level levels for the time series vector may specifically include: Step 501: Capture the long-range dependencies of the time series vector through the multi-head self-attention mechanism, and superimpose residual connection and normalization processing.

[0077] In this step, the input vector will be fed into the encoder to capture the long-range dependencies in the sequence data. The encoder consists of multiple encoder layers, and each layer includes a multi-head self-attention mechanism and a feed-forward neural network. Among them, the multi-head attention mechanism calculates the self-attention multiple times and then concatenates the results to capture the features in different subspaces. The self-attention mechanism is the core of the Transformer. It captures the global dependencies by calculating the weights of each position in the input sequence. Specifically:

[0078] In the formula: represents the dimension of the vector; , and are obtained by linear transformation from the input vector through linear transformation.

[0079] The multi-head self-attention mechanism consists of multiple self-attention mechanisms, aiming to synthesize dependency relationships from different perspectives.

[0080]

[0081] In the formula: represents a learnable weight matrix; is the number of heads of the multi-head self-attention mechanism.

[0082] The feature representation output by the multi-head self-attention mechanism will enhance the stability and training efficiency of the model through residual connection and normalization:

[0083] Step 502: Input the normalized features into the feed-forward neural network to generate prediction values through the decoder.

[0084] In this step, the feed-forward neural network is used to further process the features:

[0085] In the formula: , and are learnable parameters.

[0086] The output of the feed-forward neural network will go through another residual connection and normalization to obtain the output feature representation of the encoder , and then, based on the output feature representation of the encoder , a decoder is designed to generate prediction values. The decoder includes temporal aggregation and an output layer with a fully connected layer as the core. Among them, temporal aggregation takes the mean of the output sequences of all time steps, and the formula is:

[0087] The output layer uses a fully connected layer to map the aggregation result to the prediction value, and the formula is:

[0088] Finally, under three different scenarios of low-carbon, baseline, and high-carbon, where low-carbon is under the background of implementing energy conservation and emission reduction policies, improving energy efficiency, promoting new energy transportation tools, and optimizing the traffic structure, statistical traffic carbon emission influencing factors are carried out, and screening and prediction tasks are carried out; the baseline is to continue the existing policy development model and law, and conduct traffic carbon emission prediction under the existing state and level; high-carbon corresponds to the situation where the operation in the transportation field still highly depends on carbon-based energy, and carbon control measures lag, resulting in continuous growth of carbon emissions. The purpose of formulating different prediction scenarios is to provide a comprehensive perspective on carbon emission prediction, reveal the sensitivity of key influencing factors to carbon emissions, and thus provide a basis for policy formulation.

[0089] Therefore, in the embodiments of the present application, the future development level of traffic carbon emissions is predicted under three different scenarios, and three different carbon emission trajectories are obtained.

[0090] As an alternative embodiment, before performing multiple collinearity 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 the density characteristics of the regional traffic network through a convolutional neural network; obtaining traffic monitoring videos, and extracting the traffic flow characteristics; combining the density characteristics and the traffic flow characteristics to generate a multi-source feature tensor; jointly performing multiple collinearity detection on the multi-source feature tensor and a preset set of traffic carbon emission influencing factors to obtain a fusion-type candidate variable pool.

[0091] In this step, satellite remote sensing images can provide large-scale and macroscopic traffic infrastructure information: road distribution, traffic hub locations, and automatically learn the spatial patterns in the images through convolutional layers: road density, number of intersections, quantifying the physical characteristics of the traffic network, such as the road length per square kilometer; traffic monitoring videos and traffic flow statistics extract real-time traffic flow characteristics, capturing dynamic traffic behaviors: vehicle numbers, speeds, congestion conditions, generating time series data through video analysis algorithms, such as the traffic flow per hour), or the number of vehicles passing through an intersection camera per minute can also be counted to reflect the traffic busyness and quantify the dynamic usage characteristics of the traffic network, such as the traffic flow during peak hours; integrating static characteristics (satellite) and dynamic characteristics (video) data to form a multi-dimensional feature representation, the multi-source feature tensor combines the traffic network density (static) and the traffic flow (dynamic) to form a three-dimensional tensor containing spatio-temporal information, which includes both spatial structure and temporal changes.

[0092] Furthermore, a fusion-type candidate variable pool is constructed based on the variable screening process and the above-mentioned set of traffic carbon emission influencing factors to screen out key influencing factors. In this way, the set of traffic carbon emission influencing factors provides the social and economic background, such as population, GDP, vehicle ownership, the static characteristics (satellite) reflect long-term trends, and the dynamic characteristics (video) capture short-term fluctuations, enabling multi-source data to complement each other, constructing a more comprehensive and accurate traffic feature model, and providing a scientific basis for traffic planning, carbon emission prediction, or policy optimization.

[0093] In summary, to train the Transformer-based traffic carbon emission prediction model, first standardize the influencing factors and historical traffic carbon emission data screened by XGBoost, including data normalization, missing value processing, etc.; further construct a traffic carbon emission dataset; then randomly select 70% of the data as the training set, 20% of the data as the test set, and 10% of the data as the validation set. By adjusting the values of the parameters and weights in the model through backpropagation, the learning rate can be dynamically adjusted under the Adam optimizer, and the stochastic gradient descent is used to optimize the loss function, which is represented by the mean squared error. When the loss function approaches the minimum or does not change for many times, it is considered that the training is completed, and the optimal traffic carbon emission prediction model is obtained.

[0094] The above is the method embodiment proposed in this application. Based on the same inventive concept, the embodiments of this application also provide a carbon emission prediction device based on capturing the relationships between variables, and its structure is as Figure 5 shown.

[0095] Figure 5 It is a schematic internal structure diagram of a carbon emission prediction device based on capturing the relationships between variables provided by the embodiments of this application. As Figure 5 shown, the device includes: At least one processor 501; And a memory 502 communicatively connected to the at least one processor; Wherein, the memory 502 stores instructions executable by the at least one processor. The instructions are executed by the 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 the traffic carbon emission amount 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 non-linear relationship analysis on the screened variable candidate pool through the XGBoost algorithm to screen and obtain a key variable sequence; input the key variable sequence and the traffic carbon emission amount into the Transformer model for feature embedding and positional encoding to generate a time series vector; predict the traffic carbon emission levels at different level levels for the time series vector, and the level levels include low carbon, baseline, and high carbon.

[0096] Some embodiments of this application provide corresponding to Figure 1A non-volatile computer storage medium for carbon emission prediction based on capturing relationships between variables stores computer-executable instructions, which are set to: calculate the correlation between a 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 on the preliminary variable candidate pool to generate a screened variable candidate pool; perform non-linear 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 positional encoding to generate a time series vector; predict traffic carbon emission levels at different level levels for the time series vector, where the level levels include low carbon, baseline, and high carbon.

[0097] Each embodiment in this application is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the Internet of Things devices and media, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the partial description of the method embodiments for the relevant parts.

[0098] The systems and media provided in the embodiments of this application correspond one-to-one with the methods. Therefore, the systems and media also have beneficial technical effects similar to those of their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be elaborated here.

[0099] Those skilled in the art should understand that the embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.

[0100] This application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementing in the process Figure 1 one process or multiple processes and / or blocksFigure 1 means for the functions specified in one or more boxes.

[0101] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one Figure 1 one or more processes and / or boxes Figure 1 means for the functions specified in one or more boxes.

[0102] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus, such that a series of operational steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one Figure 1 one or more processes and / or boxes Figure 1 means for the functions specified in one or more boxes.

[0103] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0104] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.

[0105] Computer-readable media includes both permanent and non-permanent, removable and non-removable media implemented by any method or technology for storing information. The 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 memory (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 discs (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 accessible by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0106] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising said element.

[0107] The above description is only for the embodiments of the present application and is not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall 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: 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 a preliminary screening is performed to obtain a preliminary variable candidate pool; Performing multicollinearity detection on the preliminary variable candidate pool and updating it to generate a screened variable candidate pool; Performing nonlinear relationship analysis on the screened variable candidate pool by using the XGBoost algorithm to screen out key variable sequences; 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 respectively predicted for transportation carbon emission levels at different levels, wherein 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 correlation between the set of factors affecting traffic carbon emissions and traffic carbon emissions is calculated, and a preliminary screening is performed to obtain a preliminary variable candidate pool, specifically including: The linear relationship between the set of influencing factors of traffic carbon emissions and traffic carbon emissions is calculated by the Pearson correlation coefficient method to obtain the Pearson correlation coefficient; Screening a first influencing variable whose Pearson correlation coefficient is greater than a first preset threshold; The monotonic relationship between the set of influencing factors of traffic carbon emissions and traffic carbon emissions is calculated by the Spearman rank correlation coefficient method to obtain the Spearman rank correlation coefficient; Screening a second influencing variable whose Spearman rank correlation coefficient is greater than a second preset threshold; The first influencing variable and the second influencing variable are combined to obtain a preliminary variable candidate pool.

3. A carbon emission prediction method based on capturing the relationship between variables according to claim 2, characterized in that: Performing multicollinearity detection on the preliminary variable candidate pool and updating 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 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; According to the weight coefficients, the variables with multicollinearity are weighted and reconstructed to generate the screened variable candidate pool.

4. The carbon emission prediction method based on capturing the relationship between variables according to claim 1 is characterized in that: The nonlinear relationship analysis is performed on the selected variable candidate pool by the XGBoost algorithm 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 by 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.

5. 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, 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 position code is added to the embedding vector to obtain a temporal input vector.

6. 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 respectively predicted at different levels of traffic carbon emission levels, specifically including: The long-distance dependency of the time series vector is captured through a multi-head self-attention mechanism, and residual connection and normalization processing are superimposed; The normalized features are input into the feedforward neural network and the prediction values ​​are generated through the decoder.

7. The carbon emission prediction method based on capturing the relationship between variables according to claim 1 is characterized in that: Before performing multicollinearity detection and updating on the preliminary variable candidate pool to generate a screened variable candidate pool, the method further includes: 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; The multi-source feature tensor and a preset set of traffic carbon emission influencing factors are jointly subjected to multicollinearity detection to obtain a fusion candidate variable pool.

8. 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 the traffic carbon emission amount based on the 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; According to the preset standard coal conversion coefficient, the traffic energy consumption data is uniformly converted into standard coal equivalent; Combined with the emission factors, the transportation carbon emissions are calculated by weighted summation.

9. 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: 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 a preliminary screening is performed to obtain a preliminary variable candidate pool; Performing multicollinearity detection on the preliminary variable candidate pool and updating it to generate a screened variable candidate pool; Performing nonlinear relationship analysis on the screened variable candidate pool by using the XGBoost algorithm to screen out key variable sequences; 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 respectively predicted for transportation carbon emission levels at different levels, wherein the levels include low carbon, baseline, and high carbon.

10. 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: 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 a preliminary screening is performed to obtain a preliminary variable candidate pool; Performing multicollinearity detection on the preliminary variable candidate pool and updating it to generate a screened variable candidate pool; Performing nonlinear relationship analysis on the screened variable candidate pool by using the XGBoost algorithm to screen out key variable sequences; 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 respectively predicted for transportation carbon emission levels at different levels, wherein the levels include low carbon, baseline, and high carbon.

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

  • Carbon price prediction method and system based on multivariable screening strategy, and storage medium

    CN117787487A

  • Regional traffic carbon emission prediction method and system based on Lasso and Attention-GRU

    CN117875514A

  • Transform-based genome prediction method

    CN118629494A

Cited By

  • Enterprise carbon emission prediction and decision support method and device fusing LMDI decomposition and lightweight Transform prediction

    CN121146286A

  • New energy vehicle high-voltage system dynamic risk assessment method and device based on multi-source data fusion

    CN121366457A