Times Net multi-source migration prediction method for carbon emission

Through the TimesNet multi-source migration prediction method, the problems of limited carbon emission data and high prediction costs are solved, and efficient and accurate carbon emission prediction is achieved.

CN119476594APending Publication Date: 2025-02-18CHONGQING TECH & BUSINESS UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411549909.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing technology is difficult to accurately predict urban carbon emissions, and the amount of carbon emission data is limited, so the cost of retraining the model is relatively high.

Method used

TimesNet multi-source migration prediction method is used to predict the prediction through data acquisition and preprocessing, source domain model pre-training, target domain multi-source model construction and fine-tuning, and migration training model, and the prediction results are finally output.

Benefits of technology

By capturing time series features and domain adaptation layers, the inter-domain differences are reduced, the cost and computational complexity of carbon emission prediction are reduced, and the prediction accuracy is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476594A_ABST
    Figure CN119476594A_ABST
Patent Text Reader

Abstract

The invention relates to the field of carbon emission prediction, and discloses a TimesNet multi-source migration prediction method for carbon emission, and the method comprises the following steps: S1, data collection and preprocessing; s2, pre-training a source domain model; s3, construction and fine tuning of a target domain multi-source model; s4, the trained multi-source model is migrated for prediction; and S5, outputting a final prediction result. According to the method, a TimesNet multi-source migration prediction model for the carbon emission is established, the time change of the carbon emission data is decomposed into two-dimensional tensors through the TimesNet model, and the time sequence characteristics of the carbon emission data are considered; a domain adaptive layer is added into the model to minimize inter-domain differences, so that the problems that the inter-domain differences in the later period of network learning are significant and the transferability is reduced are solved; by transforming the loss function and carrying out transfer learning, decomposition, integration and prediction of carbon emission can be completed without integrating a model, and the problem that the cost consumed by redeveloping a model for a carbon emission prediction task is large is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of carbon emission prediction, and in particular to a TimesNet multi-source migration prediction method for carbon emission. Background Art

[0002] By predicting carbon emissions, we can understand current and future carbon emission trends, which will help to formulate corresponding carbon reduction policies and targets and determine appropriate action plans. Secondly, by predicting carbon emissions, we can evaluate the effectiveness and impact of different carbon reduction policies, which will help decision makers choose the most effective emission reduction measures and optimize resource allocation. This has far-reaching significance for China's carbon reduction actions and the realization of the "dual carbon" goals.

[0003] Since the amount of carbon emission data is limited and the cost of retraining the model for carbon emission prediction tasks is high, technical personnel in this field are committed to developing a TimesNet multi-source migration prediction method for carbon emissions. By learning the knowledge of the source domain and migrating it to the target domain, a new prediction method is provided for the carbon emission prediction task. Summary of the invention

[0004] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present invention is to provide a TimesNet multi-source migration prediction method for carbon emissions, so as to accurately predict urban carbon emissions.

[0005] To achieve the above-mentioned purpose, the TimesNet multi-source migration prediction method for carbon emissions of the present invention comprises the following steps: S1: data collection and preprocessing; S2: source domain model pre-training; S3: construction and fine-tuning of the target domain multi-source model; S4: migration of the trained multi-source model for prediction; S5: output of the final prediction result.

[0006] As an optimization, in step S1, the main greenhouse gas emission areas of energy activities, industrial production processes, and waste treatment in N source cities and target cities are selected, and the emission estimation method is used to determine the greenhouse gas emissions of carbon dioxide, methane, and nitrous oxide in each area as the original data; and the missing values ​​are filled and normalized.

[0007] As an optimization, the source domain model pre-training in step S2 includes two steps: establishing a source domain model and training the source domain model; the establishing the source domain model includes establishing sub-networks containing an input layer, a TimesNet layer, and a fully connected layer for N source domains respectively; the training the source domain model includes: inputting the N source domain data into the N sub-networks for training respectively, extracting time features and optimizing model parameters, and finally saving the pre-trained model parameters.

[0008] As an optimization, the input layer is used to accept time series data input, the fully connected layer is used for feature conversion, and the TimesNet layer is used to extract time series features; the TimesNet model is composed of multiple TimesBlocks stacked together, and the steps include: A1: FFT transformation to discover the periodicity of the time series; A2: converting the 1D time series into a 2D tensor; A3: Inception module uses multi-scale 2D convolution kernels to extract features; A4: feature aggregation based on amplitude.

[0009] As an optimization, the construction and fine-tuning of the target domain multi-source model in step S3 includes the following steps:

[0010] B1: Initialize the target domain model; B2: Construct the target domain sample set; B3: Input the source domain and target domain samples into the subnet for training iterations; B4: Save the trained model.

[0011] As an optimization, when initializing the target domain model in step B1, the target domain model is initialized with the source domain model parameters saved in the pre-training stage; the target domain model is constructed to include N sub-networks, each of which consists of an input layer, a TimesNet layer, a fully connected layer, and a domain adaptation layer; the domain adaptation layer introduces the maximum mean difference loss to solve the domain difference problem, and the maximum mean difference is MMD; its calculation steps are:

[0012] Assume source domain Target domain MMD calculates the distance between two distributions in the Reproducing Kernel Hilbert Space (RKHS), and the MMD of the source domain and the target domain in RKHS is defined as:

[0013]

[0014] in, is a nonlinear function in RKHS, which is used to map the original variables into RKHS.

[0015] MMD quantifies the distribution difference by calculating the distance between the mean of the source domain and the mean of the target domain in RKHS. The smaller the MMD value, the more similar the two domains are.

[0016] As an optimization, step B2 performs sliding window processing on the target domain data when constructing the target domain sample set, including the following steps: C1: selecting an appropriate window size for daily carbon emissions data; C2: selecting a step size; C3: starting the sliding window from the starting position of the target domain data; C4: traversing the target domain data through the sliding window and extracting local areas as sub-samples; C5: storing all extracted sub-samples to form a sub-sample set of the target domain.

[0017] As an optimization, the training iteration of the source domain and target domain samples input into the subnet in step B3 includes the following steps: D1: extracting the temporal features of the source domain and target domain samples; D2: integrating the output results of N subnets; D3: calculating three kinds of losses; D4: optimizing the total loss and updating the parameters;

[0018] Extracting the time features of source domain and target domain samples in D1 includes inputting the source domain and target domain samples into the corresponding TimesNet sub-networks, extracting the time features, and inputting the extracted time features into the fully connected layer to obtain the prediction values ​​of multiple sub-networks;

[0019] When integrating the output results of N subnetworks in D2, the subnetwork output values ​​are integrated by averaging as the predicted value of the model;

[0020] The three types of losses calculated in D3 include MMD loss, regression loss of subnet output, and difference loss. The calculation formula is as follows:

[0021] MMD loss: The MMD loss of each subnet is calculated in the domain adaptation layer to align the distribution difference between the source domain and the target domain. The total MMD loss ψ mmd Defined as the average of multiple subnet MMDs:

[0022]

[0023] Regression loss: The average of the output results of multiple subnets is used as the prediction value of the model to calculate the regression loss, regression loss ψ reg Defined as:

[0024]

[0025] Among them, J(.) is the mean square error (MSE) loss function, P(.) is the regression predictor, and F(.) is the feature extractor;

[0026] Difference loss: used to align the prediction outputs of multiple subnetworks on the target sample. In the actual training process, the subnetworks are trained from different source domains, and the actual pure output prediction values ​​may be different. However, for a given target sample, a model should have only one prediction result. Therefore, the difference between the subnetwork output results is taken as part of the loss function, the difference loss ψ disc Defined as:

[0027]

[0028] Where N T represents the number of samples of target domain data, N is the number of sub-networks, J(.) is the mean square error (MSE) loss function, P(.) is the regression predictor, F(.) is the feature extractor, and x k is the kth sample in the target domain data, is the normalization coefficient, ensuring that the differences of all subnetwork pairs are averaged;

[0029] In D4, the total loss is optimized and the total loss function of the model in the parameter update is defined as

[0030] L total =ψ reg +λψ mmd +γψ disc

[0031] Among them, λ and γ are weight parameters used to balance the contribution between different losses.

[0032] As an optimization, when migrating the trained multi-source model for prediction in step S4, the trained model is loaded through the migration strategy of model migration and loss function migration, and the training and optimization of the target domain TimesNet multi-source migration model are completed according to the optimized parameters.

[0033] As an optimization, when outputting the final prediction result in step S5, the output results of multiple subnets are integrated, and the results of all subnets are averaged as the final prediction result of the model.

[0034] The beneficial effects of the present invention are as follows: the present invention takes into account the temporal characteristics of carbon emission data, decomposes the temporal changes of source domain data into changes within multiple cycles and between cycles through the TimesNet model, and efficiently extracts the features hidden in the complex temporal changes of the source domain; adds a domain adaptation layer to the model to minimize the differences between domains, and solves the problem that the differences between domains are significant in the later stage of network learning and the migration ability decreases; solves the problem that the amount of carbon emission data is limited and the cost of retraining the model for carbon emission prediction tasks is high by transforming the loss function and migrating. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flow chart of a specific implementation mode of the present invention.

[0036] Figure 2 It is a technical roadmap for a specific implementation of the present invention. DETAILED DESCRIPTION

[0037] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0038] like Figure 1-2 As shown, a TimesNet multi-source migration prediction method for carbon emissions includes the following steps: S1: data collection and preprocessing; S2: source domain model pre-training; S3: construction and fine-tuning of the target domain multi-source model; S4: migration of the trained multi-source model for prediction; S5: output of the final prediction result.

[0039] In this embodiment, in step S1, the main greenhouse gas emission areas of energy activities, industrial production processes, and waste treatment in N source domain cities and target domain cities are selected, and the emission estimation method is used to determine the greenhouse gas emissions of carbon dioxide, methane, and nitrous oxide in each field as the original data; and the missing values ​​are filled and normalized.

[0040] Specifically, the greenhouse gas emissions are average daily emissions data for at least one consecutive year.

[0041] Specifically, the method for estimating emissions in the energy sector is carried out using one of the following two methods:

[0042] Method 1: The apparent consumption of various fossil fuels, the unit calorific value of various fuels, the carbon content, the average oxidation rate of the main equipment consuming various fuels, and the carbon fixation of fossil fuels for non-energy purposes are comprehensively calculated using the following formula:

[0043] Carbon dioxide emissions = (fuel consumption (calorific value unit) x carbon content per unit fuel calorific value - carbon fixation) x carbon oxidation rate

[0044] Method 2: The sectoral method based on detailed technology is based on the activity level data of different sectors, equipment and fuel types, the unit calorific value and carbon content of various fuel types, and the oxidation rate of the main equipment consuming various fuels. The total emissions are calculated by cumulative calculation layer by layer as follows:

[0045] Emissions = ∑∑∑(EFi,j,k×Activityi,j,k)

[0046] Where EF is the emission factor (kg / TJ), Activity is the fuel consumption (TJ), i is the fuel type, j is the sector activity, and k is the technology type;

[0047] For biomass fuel activities, considering that the methane and nitrous oxide emissions from the combustion of biomass fuels are closely related to factors such as fuel type, combustion technology and equipment type, but the data on equipment type has not yet been determined, only the emissions by fuel type and sector are calculated. The specific calculation formula is:

[0048] Greenhouse gas emissions = ∑∑∑(EFa,b,c×Activitya,b,c)

[0049] Where EF is the emission factor, expressed in kg / TJ, Activity is the activity level, expressed in TJ, a is the fuel type, b is the department type, and c is the equipment type.

[0050] Specifically, the emission estimation method in the industrial production field takes the cement production process as an example and adopts the estimation formula in the "Guidelines for the Preparation of Provincial Greenhouse Gas Inventories":

[0051]

[0052] in is the carbon dioxide emission in the cement production process; AD clinker is the cement clinker output minus the clinker produced by carbide slag; EF 熟料 is the average emission factor for the cement production process.

[0053] Specifically, the greenhouse gas emissions in the waste treatment sector include: CH4 emissions from solid waste landfill, CO2 emissions from solid waste incineration, CH4 emissions from domestic sewage treatment, CH4 emissions from industrial wastewater treatment, and N2O emissions from wastewater treatment.

[0054] Calculation method for CH4 emissions from solid waste landfill:

[0055] E CH4 =(MSW T ×MSW F ×L0-R)×(1-OX)

[0056] Among them, E CH4 Methane emissions (tons of methane / year); MSW T Refers to the amount of municipal solid waste generated (tons of waste / year); MSW F It refers to the landfill treatment rate of municipal solid waste; L0 refers to the methane production potential of landfills of various management types (tons of methane / ton of waste); R refers to the methane recovery amount (tons of methane / year); OX refers to the oxidation factor (dimensionless).

[0057] Calculation method of CO2 emissions from solid waste incineration:

[0058]

[0059] in, is the CO2 emission from waste incineration (10,000 tons / year); i represents urban solid waste, hazardous waste, and sludge respectively; IW i Refers to the incineration volume of the i-th type of waste (10,000 tons / year); CCW i Refers to the carbon content ratio of the i-th type of waste; FCF i Refers to the proportion of mineral carbon in the total carbon content of the i-th type of waste; EF i Refers to the incineration efficiency of the i-th type of waste incinerator; 44 / 12 refers to the conversion coefficient of carbon into CO2.

[0060] Calculation method for CH4 emissions from domestic sewage treatment:

[0061]

[0062] in, It refers to the total amount of CH4 emitted from domestic sewage treatment in the inventory year (10,000 tons CH4 / year); TOW refers to the total amount of organic matter in domestic sewage in the inventory year (10,000 tons BOD / year); EF refers to the emission factor (10,000 tons CH4 / 10,000 tons BOD); R refers to the amount of CH4 recovered in the inventory year (10,000 tons CH4 / year).

[0063] The calculation formula for CH4 emissions from industrial wastewater treatment is:

[0064]

[0065] in, refers to CH4 emissions (kg CH4 / year); TOW refers to the total amount of organic matter in industrial wastewater in the inventory year (kg COD / year); i represents different industrial sectors; S i Refers to the total amount of organic matter removed in the form of sludge (kg COD / year); EF i refers to the emission factor (kg CH4 / kg COD); R i Refers to the amount of CH4 recovered (kg CH4 / year).

[0066] Calculation method of N2O emissions from wastewater treatment:

[0067]

[0068] in, Refers to the annual N20 emission in the inventory year (kg N20 / year); NE refers to the nitrogen content in wastewater (kg nitrogen / year); EFE refers to the N20 emission factor of wastewater (kg N20 / kg ammonia); 44 / 28 is the conversion factor

[0069] In this embodiment, the source domain model pre-training in step S2 includes two steps: establishing a source domain model and training the source domain model; the establishing the source domain model includes establishing sub-networks containing an input layer, a TimesNet layer, and a fully connected layer for N source domains respectively; the training the source domain model includes: inputting the N source domain data into the N sub-networks for training respectively, extracting time features and optimizing model parameters, and finally saving the pre-trained model parameters.

[0070] In this embodiment, the input layer is used to accept time series data input, the fully connected layer is used for feature conversion, and the TimesNet layer is used to extract time series features; the TimesNet model is composed of multiple TimesBlocks stacked together, and the steps include: A1: FFT transformation to discover the periodicity of the time series; A2: converting the 1D time series into a 2D tensor; A3: Inception module uses multi-scale 2D convolution kernels to extract features; A4: feature aggregation based on amplitude.

[0071] Specifically, in A1, FFT transform finds the periodicity of the time series. Assume that for a time series with a length of T and a record variable of C, the original 1-dimensional time series is represented as X 1D ∈R T×C , using the Fast Fourier Transform (FFT) to analyze the time series in the frequency domain:

[0072] A=Avg(Amp(FFT(X 1D ))),

[0073]

[0074] Where FFT(.) and Amp(.) represent the calculation of FFT and amplitude values, A∈R T represents the calculated amplitude of each frequency, Avg(.) represents the average value calculated from the C dimension, especially note that the jth value A j represents the intensity of the frequency-j periodic basis function, corresponding to the period length

[0075] Considering the sparsity of the frequency domain, avoiding the noise influence caused by meaningless high frequencies, selecting the first k amplitudes and obtaining the most significant frequencies {f1,...,f k} and unnormalized amplitude where k is a hyperparameter. These chosen frequencies also correspond to the period lengths {p1,...,p k},

[0076] Due to the conjugation property in the frequency domain, only The frequency within, so the formula of FFT transformation can be summarized as:

[0077] A,{f1,...,f k},{p1,...,p k}=Period(X 1D) .

[0078] Specifically, in A2, when converting a 1D time series into a 2D tensor, based on the selected frequency {f1,...,f k} and the corresponding period {p1,...,p k}, the one-dimensional time series X can be converted into 1D ∈R T×C Reconstruct into multiple 2D tensors:

[0079]

[0080] Padding(.) expands the time series to 0 along the time dimension so that it is consistent with Compatible, where P i and f i Respectively represent the number of rows and columns of the transformed two-dimensional tensor, Represents frequency f i , at the corresponding period length P i The next i-th reconstructed time series; finally, according to the selected frequency and period, a set of 2D tensors can be obtained Represents different 2D changes in time for k different periods, where the rows of the 2D tensor represent the changes between cycles and the columns represent the changes within cycles.

[0081] Specifically, in A3, when the Inception module uses a multi-scale 2D convolution kernel to extract features, for a 1-dimensional time series X with a length of T 1D ∈R T×C , at the beginning through the embedding layer Projecting the original input to deep features middle;

[0082] For the lth layer TimesBlock, the input is The process can be visualized as:

[0083]

[0084] For the lth TimesBlock, after obtaining a set of 2D tensors, we can easily obtain information representation through the parameter-efficient inception block, and then use the learned 2D representation Convert back to 1D space Aggregate and use Trunc(.) to convert the length (p i ×f i ) is truncated to the original length T, and the whole process is as follows:

[0085]

[0086] in, is the 2D tensor after the i-th transformation. In addition, for different reconstructed 2D tensors Shared inception blocks are used to improve parameter efficiency and keep the model's choice of hyperparameter k constant.

[0087] Specifically, in A4, when performing feature aggregation based on amplitude, k different one-dimensional representations need to be fused for the next layer Since the amplitude can reflect the relative importance of the selected frequency and period, and thus corresponds to the importance of each transformed 2D tensor, the 1D representation can be aggregated based on the amplitude as follows:

[0088]

[0089] Specifically, when decomposing carbon emission data and extracting time features, since such data is a time series involving complex changes, the current data decomposition technology only considers the modal characteristics of carbon emission data, but does not consider the temporal characteristics, and is unable to capture the long-term dependence of the time series changes. Therefore, the present invention chooses to use the TimesNet model to decompose the one-dimensional carbon emission time series into a two-dimensional tensor, which can capture both modal features and temporal features. In addition, the TimesNet model alone can complete data decomposition, integration and prediction, and there is no need to integrate multiple models and methods, which greatly reduces the computational complexity and complexity of the prediction model.

[0090] In this embodiment, the construction and fine-tuning of the target domain multi-source model in step S3 includes the following steps:

[0091] B1: Initialize the target domain model; B2: Construct the target domain sample set; B3: Input the source domain and target domain samples into the subnet for training iterations; B4: Save the trained model.

[0092] In this embodiment, when initializing the target domain model in step B1, the target domain model is initialized with the source domain model parameters saved in the pre-training stage; the target domain model is constructed to include N sub-networks, each of which is composed of an input layer, a TimesNet layer, a fully connected layer, and a domain adaptation layer; the domain adaptation layer introduces the maximum mean difference loss to solve the domain difference problem, and the maximum mean difference is MMD; its calculation steps are:

[0093] Assume source domain Target domain MMD calculates the distance between two distributions in the Reproducing Kernel Hilbert Space (RKHS), and the MMD of the source domain and the target domain in RKHS is defined as:

[0094]

[0095] in, is a nonlinear function in RKHS, which is used to map the original variables into RKHS.

[0096] MMD quantifies the distribution difference by calculating the distance between the mean of the source domain and the mean of the target domain in RKHS. The smaller the MMD value, the more similar the two domains are.

[0097] Specifically, deep neural networks usually learn common features in the first few layers, and as the network deepens, the latter layers tend to learn specific features. When deep features change from general features to special features, the transferability of features drops sharply at high levels of the network, greatly increasing the differences between domains. MMD can solve the problem of domain differences very well, and it is mainly used as a loss function in the field of domain adaptation.

[0098] In this embodiment, the step B2 performs sliding window processing on the target domain data when constructing the target domain sample set, and includes the following steps: C1: selecting a suitable window size for daily carbon emission data;

[0099] C2: Select the step size; C3: Start sliding the window from the starting position of the target domain data; C4: Traverse the target domain data through the sliding window and extract the local area as a sub-sample; C5: Store all the extracted sub-samples to form a sub-sample set of the target domain.

[0100] Specifically, in C1, one month or one quarter can be selected as the window size; in step C2, if the window is selected as one month, the step size is generally selected as 1 day, and if the window is selected as a quarter, the step size is selected as 1 month and moves once.

[0101] In this embodiment, the training iteration of the source domain and target domain samples input into the subnet in step B3 includes the following steps: D1: extracting the temporal features of the source domain and target domain samples; D2: integrating the output results of N subnets; D3: calculating three kinds of losses; D4: optimizing the total loss and updating the parameters;

[0102] Extracting the time features of source domain and target domain samples in D1 includes inputting the source domain and target domain samples into the corresponding TimesNet sub-networks, extracting the time features, and inputting the extracted time features into the fully connected layer to obtain the prediction values ​​of multiple sub-networks;

[0103] When integrating the output results of N subnetworks in D2, the subnetwork output values ​​are integrated by averaging as the predicted value of the model;

[0104] The three types of losses calculated in D3 include MMD loss, regression loss of subnet output, and difference loss. The calculation formula is as follows:

[0105] MMD loss: The MMD loss of each subnet is calculated in the domain adaptation layer to align the distribution difference between the source domain and the target domain. The total MMD loss ψ mmd Defined as the average of multiple subnet MMDs:

[0106]

[0107] Regression loss: The average of the output results of multiple subnets is used as the prediction value of the model to calculate the regression loss, regression loss ψ reg Defined as:

[0108]

[0109] Among them, J(.) is the mean square error (MSE) loss function, P(.) is the regression predictor, and F(.) is the feature extractor;

[0110] Difference loss: used to align the prediction outputs of multiple subnetworks on the target sample. In the actual training process, the subnetworks are trained from different source domains, and the actual pure output prediction values ​​may be different. However, for a given target sample, a model should have only one prediction result. Therefore, the difference between the subnetwork output results is taken as part of the loss function, the difference loss ψ disc Defined as:

[0111]

[0112] Where N T represents the number of samples of target domain data, N is the number of sub-networks, J(.) is the mean square error (MSE) loss function, P(.) is the regression predictor, F(.) is the feature extractor, and x k is the kth sample in the target domain data, is the normalization coefficient, ensuring that the differences of all subnetwork pairs are averaged;

[0113] In D4, the total loss is optimized and the total loss function of the model in the parameter update is defined as

[0114] L total =ψ reg +λψ mmd +γψ disc

[0115] Among them, λ and γ are weight parameters used to balance the contribution between different losses.

[0116] Specifically, λ and γ are weight parameters determined by empirical methods and parameter sensitivity experiments.

[0117] In this embodiment, when migrating the trained multi-source model for prediction in step S4, the trained model is loaded through the migration strategy of model migration and loss function migration, and the training and optimization of the target domain TimesNet multi-source migration model are completed according to the optimized parameters.

[0118] In this embodiment, when the final prediction result is output in step S5, the output results of multiple subnets are integrated, and the results of all subnets are averaged as the final prediction result of the model.

[0119] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A TimesNet multi-source migration prediction method for carbon emissions, characterized in that: The following steps are involved: S1: Data collection and preprocessing; S2: source domain model pre-training; S3: Construction and fine-tuning of multi-source models in the target domain; S4: Migrate the trained multi-source model for prediction; S5: Output the final prediction result.

2. The TimesNet multi-source migration prediction method for carbon emissions according to claim 1, characterized in that: In step S1, the main greenhouse gas emission areas of energy activities, industrial production processes, and waste treatment in N source cities and target cities are selected, and the emission estimation method is used to determine the greenhouse gas emissions of carbon dioxide, methane, and nitrous oxide in each area as the original data; and the missing values ​​are filled and normalized.

3. The TimesNet multi-source migration prediction method for carbon emissions according to claim 2, characterized in that: The source domain model pre-training in step S2 includes two steps: establishing a source domain model and training the source domain model; the establishing of the source domain model includes establishing a sub-network including an input layer, a TimesNet layer, and a fully connected layer for each of the N source domains; The training source domain model comprises: inputting N source domain data into N subnets for training respectively, extracting time features and optimizing model parameters, and finally saving the pre-trained model parameters.

4. The TimesNet multi-source migration prediction method for carbon emissions as claimed in claim 3, characterized in that: The input layer is used to accept time series data input, the fully connected layer is used for feature conversion, and the TimesNet layer is used to extract time series features; The TimesNet model is composed of multiple TimesBlock stacks, and the steps include: A1: FFT transform finds the periodicity of time series; A2: Convert the 1D time series into a 2D tensor; A3: Inception module uses multi-scale 2D convolution kernels to extract features; A4: Feature aggregation based on amplitude.

5. The TimesNet multi-source migration prediction method for carbon emissions according to claim 4, characterized in that: The construction and fine-tuning of the target domain multi-source model in step S3 includes the following steps: B1: Initialize the target domain model; B2: Construct the target domain sample set; B3: Input the source domain and target domain samples into the subnet for training iterations; B4: Save the trained model.

6. The TimesNet multi-source migration prediction method for carbon emissions according to claim 5, characterized in that: When initializing the target domain model in step B1, the target domain model is initialized with the source domain model parameters saved in the pre-training stage; the target domain model is constructed to include N sub-networks, each of which consists of an input layer, a TimesNet layer, a fully connected layer, and a domain adaptation layer; the domain adaptation layer introduces the maximum mean difference loss to solve the domain difference problem, and the maximum mean difference is MMD; its calculation steps are: Assume that the source domain Target domain MMD calculates the distance between two distributions in the Reproducing Kernel Hilbert Space (RKHS), and the MMD of the source domain and the target domain in RKHS is defined as: in, is a nonlinear function in RKHS, which is used to map the original variables into RKHS. MMD quantifies the distribution difference by calculating the distance between the mean of the source domain and the mean of the target domain in RKHS. The smaller the MMD value, the more similar the two domains are.

7. The TimesNet multi-source migration prediction method for carbon emissions according to claim 6, characterized in that: The step B2 performs sliding window processing on the target domain data when constructing the target domain sample set, including the following steps: C1: Choose the appropriate window size for daily carbon emissions data; C2: Select step size; C3: Sliding window starts from the starting position of the target domain data; C4: Traverse the target domain data through a sliding window and extract local areas as subsamples; C5: Store all extracted sub-samples to form the sub-sample set of the target domain.

8. The TimesNet multi-source migration prediction method for carbon emissions according to claim 7, characterized in that: In step B3, the source domain and target domain samples are input into the subnet for training iterations, including the following steps: D1: extracting temporal features of source domain and target domain samples; D2: integrate the output results of N subnets; D3: Calculate three types of losses; D4: Optimize total loss and update parameters; Extracting the time features of source domain and target domain samples in D1 includes inputting the source domain and target domain samples into the corresponding TimesNet sub-networks, extracting the time features, and inputting the extracted time features into the fully connected layer to obtain the prediction values ​​of multiple sub-networks; When integrating the output results of N subnetworks in D2, the subnetwork output values ​​are integrated by averaging as the predicted value of the model; The three types of losses calculated in D3 include MMD loss, regression loss of subnet output, and difference loss. The calculation formula is as follows: MMD loss: The MMD loss of each subnet is calculated in the domain adaptation layer to align the distribution difference between the source domain and the target domain. The total MMD loss ψ mmd Defined as the average of multiple subnet MMDs: Regression loss: The average of the output results of multiple subnets is used as the prediction value of the model to calculate the regression loss, regression loss ψ reg Defined as: Among them, J(.) is the mean square error (MSE) loss function, P(.) is the regression predictor, and F(.) is the feature extractor; Difference loss: used to align the prediction outputs of multiple subnetworks on the target sample. In the actual training process, the subnetworks are trained from different source domains, and the actual pure output prediction values ​​may be different. However, for a given target sample, a model should have only one prediction result. Therefore, the difference between the subnetwork output results is taken as part of the loss function, the difference loss ψ disc Defined as: Where N T represents the number of samples of target domain data, N is the number of sub-networks, J(.) is the mean square error (MSE) loss function, P(.) is the regression predictor, F(.) is the feature extractor, and x k is the kth sample in the target domain data, is the normalization coefficient, ensuring that the differences of all subnetwork pairs are averaged; In D4, the total loss is optimized and the total loss function of the model in the parameter update is defined as L total =ψ reg +lψ mmd +gψ disc Among them, λ and γ are weight parameters used to balance the contribution between different losses.

9. The TimesNet multi-source migration prediction method for carbon emissions as claimed in claim 8, characterized in that: When migrating the trained multi-source model for prediction in step S4, the trained model is loaded through the migration strategies of model migration and loss function migration, and the training and optimization of the target domain TimesNet multi-source migration model are completed according to the optimized parameters.

10. The TimesNet multi-source migration prediction method for carbon emissions according to claim 1, characterized in that: When the final prediction result is output in step S5, the output results of multiple subnets are integrated, and the results of all subnets are averaged as the final prediction result of the model.

Citation Information

Cited By

  • Carbon emission time sequence data prediction method and device and storage medium

    CN120893639A

  • Method and system for filling dissolved gas data in transformer oil

    CN121502163A