A city traffic flow prediction method and system based on incremental learning

CN120808593BActive Publication Date: 2026-08-11TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

具体的,如中国专利申请CN116740949A,其提供了一种基于持续学习的时空因果预测的城市交通数据预测方法,其通过依赖对旧任务数据进行聚类筛选具有代表性的样本构建时空历史记忆库,以及在训练过程采用正交投影算子进行训练并通过弹性权重加权训练过程中的正则化项,虽然在一定程度上避免了增量学习的灾难性遗忘,但其在利用弹性权重加权正则化项时仍旧依赖在每个任务训练前获取上个任务的模型参数用于评判当前模型参数的重要性,从而影响其计算效率且影响模型预测的准确性

Benefits of technology

[0046]1) This invention improves training efficiency by calculating the rate of change of traffic flow model parameters between two adjacent prediction tasks and dynamically adjusting the learning rate of model parameters during traffic flow model training based on the rate of change. It relies only on simple vector operations. Existing technologies rely on historical task data to evaluate the importance of model parameters during model training and guide model parameter updates based on importance. However, when the old task data becomes outdated due to distribution changes, it can lead the model into an incorrect training direction. The method provided by this invention guides the prediction model training direction through the rate of change. When the model parameters change drastically in adjacent tasks (i.e., the rate of change is too large), the learning rate of the model parameters is reduced to avoid excessive deviation from the knowledge of the old tasks. When the model parameters change less (i.e., the rate of change is small), a high learning rate is maintained to accelerate the convergence of new tasks. This invention not only alleviates the catastrophic forgetting problem of the model in historical task predictions but also provides a more efficient and effective training method to ensure the accuracy of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808593B_ABST
    Figure CN120808593B_ABST
Patent Text Reader

Abstract

This invention relates to an incremental learning-based urban traffic flow prediction method and system. It addresses the problem in existing technologies where temporal evolution and spatial differences in real-world scenarios cause traffic flow distribution to gradually deviate from the training traffic flow data distribution, thus affecting the performance of traffic flow prediction models. Specifically, the dynamic learning rate method based on parameter change amplitude mitigates catastrophic forgetting and promotes model learning of common periodic patterns in different traffic flow distributions by suppressing parameter updates in the output layer and promoting parameter updates in the functional layer. The method of constructing the replay pool based on time features selects samples that best represent the traffic flow distribution of historical periods and concatenates them with the current period's traffic flow data for training, thereby improving the predictive model's adaptability to changes in data distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent transportation systems and incremental learning technology, and in particular to a method and system for predicting urban traffic flow based on incremental learning. Background Technology

[0002] Traffic flow prediction is a crucial component of Intelligent Transportation Systems (ITS). Achieving more accurate traffic flow prediction can assist in smart city planning and provide reasonable references for policy making and traffic management.

[0003] Traditional traffic flow forecasting often assumes that the current data distribution will largely match the future data distribution, which has significant limitations in rapidly changing real-world environments. Once urban planning or traffic management strategies change, or factors such as climate change occur, the distribution of traffic flow data may change drastically from the training phase, causing the model to fail to adapt in time and resulting in prediction errors.

[0004] Incremental learning methods demonstrate significant advantages in addressing this problem. Unlike traditional batch learning methods, incremental learning allows the model to update itself upon receiving new data, adjusting the model to adapt to the new data distribution without retraining the entire model. This approach improves the model's adaptability to changes in data distribution by balancing the stability of historical knowledge with the plasticity of new knowledge. It enables the model to automatically identify potential changes in data distribution when faced with real-world traffic flow data and automatically update its parameters to adapt to these changes. There are several ways to implement incremental learning. One method is experience-based replay, which involves storing a small portion of training data from previous tasks in a replay pool and adding it to future training sessions. Another method is regularization-based methods, which aim to constrain model parameter updates and balance parameters between old and new tasks by introducing a regularization term into the loss function, thereby reducing the impact of catastrophic forgetting. Both methods often require obtaining the model parameters from the previous task before training each task to assess the importance of the current model parameters. Specifically, Chinese patent application CN116740949A provides a method for predicting urban traffic data based on spatiotemporal causal prediction using continuous learning. It constructs a spatiotemporal historical memory bank by clustering and selecting representative samples from old task data, and uses orthogonal projection operators for training and regularization terms in the training process with elastic weights. Although this avoids catastrophic forgetting in incremental learning to some extent, it still relies on obtaining the model parameters of the previous task before training each task to evaluate the importance of the current model parameters when using the elastic weights for regularization, which affects its computational efficiency and the accuracy of model prediction.

[0005] Therefore, a method is proposed that avoids obtaining the model parameters of the previous task before each task training to evaluate the importance of the current model parameters and thus perform incremental model training, so as to achieve efficient and accurate traffic flow prediction. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings of the existing technology and provide an incremental learning-based method for predicting urban traffic flow. The dynamic learning rate method based on parameter variation amplitude promotes the model to capture the intrinsic relationship between tasks by balancing the variation amplitude of different parameters. The method of constructing a replay pool based on time features selects representative samples from the training set to construct a replay pool and retains the data distribution characteristics of the old tasks.

[0007] The objective of this invention can be achieved through the following technical solutions:

[0008] According to a first aspect of the present invention, an urban traffic flow prediction method based on incremental learning is provided, the method comprising:

[0009] S1. Construct an initial traffic flow prediction model;

[0010] S2. Obtain historical traffic flow data for the initial task and sample it to construct initial training data. Use the initial training data to train the initial traffic flow prediction model to obtain the first-generation traffic flow prediction model. Select target traffic flow data from the training data used to train the initial traffic flow prediction model and put it into the playback pool.

[0011] S3. Obtain historical traffic flow data for the nth prediction task and sample it. Combine the sampled data with the data in the replay pool to construct training data for the nth prediction task. Use this training dataset to train the (n-1)th generation traffic flow prediction model to obtain the nth generation traffic flow prediction model, where n≥2. Then, select target traffic flow data from the training data used to train the (n-1)th generation traffic flow prediction model to update the replay pool.

[0012] S4. Obtain the model parameters of the nth generation traffic flow prediction model and the (n-1)th generation traffic flow prediction model, calculate the rate of change based on the model parameters, and dynamically adjust the learning rate of the nth generation traffic flow prediction model based on the rate of change.

[0013] S5. Determine whether the training termination condition is met. If not, proceed to S3; if met, proceed to S6.

[0014] S6. Traffic flow prediction is performed using the nth generation traffic flow prediction model.

[0015] As a preferred technical solution, the initial traffic flow prediction model in S1 is constructed based on Graph WaveNet and its derivative architectures.

[0016] As a preferred technical solution, the method for selecting the target traffic flow data includes:

[0017] A1. Set the data capacity of the replay pool for each prediction task, and ensure that the data capacity of the replay pool for each prediction task is the same.

[0018] Repeat the following steps on the training data that falls within the same time period until the amount of selected sample data equals the data capacity:

[0019] A2. Randomly select two sample data from the same day and time period in different weeks from the training data, namely sample A and sample B, compare the two sample data, and select the sample data with the best performance.

[0020] A3. Set the maximum number of comparisons, repeat step A2 until the maximum number of comparisons is reached, and use the best performing sample data in the current comparison as the playback pool data for that time period.

[0021] As a preferred technical solution, the comparison method includes:

[0022] Input the samples A and B into the traffic flow prediction model of the current prediction task, and calculate the first loss function value for sample A and its corresponding output. A Sample B and the corresponding output second loss function value loss B ;

[0023] Using sample A, a traffic flow prediction model for the current prediction task is trained using the single-step stochastic gradient descent method to obtain prediction model A; using sample B, a traffic flow prediction model for the current prediction task is trained using the single-step stochastic gradient descent method to obtain prediction model B.

[0024] Input the sample B into the prediction model A, and calculate the third loss function value loss′. A Input the sample A into the prediction model B, and calculate the fourth loss function value loss′. B ;

[0025] Calculate the first loss function value loss. A With the third loss function value loss′ A The first loss decrease value; calculate the second loss function value loss. B With the fourth loss function value loss′ B The second loss decrease value;

[0026] The first loss reduction value is compared with the second loss reduction value, and the minimum value is selected.

[0027] As a preferred technical solution, S4 also includes:

[0028] The Manhattan distance is used to calculate the magnitude of the change in the weight vector of the traffic flow prediction model for the current prediction task compared to the traffic flow prediction model for the previous prediction task.

[0029] The normalized vector is obtained by normalizing the magnitude of the change using a relative ratio.

[0030] The rate of change is calculated based on the normalized vector.

[0031] As a preferred technical solution, the method for calculating the rate of change is as follows:

[0032]

[0033] Where, δ k ′ represents a normalized vector, and δ k Indicates the range of change. This represents the summation of the values ​​of all dimensions representing the magnitude of the change, divided by the average of the number of dimensions; min(δ) k ') represents the minimum value in the normalized vector; max(δ) k ′) represents the maximum value in the normalized vector; α and β represent hyperparameters.

[0034] As a preferred technical solution, the dynamic adjustment is as follows: when training the traffic flow prediction model for the current prediction task, the learning rate of each model parameter in the traffic flow prediction model for the current prediction task is divided by the rate of change to obtain the dynamic learning rate of the corresponding model parameter, and the dynamic learning rate is used as the learning rate of the model parameter for the next training of the traffic flow prediction model for the current prediction task.

[0035] As a preferred technical solution, the traffic flow prediction model includes multiple layers, each layer including a gating layer and a convolutional layer, and the model parameters include each gated convolutional kernel in the gating layer and the weight vector of the convolutional layer.

[0036] As a preferred technical solution, S6 includes:

[0037] S61. Obtain historical traffic data of the traffic segment corresponding to the prediction task, and preprocess the historical traffic data to obtain an input vector, wherein the shape of the input vector is [D,N,T]; where D represents the number of node features in the historical traffic data, N represents the number of nodes in the traffic segment, and T represents the time step;

[0038] In each layer of the structure, execute S62 to S64:

[0039] S62. The input vector is processed by the gated layer. The input vector is convolved in the time step dimension by two one-dimensional dilated convolution kernels, and the dilated convolution kernels are activated by tanh and sigmoid activation functions respectively to obtain a first vector and a second vector. The first vector and the second vector have the same shape [D, N, L], where L represents the dimension of the time step dimension after the dilated convolution.

[0040] S63. Calculate the Hadamard product of the first and second vectors to obtain the third vector, which has the shape [D,N,L].

[0041] S64. Perform graph convolution on the third vector using the convolutional layer to obtain an output vector with shape [D,N,L].

[0042] S65. After performing residual concatenation on the output vectors of each layer and multi-layer convolution, the vectors are aggregated to obtain the aggregated vector.

[0043] S66. The aggregated vector is activated using an activation function and then linearly transformed to obtain the traffic flow prediction result.

[0044] According to a second aspect of the present invention, an urban traffic flow prediction system based on incremental learning is provided for implementing the above-described method.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] 1) This invention improves training efficiency by calculating the rate of change of traffic flow model parameters between two adjacent prediction tasks and dynamically adjusting the learning rate of model parameters during traffic flow model training based on the rate of change. It relies only on simple vector operations. Existing technologies rely on historical task data to evaluate the importance of model parameters during model training and guide model parameter updates based on importance. However, when the old task data becomes outdated due to distribution changes, it can lead the model into an incorrect training direction. The method provided by this invention guides the prediction model training direction through the rate of change. When the model parameters change drastically in adjacent tasks (i.e., the rate of change is too large), the learning rate of the model parameters is reduced to avoid excessive deviation from the knowledge of the old tasks. When the model parameters change less (i.e., the rate of change is small), a high learning rate is maintained to accelerate the convergence of new tasks. This invention not only alleviates the catastrophic forgetting problem of the model in historical task predictions but also provides a more efficient and effective training method to ensure the accuracy of the prediction model.

[0047] 2) At the end of each prediction task, this invention selects the most representative samples from different weeks but on the same day and within the same time period in the historical training data to construct a replay pool of traffic flow dataset spanning one week, representing the data distribution of the current task. This preserves the highest quality historical traffic flow data for training the traffic flow prediction model for the next prediction task, while also avoiding the destruction of the overall temporal characteristics of the samples during the construction of the replay pool. This guides the prediction model to pay more attention to the temporal relationship between features during training, thereby ensuring the accuracy of the prediction model. Attached Figure Description

[0048] Figure 1 The training process for the traffic flow prediction model of this invention is as follows;

[0049] Figure 2 This is a schematic diagram of the traffic flow prediction model structure of the present invention;

[0050] Figure 3 This is a schematic diagram of the playback pool construction process of the present invention;

[0051] Figure 4 This is a schematic diagram of the sample comparison process of the present invention. Detailed Implementation

[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0053] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.

[0054] Example 1

[0055] To address the technical problems existing in the prior art, this invention provides an incremental learning-based method for predicting urban traffic flow. This method constructs an initial traffic flow prediction model based on Graph WaveNet and its derivative architectures. It then introduces two methods to optimize the training process of the traffic flow prediction model: a dynamic learning rate based on the magnitude of parameter changes and a replay pool based on time features. This allows the model to self-update to adapt to changes in data distribution. The training framework is as follows: Figure 1 As shown.

[0056] The detailed methods include:

[0057] S1. Construct an initial traffic flow prediction model.

[0058] The traffic flow prediction model built on Graph WaveNet and its derivative architectures consists of multiple layers, each including a gating layer and a convolutional layer. The model parameters include each gated convolutional kernel in the gating layer and the weight vector of the convolutional layer. Its structure is as follows: Figure 2 As shown.

[0059] S2. Obtain historical traffic flow data for the initial task and sample it to construct initial training data. Use the initial training data to train the initial traffic flow prediction model to obtain the first-generation traffic flow prediction model. Select target traffic flow data from the training data used to train the initial traffic flow prediction model and put it into the playback pool.

[0060] S3. Obtain historical traffic flow data for the nth prediction task and sample it. Combine the sampled data with the data in the replay pool to construct the training data for the nth prediction task. Use this training dataset to train the (n-1)th generation traffic flow prediction model to obtain the nth generation traffic flow prediction model, where n≥2. Then, select target traffic flow data from the training data used to train the (n-1)th generation traffic flow prediction model to update the replay pool.

[0061] In steps S2 and S3, the process input for selecting target traffic flow data is... Figure 3 As shown, it includes:

[0062] A1. Set the data capacity of the replay pool for each prediction task, and the data capacity of the replay pool for each prediction task is the same. In this invention, the data capacity is the amount of historical traffic flow data for one week.

[0063] Unlike the traditional replay pool sampling method that selects the optimal K samples to add to the replay pool, the method proposed in this invention selects the most representative sample for K time points to construct the replay pool in order to maintain complete temporal features. This ensures that the samples in the sample pool can cover all time points within a week and avoids the problem of unbalanced temporal features of the samples.

[0064] Repeat the following steps for data within the same time period in the training data until the amount of selected sample data equals the data capacity:

[0065] A2. Randomly select two sample data points, sample A and sample B, from the same day and time period in different weeks from the training data, and compare the two sample data points. The process is as follows: Figure 4 As shown, the sample data with the best performance is selected.

[0066] To reduce computational complexity and storage overhead, this method introduces two adjustable parameters, namely the sampling interval T and the maximum number of comparisons B, to control the sampling density and update frequency of the samples. While ensuring the performance of the replay pool, these parameters effectively reduce the number of sample comparisons, while ensuring that the replay pool can cover the temporal feature distribution of the data.

[0067] Specifically, the method proposed in this invention does not sample all times within a week. Instead, it selects times evenly, choosing one time every T time steps. The most representative sample from that time (i.e., the same sampling time on the same day of different weeks) is added to the replay pool until the amount of data in the replay pool equals the amount of data within a week. Taking METR-LA as an example, this method selects the most representative samples from times such as 10:00, 10:45, 11:30, etc., every 45 minutes (since the dataset sampling frequency is once every 5 minutes, i.e., 9 sampling intervals) and adds them to the replay pool for use in the next training iteration. To reduce comparison overhead, the method of this invention sets a maximum of B comparisons per time step. That is, if the optimal sample is obtained after B comparisons at a certain time step, it is considered that the sample is almost the most representative sample at that time step. Subsequent samples at that time step will not be updated; instead, the sample will be directly added to the replay pool for subsequent task training.

[0068] A21. Input sample A and sample B into the traffic flow prediction model of the current prediction task, and calculate the first loss function value of sample A and the corresponding output, respectively. A Sample B and the corresponding output second loss function value loss B .

[0069] A22. Using sample A, train the traffic flow prediction model for the current prediction task using the single-step stochastic gradient descent method to obtain prediction model A; using sample B, train the traffic flow prediction model for the current prediction task using the single-step stochastic gradient descent method to obtain prediction model B.

[0070] A23. Input sample B into prediction model A and calculate the third loss function value loss′. A Input sample A into prediction model B and calculate the fourth loss function value loss′. B .

[0071] A24. Calculate the first loss function value (loss). A With the third loss function value loss′ A The first loss decrease value; calculate the second loss function value. B With the fourth loss function value loss′ B The second loss decrease value.

[0072] A25. Compare the first loss decrease value with the second loss decrease value and select the minimum value.

[0073] The basis for the above comparison is as follows: if the loss decrease of sample A in model B is smaller than the loss decrease of sample B in model A, it indicates that the gradient descent direction after training A is more consistent with the gradient descent direction during model training than that of B. In other words, after training with sample A, the model can also predict sample B well. This shows that after updating based on sample A, the model can not only effectively remember the information of sample A, but also lose less information about sample B. Therefore, while retaining sample A, it can also retain key information about the distribution of sample B. Thus, sample A is more representative of the data distribution of this dataset than sample B; that is, sample A is more representative than sample B.

[0074] A3. Set the maximum number of comparisons, repeat step A2 until the maximum number of comparisons is reached, and use the best performing sample data in the current comparison as the playback pool data for that time period.

[0075] S4. Obtain the model parameters of the nth generation traffic flow prediction model and the (n-1)th generation traffic flow prediction model, calculate the rate of change based on the model parameters, and dynamically adjust the learning rate of the nth generation traffic flow prediction model based on the rate of change.

[0076] S41. Use Manhattan distance to calculate the change in the weight vector of the traffic flow prediction model for the current prediction task compared to the traffic flow prediction model for the previous prediction task.

[0077] S42. Normalize the magnitude of change using relative ratios to obtain a normalized vector.

[0078] S43. The change is calculated based on the normalized vector, and its expression is:

[0079]

[0080] Where, δ k ′ represents a normalized vector, and δ k Indicates the range of change. This represents the summation of the values ​​across all dimensions of the magnitude of change, divided by the average of the number of dimensions; min(δ) k ') represents the minimum value in the normalized vector; max(δ) k ′) represents the maximum value in the normalized vector; α and β represent hyperparameters.

[0081] S44. Divide the learning rate of each model parameter in the traffic flow prediction model of the current prediction task by the rate of change to obtain the dynamic learning rate of the corresponding model parameter. Use the dynamic learning rate as the learning rate of the model parameter in the next training of the traffic flow prediction model of the current prediction task.

[0082] S5. Determine whether the training termination condition is met. If not, proceed to S3; if met, proceed to S6.

[0083] S6. Use the nth generation traffic flow prediction model to predict traffic flow.

[0084] S61. Obtain historical traffic data for the traffic segment corresponding to the prediction task, and preprocess the historical traffic data to obtain an input vector with the shape of [D, N, T]; where D represents the number of node features in the historical traffic data, N represents the number of nodes in the traffic segment, and T represents the time step.

[0085] In each layer of the structure, execute S62 to S64:

[0086] S62. The input vector is processed by a gated layer. Two one-dimensional dilated convolution kernels are used to convolve the input vector in the time step dimension, and the tanh and sigmoid activation functions are used to activate the dilated convolution kernels respectively to obtain the first vector and the second vector. The first vector and the second vector have the same shape [D,N,L], where L represents the dimension of the time step after the dilated convolution.

[0087] S63. Calculate the Hadamard product of the first and second vectors to obtain the third vector, which has the shape [D,N,L].

[0088] S64. Perform graph convolution on the third vector using a convolutional layer to obtain the output vector, which has the shape [D, N, L].

[0089] S65. After performing residual concatenation on the output vectors of each layer and multi-layer convolution, the vectors are aggregated to obtain the aggregated vector.

[0090] S66. After activating the aggregated vector using an activation function and then performing a linear transformation, the traffic flow prediction result is obtained.

[0091] Example 2

[0092] In this embodiment, two experiments—one predicting traffic flow increments in a single region and the other predicting traffic flow increments in multiple regions—demonstrate that the method provided by this invention improves the model's adaptability to changes in traffic patterns.

[0093] 1) Prediction of traffic flow increment in a single area.

[0094] To verify the adaptability of the incremental learning framework to traffic flow data distribution changes in a single region over a long period, the experiment selected the PEMS-Bay dataset. This dataset contains traffic flow records from 325 monitoring stations in the Bay Area for six consecutive months (January-June 2017), with a temporal resolution of 5 minutes, totaling approximately 16.93 million valid data points. Compared to other mainstream datasets (such as PEMS04), PEMS-Bay's longer time span and more complete data provide higher-quality spatiotemporal information for subsequent splitting and reconstruction tasks. In this experiment, the PEMS-Bay dataset was split into six datasets according to the natural month, and the model was trained sequentially according to the natural month order.

[0095] This embodiment will compare three different training methods to illustrate the effectiveness of the present invention: Method 1, training only on the January training set and then not updating, and then only testing the prediction performance on the February-June test set (hereinafter referred to as OneFitAllmodel); Method 2, not using the incremental learning method of the present invention, but training sequentially on the January-June training set, with the initial model used for each training being the model obtained after the previous training (hereinafter referred to as STFinetune model); Method 3, using the incremental learning method of the present invention, and training sequentially on the January-June training set, with the initial model used for each training being the model obtained after the previous training (hereinafter referred to as this scheme).

[0096] As can be seen from the data in Table 1, under the above task segmentation and experimental settings, this scheme demonstrates a systematic advantage over the STFinetune model (which is not trained using a framework) and the OneFitAll model (which is not trained) in historical tasks 2 to 5: compared to the second-best performing STFinetune model, this scheme reduces the average MAE by 2.8%, the average MAPE by 2.2%, and the average RMSE by 2.1%; that is, this scheme is feasible and superior in predicting traffic flow increments in a single area.

[0097] Table 1 Comparative Experiment Data Table

[0098]

[0099] 2) Multi-regional traffic flow increment prediction.

[0100] To verify the performance of the incremental learning framework in incremental prediction of spatiotemporal data in multiple regions, this embodiment selects four datasets, PEMS04, PEMS08, METR-LA, and PEMS-Bay, to form an incremental learning task group. The training order of the comparative experiment is: PEMS04 → PEMS08 → METR-LA → PEMS-Bay.

[0101] In this embodiment, the same traffic flow prediction skeleton model will be used, but different incremental learning methods, namely EWC, MAS, SI, R_Walk, and the present invention, will be compared to verify the superior performance of the present invention.

[0102] The core idea of ​​EWC is to analyze the importance of each parameter and mitigate changes in more important parameters to achieve incremental learning. EWC assumes that there are parameters in the neural network that are crucial to the performance of older tasks; these parameters have high "stability" in older tasks, thus requiring stronger update constraints during training for new tasks. The calculation of importance relies on the statistical properties of the Fisher information matrix, which reflects the impact of small changes in model parameters on the model output. Based on the Fisher matrix, EWC adds a parameter importance-based regularization term to the loss function to reduce the deviation of important parameters from their historical optimal solutions.

[0103] Unlike EWC, which statically analyzes parameter importance after model training, SI accumulates the importance of neural network parameters online during task training, balancing knowledge retention between new and old tasks by dynamically constraining parameter update magnitudes. SI defines parameter importance as the contribution of a parameter to changes in the loss function during training, quantifying its sensitivity by tracking the path integral of parameter updates.

[0104] MAS (Multi-Stage Learning) is an unsupervised incremental learning regularization method. Its core principle is to analyze the influence of neural network parameters on the model output, dynamically constrain parameter updates, and thus preserve key knowledge from past tasks. MAS randomly samples the input, calculates the gradient of the L2 norm of the output vector with respect to each parameter, and then takes the expected value of the squared gradients on the input samples as the importance weight of each parameter. MAS only needs the model's output to evaluate the importance of each parameter, making it suitable for various scenarios.

[0105] R_Walk combines the advantages of SI and EWC. Besides utilizing the Fisher information matrix, similar to EWC, to capture the static sensitivity of parameters to model output, R_Walk dynamically analyzes the cumulative contribution of integral parameters to historical task loss by examining the update direction and magnitude of these parameters during task training. Furthermore, when constructing the regularization term, R_Walk adjusts the weighting of these two parameters to measure their importance through hyperparameters, providing more multi-dimensional parameter metrics.

[0106] The experimental results of this proposed scheme compared with the aforementioned baselines are shown in Table 2. The results demonstrate that the proposed incremental learning framework for traffic flow prediction performs well on all four task sets. Specifically, on the last task, PEMS-Bay, the proposed method achieves lower MAE (1.8089) and RMSE (4.0740) compared to the other four methods. This indicates that the incremental learning framework used in this scheme sacrifices the most performance for the current task compared to the other four methods. Furthermore, the incremental learning framework also performs better on earlier historical tasks (PEMS04 and PEMS08), suggesting that this learning framework can better retain knowledge from earlier historical tasks and mitigate catastrophic forgetting compared to the other four methods.

[0107]

[0108] Example 2

[0109] Furthermore, this invention provides an urban traffic flow prediction system based on incremental learning, including a central processing unit (CPU), which can execute various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) or loaded from a storage unit into random access memory (RAM). The RAM can also store various programs and data required for device operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0110] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0111] The processing unit executes the various methods and processes described above, such as methods S1-S6 and methods A1-A3. For example, in some embodiments, methods S1-S6 and methods A1-A3 may be implemented as computer software programs tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of methods S1-S6 and methods A1-A3 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute methods S1-S6 and methods A1-A3 by any other suitable means (e.g., by means of firmware).

[0112] The functions described above in this invention can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0113] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, and other programmable data processing apparatus, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0114] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0115] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for predicting urban traffic flow based on incremental learning, characterized in that, The method includes: S1. Construct an initial traffic flow prediction model; S2. Obtain historical traffic flow data for the initial task and sample it to construct initial training data. Use the initial training data to train the initial traffic flow prediction model to obtain the first-generation traffic flow prediction model. Select target traffic flow data from the training data used to train the initial traffic flow prediction model and put it into the playback pool. S3. Obtain historical traffic flow data for the nth prediction task and sample it. Combine the sampled data with the data in the replay pool to construct training data for the nth prediction task. Use this training dataset to train the (n-1)th generation traffic flow prediction model to obtain the nth generation traffic flow prediction model, where n≥2. Then, select target traffic flow data from the training data used to train the (n-1)th generation traffic flow prediction model to update the replay pool. S4. Obtain the model parameters of the nth generation traffic flow prediction model and the (n-1)th generation traffic flow prediction model, calculate the rate of change based on the model parameters, and dynamically adjust the learning rate of the nth generation traffic flow prediction model based on the rate of change. S5. Determine whether the training termination condition is met. If not, proceed to S3; if met, proceed to S6. S6. Traffic flow prediction is performed using the nth generation traffic flow prediction model.

2. The urban traffic flow prediction method based on incremental learning according to claim 1, characterized in that, The initial traffic flow prediction model described in S1 is constructed based on Graph WaveNet and its derivative architectures.

3. The urban traffic flow prediction method based on incremental learning according to claim 1, characterized in that, The method for selecting the target traffic flow data includes: A1. Set the data capacity of the replay pool for each prediction task, and ensure that the data capacity of the replay pool for each prediction task is the same. Repeat the following steps on the training data that falls within the same time period until the amount of selected sample data equals the data capacity: A2. Randomly select two sample data from the same day and time period in different weeks from the training data, namely sample A and sample B, compare the two sample data, and select the sample data with the best performance. A3. Set the maximum number of comparisons, repeat step A2 until the maximum number of comparisons is reached, and use the best performing sample data in the current comparison as the playback pool data for that time period.

4. The urban traffic flow prediction method based on incremental learning according to claim 3, characterized in that, The comparison method includes: Input the samples A and B into the traffic flow prediction model of the current prediction task, and calculate the first loss function value for sample A and its corresponding output, respectively. A Sample B and the corresponding output second loss function value loss B ; Using sample A, a traffic flow prediction model for the current prediction task is trained using the single-step stochastic gradient descent method to obtain prediction model A; using sample B, a traffic flow prediction model for the current prediction task is trained using the single-step stochastic gradient descent method to obtain prediction model B. Input the sample B into the prediction model A, and calculate the third loss function value loss′. A Input the sample A into the prediction model B, and calculate the fourth loss function value loss′. B ; Calculate the first loss function value loss. A With the third loss function value loss′ A The first loss decrease value; calculate the second loss function value loss. B With the fourth loss function value loss′ B The second loss decrease value; The first loss reduction value is compared with the second loss reduction value, and the minimum value is selected.

5. The urban traffic flow prediction method based on incremental learning according to claim 1, characterized in that, S4 also includes: The Manhattan distance is used to calculate the magnitude of the change in the weight vector of the traffic flow prediction model for the current prediction task compared to the traffic flow prediction model for the previous prediction task. The normalized vector is obtained by normalizing the magnitude of the change using a relative ratio. The rate of change is calculated based on the normalized vector.

6. The urban traffic flow prediction method based on incremental learning according to claim 5, characterized in that, The method for calculating the rate of change is as follows: Where, δ k ′ represents a normalized vector, and δ k Indicates the range of change. This represents the summation of the values ​​of all dimensions representing the magnitude of the change, divided by the average of the number of dimensions; min(δ) k ') represents the minimum value in the normalized vector; max(δ) k ′) represents the maximum value in the normalized vector; α and β represent hyperparameters.

7. The urban traffic flow prediction method based on incremental learning according to claim 1, characterized in that, The dynamic adjustment is as follows: when training the traffic flow prediction model for the current prediction task, the learning rate of each model parameter in the traffic flow prediction model for the current prediction task is divided by the rate of change to obtain the dynamic learning rate of the corresponding model parameter, and the dynamic learning rate is used as the learning rate of the model parameter in the next training of the traffic flow prediction model for the current prediction task.

8. The urban traffic flow prediction method based on incremental learning according to claim 1, characterized in that, The traffic flow prediction model includes a multi-layer structure, each layer including a gating layer and a convolutional layer. The model parameters include each gated convolutional kernel in the gating layer and the weight vector of the convolutional layer.

9. The urban traffic flow prediction method based on incremental learning according to claim 8, characterized in that, The S6 mentioned above includes: S61. Obtain historical traffic data of the traffic segment corresponding to the prediction task, and preprocess the historical traffic data to obtain an input vector, wherein the shape of the input vector is [D,N,T]; where D represents the number of node features in the historical traffic data, N represents the number of nodes in the traffic segment, and T represents the time step; In each layer of the structure, execute S62 to S64: S62. The input vector is processed by the gated layer. The input vector is convolved in the time step dimension by two one-dimensional dilated convolution kernels, and the dilated convolution kernels are activated by tanh and sigmoid activation functions respectively to obtain a first vector and a second vector. The first vector and the second vector have the same shape [D, N, L], where L represents the dimension of the time step dimension after the dilated convolution. S63. Calculate the Hadamard product of the first and second vectors to obtain the third vector, which has the shape [D,N,L]. S64. Perform graph convolution on the third vector using the convolutional layer to obtain an output vector with shape [D,N,L]. S65. After performing residual concatenation on the output vectors of each layer and multi-layer convolution, the vectors are aggregated to obtain the aggregated vector. S66. The aggregated vector is activated using an activation function and then linearly transformed to obtain the traffic flow prediction result.

10. A city traffic flow prediction system based on incremental learning, characterized in that, The system is used to implement the method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Traffic light control method based on deep reinforcement learning and inverse reinforcement learning

    CN115762199A

  • Urban traffic data prediction method based on space-time causal prediction of continuous learning

    CN116740949A