A method to enhance the performance of traffic prediction algorithms using meta-learning
Through the introduction of meta -learning methods in the traffic forecast algorithm, the target model integrates the section of specific knowledge and field sharing of the traffic forecast field, solve the problem of low accuracy of the existing algorithm, and achieve higher prediction accuracy and performance.
Patent Information
- Application Number
- CN202411441076.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-16
AI Technical Summary
The existing traffic prediction algorithms capture limited influencing factors that can be characterized by specific knowledge in the traffic prediction field, resulting in low accuracy of prediction results and poor algorithm performance.
A meta-learning method is adopted to capture traffic prediction domain-specific knowledge and domain-shared knowledge through the target model fusion block, and combine the two to determine the prediction results. The target model fusion block includes meta-model, traffic prediction domain-specific model and knowledge fusion unit.
By capturing more influencing factors, the accuracy of traffic prediction results is improved and the performance of traffic prediction algorithms is significantly enhanced.
Smart Images

Figure CN119028138B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for enhancing the performance of a traffic prediction algorithm by using meta-learning. Background Art
[0002] When performing prediction tasks in the field of traffic prediction, such as predicting the traffic speed of a certain road section, current traffic prediction algorithms mainly determine the prediction results by capturing specific knowledge in the field of traffic prediction (such as traffic accidents, road conditions, etc.).
[0003] However, the current traffic prediction algorithms capture a limited number of influencing factors that can be represented by specific knowledge in the traffic prediction field, resulting in low accuracy of the determined prediction results and poor algorithm performance. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method for enhancing the performance of a traffic prediction algorithm by using meta-learning, which can enhance the performance of a traffic prediction algorithm.
[0005] To solve the above technical problems, in a first aspect, an embodiment of the present application provides a method for enhancing the performance of a traffic prediction algorithm by using meta-learning, the method comprising:
[0006] Get the target model fusion block;
[0007] By inputting the collected data of the prediction task in the traffic prediction field into the target model fusion block, the prediction result of the prediction task in the traffic prediction field is obtained;
[0008] Wherein, the target model fusion block includes:
[0009] A meta-model for capturing domain shared knowledge, wherein the domain shared knowledge is used to characterize common influencing factors in different urban prediction fields including the traffic prediction field;
[0010] A traffic prediction domain-specific model, used to capture traffic prediction domain-specific knowledge, wherein the traffic prediction domain-specific knowledge is used to characterize specific influencing factors in the traffic prediction domain;
[0011] The knowledge fusion unit is used to combine the domain shared knowledge and the traffic prediction domain specific knowledge to determine the prediction result of the prediction task in the traffic prediction domain.
[0012] A second aspect of an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method of using meta-learning to enhance the performance of a traffic prediction algorithm as described in the first aspect.
[0013] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the method of using meta-learning to enhance the performance of a traffic prediction algorithm as described in the first aspect are implemented.
[0014] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for enhancing the performance of a traffic prediction algorithm by using meta-learning as described in the first aspect are implemented.
[0015] It can be seen from the above technical solution that the embodiment of the present application provides a target model fusion block, which can capture the domain-specific knowledge of traffic prediction and the domain-shared knowledge of different city prediction fields including the traffic prediction field, and combine the domain-shared knowledge and the domain-specific knowledge of traffic prediction to determine the prediction results of the prediction task in the traffic prediction field, thereby reducing the impact of the limitations of the influencing factors that can be represented by the domain-specific knowledge of traffic prediction on the accuracy of the prediction results, thereby achieving the enhancement of the performance of the traffic prediction algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 A flowchart of a method for enhancing the performance of a traffic prediction algorithm using meta-learning provided in an embodiment of the present application;
[0018] Figure 2 A schematic diagram of data distribution collected in different city prediction fields within 48 hours provided in an embodiment of the present application;
[0019] Figure 3 A schematic diagram of a hierarchical structure of temperature, traffic speed and air quality inducing factors provided in an embodiment of the present application;
[0020] Figure 4 A schematic diagram of the architecture of a model fusion block provided in an embodiment of the present application;
[0021] Figure 5 A schematic diagram of the structure of a Transformer provided in an embodiment of the present application;
[0022] Figure 6A schematic diagram of a cross-domain meta-training process provided in an embodiment of the present application;
[0023] Figure 7 A schematic diagram of a cross-domain meta-learning paradigm provided for an embodiment of the present application;
[0024] Figure 8 A schematic diagram of a cross-domain meta-learning framework provided in an embodiment of the present application;
[0025] Fig. 9 A schematic diagram of the structure of a device for enhancing the performance of a traffic prediction algorithm using a meta-learning approach provided in an embodiment of the present application;
[0026] Fig.10 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0028] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0029] The urban prediction task refers to the use of urban big data to predict urban indicators (such as traffic indicators and temperature indicators, etc.), which is crucial for understanding the urban pattern and is beneficial to urban public management.
[0030] When performing prediction tasks in the field of traffic prediction, such as predicting the traffic speed of a certain road section, current traffic prediction algorithms mainly determine the prediction results by capturing specific knowledge in the traffic prediction field.
[0031] However, the current traffic prediction algorithms capture a limited number of influencing factors that can be represented by specific knowledge in the traffic prediction field, resulting in low accuracy of the determined prediction results and poor algorithm performance.
[0032] The technical personnel of this application consider that there are related patterns between urban prediction tasks in different fields, that is, there is domain shared knowledge. If these domain shared knowledge can be aggregated, it will be beneficial to significantly enhance the performance of traffic prediction algorithms. However, current meta-learning methods, such as gradient-based meta-learning methods, as a widely used knowledge aggregation learning paradigm, can only be applied to prediction tasks in a single field.
[0033] It should be noted that the principle of meta-learning is to learn a meta-model on a set of tasks generated by the same task distribution. Traditional meta-learning methods define the task distribution in a naive way, that is, all tasks are in the same domain, or in other words, all tasks are essentially the same tasks regardless of the data partition.
[0034] Therefore, the cross-domain nature of urban prediction tasks will endanger the applicability of current meta-learning methods mainly from the following three aspects: (1) Data heterogeneity: data sources, formats, and semantics are different in different domains of urban prediction tasks, and it is challenging to fuse cross-domain data to extract domain shared knowledge; (2) Task heterogeneity: cross-domain urban prediction tasks are generated by the same "urban environment distribution" but focus on different pillars of urban settings. Although similar patterns exist, it is challenging to discover shared common sense hidden in complex urban environments; (3) Model heterogeneity: different domains require different model architectures. Therefore, how to extend meta-learning to cross-domain tasks has become an emerging problem for aggregating domain shared knowledge in urban prediction tasks.
[0035] In response to the problems existing in the above-mentioned related technologies, the embodiments of the present application provide cross-domain meta-learning (CDML), which is a flexible framework that can aggregate reusable domain shared knowledge from different urban prediction fields.
[0036] Specifically, the core architecture of CDML is the model fusion block, which includes: (1) a meta-model, which is shared by cross-domain tasks and is used to capture domain shared knowledge; (2) a domain-specific model, which is shared only by prediction tasks in the same domain and is used to capture (or preserve) domain-specific knowledge; and (3) a knowledge fusion unit, which is used to combine domain shared knowledge and domain-specific knowledge to determine the prediction results of the prediction task to achieve good generalization and produce refined prediction outputs.
[0037] Unlike single-domain meta-learning methods that only maintain a fixed model architecture for all tasks (this is the core reason why it cannot be applied to cross-domain tasks), CDML based on model fusion blocks can set different model architectures for prediction tasks in different domains, such as setting different domain-specific models. This enables CDML to solve the applicability issues in the above three aspects and capture and analyze common patterns shared across domains (i.e., domain shared knowledge) and domain-specific features (i.e., domain-specific knowledge, caused by data, task, and model heterogeneity).
[0038] Therefore, the embodiment of the present application applies the above-mentioned model fusion block to the field of traffic prediction to aggregate domain shared knowledge from cross-domain urban prediction tasks, thereby reducing the impact of the limitations of influencing factors that can be represented by specific knowledge in the traffic prediction field on the accuracy of prediction results, thereby significantly enhancing the performance of the traffic prediction algorithm.
[0039] In conjunction with the accompanying drawings, a method for enhancing the performance of a traffic prediction algorithm using meta-learning provided by an embodiment of the present application is described in detail below through some embodiments and their application scenarios.
[0040] For the convenience of description, the following unified description of each term involved in the embodiments of the present application is first given. (Unless otherwise specified, the following unified description of each term applies to each implementation method of the present application. In view of the fact that the individual term first appears at the end, the individual term will not be uniformly described here. The individual term will be described when it first appears below):
[0041] Prediction tasks in the field of urban prediction: used to predict indicators in different urban prediction fields in the urban environment. Different indicators are associated with different subjects in complex urban spaces. For example, traffic speed reflects traffic conditions, temperature describes the urban heat island effect, and air quality is an important indicator for measuring urban livability, etc.
[0042] Meta-task: For each domain (i.e., urban prediction domain), meta-tasks can be constructed based on spatial or temporal scales. For example, in the traffic prediction domain, meta-tasks can be associated with prediction tasks for each region or road segment; in the temperature or air quality prediction domain, meta-tasks can be associated with prediction tasks for each time period.
[0043] First, see Figure 1 As shown, it is a flowchart of an implementation of a method for enhancing the performance of a traffic prediction algorithm by using meta-learning provided by an embodiment of the present application. The method may include the following steps:
[0044] Step S101: Obtain a target model fusion block;
[0045] Step S102: obtaining a prediction result of the prediction task in the traffic prediction field by inputting the collected data of the prediction task in the traffic prediction field into the target model fusion block.
[0046] Wherein, the target model fusion block includes:
[0047] A meta-model for capturing domain shared knowledge, wherein the domain shared knowledge is used to characterize common influencing factors in different urban prediction fields including the traffic prediction field;
[0048] A traffic prediction domain-specific model, used to capture traffic prediction domain-specific knowledge, wherein the traffic prediction domain-specific knowledge is used to characterize specific influencing factors in the traffic prediction domain;
[0049] The knowledge fusion unit is used to combine the domain shared knowledge and the traffic prediction domain specific knowledge to determine the prediction result of the prediction task in the traffic prediction domain.
[0050] In the specific implementation, the prediction task data in other city prediction fields with the same "urban environment distribution" as the traffic prediction field, as well as the prediction task data in the traffic prediction field, are used to train the above-mentioned meta-model; the prediction task data in the traffic prediction field are used to train the above-mentioned traffic prediction field-specific model; and the output data of the above-mentioned traffic prediction field-specific model and the above-mentioned meta-model, as well as the expected prediction results are used as training data to train the above-mentioned knowledge fusion unit, thereby obtaining the above-mentioned target model fusion block.
[0051] Through the above-mentioned target model fusion block, additional domain shared knowledge can be captured, thereby analyzing the complex interaction properties of urban systems. This can significantly improve the richness of information used for reasoning in prediction tasks in the field of traffic prediction, thereby improving the accuracy of prediction results and further enhancing the performance of traffic prediction algorithms.
[0052] It should be noted that prediction tasks in different urban prediction fields, such as traffic speed prediction, air quality prediction and weather prediction, are essential components of smart cities and are used to provide intelligent support for public management.
[0053] Due to the complex and interactive nature of urban systems, forecasting tasks from different urban forecasting fields always share relevant patterns (i.e., there are common influencing factors). Figure 2 The diagram shows the distribution of data collected in different city forecast areas within a 48-hour period, which depicts a 48-hour record of traffic speed, temperature, and air quality index. Figure 2It can be seen that the traffic speed curve shows an opposite trend compared with the temperature and air quality index curves. The intuitive reason is that when the traffic speed is slow, traffic congestion is likely to occur in the road network, and the large amount of warm gas emissions caused by congestion will lead to higher temperatures and worse air quality, and heat waves will also aggravate air pollution; the fundamental reason is that cross-domain urban prediction tasks share overlapping inducing factors (that is, there are common influencing factors).
[0054] Reference Figure 3 The hierarchical structure diagram of temperature, traffic speed and air quality inducing factors shown in the figure shows that each field has its own unique inducing factors, but these three cross-domain tasks actually also have shared inducing factors, such as human mobility and urban form. Through the above-mentioned target model fusion block, these shared inducing factors, that is, the domain shared knowledge of related observations between prediction tasks in different fields, can be captured and analyzed, thereby enhancing the performance of the traffic prediction algorithm.
[0055] As a possible implementation, in the target model fusion block, the meta-model is constructed based on the encoder architecture of Transformer, the knowledge fusion unit is constructed based on the decoder architecture of Transformer, and the traffic prediction domain-specific model is constructed based on the empirical model of the traffic prediction domain, and the empirical model is a model pre-trained using empirical expert knowledge in the traffic prediction domain.
[0056] Among them, Transformer is a deep learning model architecture for processing sequence data, which includes an encoder architecture and a decoder architecture. The encoder architecture can be composed of multiple identical layers, each layer consists of two sub-layers, namely the self-attention layer (Self-Attention Layer) and the feedforward fully connected layer (Feedforward Layer); the decoder architecture can be composed of multiple identical layers, each layer consists of three sub-layers, namely the self-attention layer, the encoder-decoder attention layer (Encoder-Decoder Attention Layer) and the feedforward fully connected layer.
[0057] For example, refer to Figure 4 The schematic diagram of the architecture of the model fusion block shown in FIG. 1 is a schematic diagram of the architecture of the model fusion block, which can be composed of the following three units:
[0058] (1) Domain-specific model, which aims to capture the unique knowledge of each city prediction domain task.
[0059] In specific implementation, the empirical model of each field (such as the empirical model of traffic prediction) can be used as the domain-specific model of the relevant field. Formally, for the kth task, Represents the domain-specific model associated with this task, and the parameters of this model are , then the domain specific model will be shared by all tasks in the domain to which the kth task belongs.
[0060] (2) A meta-model that is used to preserve and capture domain-shared knowledge across urban prediction domains.
[0061] In the specific implementation, the metamodel It can be built using the Transformer encoder architecture or other neural network structures.
[0062] For example, refer to Figure 5 As shown in the Transformer structure diagram, the input data z0 of the encoder architecture adopted by the meta-model can be defined as:
[0063]
[0064] Where L is the length of the lookback window, X is the traffic data (such as traffic flow or traffic speed), t is the current time, i is the intersection (or road), and N is the total number of intersections (or roads).
[0065] In the above Transformer encoder structure, the input data is first passed through the Multi-Head Self-Attention (MSA) layer to obtain the weighted feature vector MSA(Q, K, V), which is expressed as follows:
[0066] MSA(Q, K, V) = Concat(head1, . . . , head h )W O
[0067] Among them, Q represents query, K represents key, V represents value, Concat() represents the operation used to concatenate arrays, and W represents the O represents the output projection parameter, h represents the number of heads in the multi-head self-attention layer, for head1 to head h Any of (with head i ), which can be determined by the following formula:
[0068]
[0069] Among them, dk represents the output dimension, Q represents the query, K represents the key, and V represents the value. , , Represents the parameters of query projection, key projection, and value projection, Attention() represents the processing operation of the multi-head self-attention layer, and softmax() represents the normalization operation.
[0070] The output data of the multi-head self-attention layer will be sent to the next layer in the encoder architecture, the Feed Forward Neural Network layer, which will then determine the output data of the encoder structure.
[0071] Based on the above data processing process, the metamodel can be expressed as follows:
[0072]
[0073] Among them, LN represents the fully connected layer, MLP represents the multi-layer perceptron, represents the weighted eigenvector, Indicates passing The entire encoding process for obtaining the final representation H (i.e., the output data of the metamodel) is implemented by L1 inner layers. The output data of the metamodel can also be expressed as , metamodel Shared by all tasks in the urban prediction domain.
[0074] (3) Knowledge fusion unit, which is used to fuse the output of the domain-specific model and the meta-model to produce prediction results. The fusion operation can adopt different formats and designs according to actual needs.
[0075] For example, refer to Figure 5 Transformer schematic diagram shown, knowledge fusion unit fψ k It can be established using the corresponding decoder architecture, and the parameters contained in the knowledge fusion unit are expressed as ψ k .
[0076] The output of the domain-specific model and the output of the meta-model are used as the input of the knowledge fusion unit, and the prediction result of the kth task is It can be expressed as:
[0077]
[0078] in, Representation model fusion module When the input data is Output data when represents the knowledge fusion unit, Representation Metamodel When the input data is Output data when Representing Domain Specific Models When the input data is Output data when Represents the input data dimension transformed based on metamodel matching , the parameter set of the model fusion block , Represents the parameters of the metamodel, Parameters representing domain-specific models, Represents the parameters of the knowledge fusion unit.
[0079] It should be noted that, unlike the use of Transformer in the field of Natural Language Processing (NLP), the embodiment of the present application does not utilize the masked attention mechanism and position embedding to ensure its applicability in the field of urban prediction.
[0080] It can be seen from the above technical solution that the embodiment of the present application provides a target model fusion block, which can capture the domain-specific knowledge of traffic prediction and the domain-shared knowledge of different city prediction fields including the traffic prediction field, and combine the domain-shared knowledge and the domain-specific knowledge of traffic prediction to determine the prediction results of the prediction task in the traffic prediction field, thereby reducing the impact of the limitations of the influencing factors that can be represented by the domain-specific knowledge of traffic prediction on the accuracy of the prediction results, thereby achieving the enhancement of the performance of the traffic prediction algorithm.
[0081] In one embodiment, the step of obtaining the target model fusion block includes:
[0082] Obtaining pre-trained model fusion blocks respectively associated with different city prediction fields, wherein each of the model fusion blocks shares a meta-model and a knowledge fusion unit, and each of the model fusion blocks has a domain-specific model associated with a different city prediction field;
[0083] Detecting whether there is a model fusion block related to the traffic prediction field in each of the model fusion blocks;
[0084] In case that a model fusion block associated with the traffic prediction field is detected, determining the model fusion block associated with the traffic prediction field as an initial model fusion block;
[0085] In the case where no model fusion block associated with the traffic prediction field is detected, constructing an initial model fusion block using a metamodel shared by each of the model fusion blocks;
[0086] The initial model fusion block is fine-tuned using a collected data set of a prediction task in the traffic prediction field to obtain the target model fusion block.
[0087] In the specific implementation, taking into account that it is different from traditional single-domain meta-learning, when adapting to new tasks (i.e., prediction tasks in the traffic prediction field) in a cross-domain setting, it is necessary to first determine whether the domain of the new task (i.e., the traffic prediction field) has been observed in the previous meta-learning (or meta-training) process, or whether relevant data in the traffic prediction field has been used in the previous meta-learning process. In other words, it is necessary to first determine whether there are model fusion blocks related to the traffic prediction field in the various model fusion blocks obtained by the current training.
[0088] If the traffic prediction domain is observed in the previous meta-learning process, that is, when the model fusion block associated with the traffic prediction domain is detected, the model fusion block associated with the traffic prediction domain can be directly used to initialize the model fusion block required to process the new task, so as to ensure that the initialized model fusion block (i.e., the initial model fusion block) can have a higher degree of adaptability with the new task, thereby further ensuring the prediction accuracy. Among them, the model fusion block associated with the traffic prediction domain includes: a meta-model pre-trained with data related to the traffic prediction domain, a knowledge fusion unit, and a domain-specific model.
[0089] If the traffic prediction domain is not observed in the previous meta-learning process, that is, if the model fusion block associated with the traffic prediction domain is not detected, a new model fusion block can be constructed for the new task to initialize the model fusion block required to process the new task. In the newly established model fusion block, the meta-model adopts the meta-model obtained by the previous meta-training (that is, the meta-model shared by each of the model fusion blocks), and the knowledge fusion unit and the domain-specific model are newly established, thereby ensuring that the newly established model fusion block can present good prediction performance for the new task with only a small number of iterations in the subsequent fine-tuning process, that is, it is guaranteed to have good adaptive capabilities.
[0090] After obtaining the initial model fusion block, according to the collected data set of the prediction task in the traffic prediction field, such as the traffic speed prediction task for a certain road section, the input data and the expected output data are divided according to the historical vehicle speed records collected at different times for the road section, and the initial model fusion block is fine-tuned according to the input data and the expected output data. The fine-tuning is terminated after reaching a certain number of iterations to obtain the target model fusion module.
[0091] In this embodiment, unlike the single-domain meta-learning method that only uses the meta-model to adapt to the new task, the cross-domain meta-learning framework proposed in the embodiment of the present application adopts a method in which the entire model fusion block adapts to the new task, that is, based on the pre-trained model fusion blocks, the model fusion blocks required to process the new task are initialized according to whether the traffic prediction field is observed in the previous meta-learning process, and then the initialized model fusion blocks are fine-tuned. In this way, the structural flexibility of the pre-trained model fusion blocks and the generalization ability of the meta-model can be used to ensure the training efficiency of the initialized model fusion blocks in the fine-tuning process, and the prediction accuracy of the fine-tuned model fusion blocks (i.e., the target model fusion blocks) for new tasks can be guaranteed.
[0092] Optionally, using a meta-model shared by each of the model fusion blocks to construct an initial model fusion block, including:
[0093] A random initialization method is used, or the model is initialized based on the empirical expert knowledge in the traffic prediction field to obtain an initial domain-specific model and an initial knowledge fusion unit;
[0094] An initial model fusion block is constructed by using the meta-model shared by each of the model fusion blocks, the initial domain-specific model and the initial knowledge fusion unit.
[0095] In specific implementation, the initial parameters of the deep learning model can be determined by using a random initialization method such as normal distribution initialization or uniform initialization, thereby obtaining an initial domain-specific model and an initial knowledge fusion unit. Alternatively, the model structure can be determined based on empirical expert knowledge and the model parameters can be determined, thereby obtaining an initial domain-specific model and an initial knowledge fusion unit.
[0096] For example, for a new task, such as a prediction task in the field of traffic prediction, a new model fusion block is determined for adaptation, and the adaptation process mainly includes two stages:
[0097] Phase 1: Initialization. For the meta-learning paradigm, an important manifestation of generalization ability is the ability to quickly adapt by providing a good model initialization for a new task. The model fusion block learned from the cross-domain city prediction task in the embodiment of the present application retains both domain-shared knowledge and domain-specific knowledge, which provides a reasonable starting point for training models for new tasks.
[0098] Specifically, the model fusion block is initialized based on whether the domain of the new task is observed during meta-training.
[0099] There are two options for new tasks. If the domain of the new task is observed during meta-training, the model fusion block learned in the corresponding domain is directly adopted as the initial model fusion block for the new task. Otherwise, part of the learned model fusion block is selected. For example, only the learned optimal meta-model is adopted, and the domain-specific model and knowledge fusion unit are initialized randomly or using empirical expert knowledge, thereby obtaining the initialized model fusion block.
[0100] In terms of form, the new task T j The initial model fusion block parameter set π j can be expressed as:
[0101]
[0102] in, represents the parameter set of the model fusion block learned in the corresponding domain, represents the optimal meta-model parameters learned, Represents the parameters of the newly established domain-specific model and knowledge fusion unit, Represents a new task T j The domain belongs to the city prediction domain D that can be observed during the meta-training process, Represents the new task T j The domain of does not belong to the city prediction domain D that can be observed during the meta-training process.
[0103] The second stage: fine-tuning. After obtaining the initial model fusion block associated with the new task, we can use stochastic gradient descent (SGD) to fine-tune the new task T. j The initial model fusion block is retrained on the associated dataset to achieve fine-tuning. The relevant training process can be expressed as follows:
[0104]
[0105] in, represents the parameter set of the initial model fusion block, Indicates updated , represents the gradient, represents the prediction loss function, Represents the learning rate.
[0106] For the above parameter set π j Iterative updates are performed to achieve fine-tuning, and the target model fusion block obtained after fine-tuning will be used to determine the prediction results of the new task.
[0107] In one embodiment, the target model fusion block is obtained based on pre-trained model fusion blocks associated with different city prediction fields, each of the model fusion blocks shares a meta-model and a knowledge fusion unit, and the city prediction fields associated with the domain-specific models of each of the model fusion blocks are different, and the domain-specific models of each of the model fusion blocks are connected in parallel with the meta-model shared by each of the model fusion blocks to avoid further back-propagation of the gradients of the cross-domain meta-tasks collected in the meta-model to the domain-specific models;
[0108] Each of the model fusion blocks is trained through the following steps:
[0109] Obtaining meta-task sets associated with different city prediction fields, extracting K meta-tasks from each of the meta-task sets, wherein the meta-tasks include: input data and expected output data corresponding to a single prediction task, where K is a positive integer;
[0110] Performing meta-training on each of the model fusion blocks using the K meta-tasks;
[0111] In the inner loop phase of meta-training, the gradients associated with the K meta-tasks are collected;
[0112] In the outer loop phase of meta-training, based on the gradient descent algorithm, all the collected gradients are used to update the parameters of the meta-model and knowledge fusion unit shared by each model fusion block, and for each city prediction domain, the gradient associated with the meta-task under the city prediction domain is used to update the parameters of the domain-specific model in the model fusion block associated with the city prediction domain;
[0113] When the training objectives are met, the meta-training is terminated to obtain the trained model fusion blocks.
[0114] The model fusion block can be jointly trained with tasks in different urban prediction fields through ad-hoc connection.
[0115] In this embodiment, considering that the meta-model and the knowledge fusion unit are shared by all cross-domain tasks, when using relevant data from different city prediction fields to train the meta-model and the knowledge fusion unit, it is necessary to avoid introducing irrelevant gradients from other city prediction fields to poison the domain-specific models. To this end, the embodiment of the present application proposes an asynchronous meta-training strategy, which searches and collects optimization directions in the inner loop, and updates the model fusion block in the outer loop. In the inner and outer loops, each domain-specific model is isolated from each other to avoid poisoning the domain-specific model.
[0116] Reference Figure 6The schematic diagram of the cross-domain meta-training process shown in the figure shows that the embodiment of the present application follows the rules of meta-learning and divides meta-training into two stages, namely, the inner loop and the outer loop. Different from the single-domain meta-learning method, such as Model-Agnostic Meta-Learning (MAML), only the meta-model is learned and updated in the outer loop stage, and the gradient of the task is collected in the inner loop stage. In the cross-domain meta-learning setting of the embodiment of the present application, both the meta-model and the domain-specific model need to be learned, and considering that the meta-model is shared by all cross-domain tasks, training the model fusion block of all cross-domain tasks at the same time will introduce gradients from other domains, thereby contaminating the domain-specific model. The embodiment of the present application decomposes block-level training into unit-level training, thereby providing an asynchronous meta-training strategy.
[0117] Specifically, the embodiment of the present application searches and collects optimization directions from all tasks for the units in the inner loop stage, and when the domain-specific models and knowledge fusion units of each domain are updated separately in the outer loop stage, the meta-model and the remaining units in the model fusion blocks of other domains (i.e., the domain-specific models and knowledge fusion units) are kept fixed; when updating the meta-model, the domain-specific models and knowledge fusion units in each model fusion block are kept fixed.
[0118] Exemplarily, the asynchronous meta-training strategy proposed in the embodiment of the present application is as follows:
[0119] (1) Inner loop stage: The goal of the inner loop stage is to search and collect the optimization direction of the model fusion block.
[0120] Formally, for each task (i.e. meta-task) T k , set the prediction loss function of the associated model fusion block to L Tk (f πk ), and then search and collect optimization directions through one or more gradient descent updates on the relevant data set. For example, a gradient descent update can be expressed as follows:
[0121]
[0122] in, Representation model fusion block Parameters, Indicates updated , represents the gradient, Representation model fusion block The prediction loss function is Represents the learning rate.
[0123] The optimization direction of the model fusion blocks associated with all cross-domain tasks (such as ) for evaluation and collection so as to subsequently update the model parameters.
[0124] (2) Outer loop stage: Based on the optimization direction collected from the inner loop stage, the parameters of the model fusion block are updated. The overall goal of the update (i.e., the training goal of meta-training) is to minimize the prediction loss of the model fusion block for cross-domain tasks on related datasets.
[0125] Optionally, the training objective of the meta-training is expressed as follows:
[0126]
[0127] Among them, K represents the number of meta-tasks used in meta-training, represents the kth meta-task, represents the prediction loss function, express The urban forecasting field represents the city prediction domain set used for meta-training, represents the parameter set of the model fusion block, Indicates the updated parameter set The associated model fusion block.
[0128] It can be understood that in order to avoid the gradient contamination problem of the domain-specific model and the knowledge fusion unit caused by simultaneously updating each model fusion block, the embodiment of the present application optimizes each unit in the model fusion block in an asynchronous manner (i.e., parameter update).
[0129] When optimizing domain-specific models, since domain-specific models are only shared by tasks under the same city prediction domain, the relevant domain-specific models are updated for each city prediction domain.
[0130] For example, for a given city prediction domain D i , extract D from the inner loop stage i The optimization direction of related tasks and meta-optimization are performed through SGD. The optimization process is expressed as follows:
[0131]
[0132] in, represents the learning rate, Denotes the urban prediction domain D i The parameters of the domain-specific model shared by each task are: Indicates the optimized , Denotes the urban prediction domain D i The sum of the prediction loss functions associated with each task below, represents the gradient, represents the model fusion block after parameter update, represents the kth task The field of urban forecasting.
[0133] In the optimization process of the above domain-specific models, the domain-specific models, meta-models and knowledge fusion units of other domains are fixed to update the urban prediction domain D i Domain-specific model parameters ,The domain-specific models of other domains are then updated in a similar optimization manner.
[0134] When optimizing the meta-model and knowledge fusion unit, since the meta-model and knowledge fusion unit are shared by all cross-domain tasks, there is no need to distinguish between urban prediction domains when updating.
[0135] Exemplarily, the K meta-tasks extracted above are determined as a new meta-task set T, and the optimization process of the meta-model is expressed as follows:
[0136]
[0137] in, represents the learning rate, Represents the parameters of the metamodel, Indicates the optimized , represents the sum of the prediction loss functions associated with each meta-task in the meta-task set T, represents the gradient, represents the model fusion block after parameter update, represents the kth task in the meta-task set T.
[0138] The optimization process of the knowledge fusion unit is expressed as follows:
[0139]
[0140] in, represents the learning rate, represents the parameters of the knowledge fusion unit, Indicates the optimized , represents the sum of the prediction loss functions associated with each meta-task in the meta-task set T, represents the gradient, represents the model fusion block after parameter update, represents the kth task in the meta-task set T.
[0141] During the optimization of the meta-model and knowledge fusion unit, all domain-specific models are kept fixed. After each training epoch of the inner and outer loop phases,
[0142] We redistribute the updated parameter set π to each model fusion block. When the above training objectives are met, the meta-training process ends and the optimal parameter set of the model fusion block is obtained. ,in, They represent the optimal parameters of the meta-model, domain-specific model and knowledge fusion unit respectively.
[0143] In one embodiment, different city prediction domain tasks have their own model fusion blocks, and the domain-specific models in these model fusion blocks can be connected in parallel to a shared meta-model, thereby ensuring that different city prediction domain tasks can maintain their own unique data and model options while establishing a temporary connection between domain-specific knowledge and domain shared knowledge.
[0144] In one embodiment, the meta-task sets associated with the different city prediction fields include:
[0145] A meta-task set associated with the field of traffic prediction, wherein the meta-tasks in the meta-task set use the historical speed records corresponding to a single traffic speed prediction task as input data and use the actual average speed of a set node in the road network corresponding to the single traffic speed prediction task within a set time window as expected output data;
[0146] A meta-task set associated with the meteorological forecasting field, wherein the input data and expected output data of the meta-tasks in the meta-task set are obtained by dividing the historical meteorological indicator record sequence corresponding to the single meteorological indicator forecasting task;
[0147] A meta-task set associated with the air quality prediction field, wherein input data and expected output data of the meta-tasks in the meta-task set are obtained by dividing the historical air quality record sequence corresponding to a single air quality prediction task.
[0148] In specific implementation, different model fusion blocks can be trained based on the three urban prediction fields of traffic prediction, meteorological prediction and air prediction.
[0149] For each traffic speed prediction task (i.e., meta-task set) in the field of traffic prediction, the historical speed record of the road network can be used as input data, or the historical speed record and topology (i.e., adjacency matrix) of the road network can be used as input data, and the historical average speed of each node (i.e., road segment) in the road network within a time window can be used as the expected output data. Different traffic speed prediction tasks are used to predict the traffic speed of different nodes in the road network. Among them, the collected data sets associated with the traffic prediction field can include road signs, adjacency matrix, average traffic speed and time, etc.; the adjacency matrix is used to describe the topology of the road network. For example, if the road network has 10 intersections, the size of the adjacency matrix is 10x10, and the value of each element in the adjacency matrix is used to describe whether the relevant intersections are connected. For example, if the second intersection and the third intersection are connected, then the value of the element with the subscript [2,3] in the adjacency matrix is 1; if the second intersection and the third intersection are not connected, then the value of the element is 0.
[0150] For each meteorological indicator prediction task (i.e., meta-task set) in the field of meteorological prediction, a fixed-size time window can be used to divide the historical meteorological indicator record sequence into multiple subsequences. For each subsequence, the last record is used as the expected output data, and the previous part is used as the input data. Different meteorological indicator prediction tasks are used to predict meteorological indicators in the time periods corresponding to different subsequences. Among them, the collected data sets associated with the meteorological prediction field may include hourly meteorological data, which may include air temperature, dew point temperature, relative humidity, wind speed, pressure altitude, visibility, and apparent temperature.
[0151] For each air quality prediction task (i.e., meta-task set) in the field of air prediction, a fixed-size time window can be used to divide the air quality record sequence into multiple subsequences. For each subsequence, the last record is used as the expected output data, and the previous part is used as the input data. Different air quality prediction tasks are used to predict the air quality in the time period corresponding to different subsequences. The collected data sets associated with the air prediction field may include hourly air quality data, which may include lead (Pb) concentration, nitrogen dioxide (NO2) concentration, PM2.5, ozone (O3) concentration, carbon monoxide (CO) concentration, PM10, sulfur dioxide (SO2) concentration and time, etc.
[0152] In actual application, the length of the input data and output data associated with the above fields can be set to 12, and in order to improve the model training effect, the cities and time periods associated with the above collected data sets can be the same.
[0153] Subsequently, domain-specific models are determined for the prediction tasks under the above three urban prediction domains.
[0154] For the traffic speed prediction task, the domain-specific model can choose one or more of the following four models:
[0155] (1) Temporal Graph Convolutional Network (TGCN): It combines Graph Convolutional Networks (GCN) and Gated Recurrent Unit (GRU) to model spatial and temporal dependencies.
[0156] (2) Adaptive Temporal Dissimilarity Measure (ATDM) model: It models the temporal dissimilarity between time series in an adaptive manner.
[0157] (3) Hyperbolic Graph Convolutional Networks (HGCN): It predicts traffic data by operating on both micro and macro traffic graphs simultaneously.
[0158] (4) Spatial-Temporal Transformer Network (STTN): It can capture dynamic spatial dependencies and long-term temporal dependencies for long-term traffic prediction.
[0159] Considering that GRU has shown excellent performance in meteorological data modeling, GRU is selected as the domain-specific model associated with the meteorological forecasting field; and considering that Long-Short Term Memory (LSTM) is widely used as the backbone model for air quality-related tasks, LSTM is selected as the domain-specific model associated with the air forecasting field.
[0160] In practical applications, the fields of meteorological indicator prediction tasks, air quality prediction tasks, and traffic speed prediction can be used as the observation domain of meta-training, so that the target model fusion block can be quickly obtained for the prediction tasks in the traffic prediction field. Alternatively, the fields of meteorological indicator prediction tasks and air quality prediction tasks can be used as the observation domain of meta-training, that is, the relevant data in the traffic prediction field can be removed from the meta-training, and then the unknown domain generalization ability of CDML (that is, using the trained meta-model) can be used to establish the target model fusion block for the prediction task in the traffic prediction field.
[0161] It should be noted that the CDML proposed in the embodiment of this application is a flexible extension of meta-learning from a single domain to cross-domain tasks. Figure 7The schematic diagram of the cross-domain meta-learning paradigm shown in Figure 1 shows that with the help of the cross-domain asynchronous training method of CDML, the meta-model parameters in the target model fusion block associated with tasks in different urban prediction fields, as well as the domain-specific model parameters and knowledge fusion unit parameters associated with each field can be determined along a more reasonable optimization direction (rather than the optimization direction of overfitting to a certain field).
[0162] Reference Figure 8 The schematic diagram of the cross-domain meta-learning framework shown in FIG. 1 is a schematic diagram of the cross-domain meta-learning framework shown in FIG. 1 , and the embodiment of the present application mainly achieves optimization in the following two aspects:
[0163] (1) Relax task allocation.
[0164] Considering that the meta-learning paradigm expects to work on a set of tasks generated from the same distribution, most meta-learning methods, especially gradient-based methods (such as MAML, etc.), construct meta-tasks by running the same model on different data segments, which are essentially single-domain tasks. However, the heterogeneity of data, models, and tasks makes the distribution of urban prediction tasks more complex, that is, it should be a cross-domain task in nature. After conducting an empirical analysis of the urban prediction task, this application observed similar patterns across task domains, which indicates that there is shared common knowledge between domains. Based on this observation, this application relaxes the task distribution from a single domain to multiple domains based on the similarity of "urban environment distribution".
[0165] (2) Cross-domain meta-training and adaptation.
[0166] Considering that in single-domain meta-learning methods, only the meta-model is learned and used to adapt to new tasks. However, due to the existence of domain-shared knowledge and domain-specific knowledge in the cross-domain setting, there are two levels of adaptation: meta-model adaptation for all tasks and domain-specific model adaptation for each domain. Therefore, this application designs a model fusion block to learn domain-shared knowledge and domain-specific knowledge simultaneously.
[0167] The special connections between units within the model fusion block (i.e., parallel connections between the meta-model and different domain-specific models) can adapt to the heterogeneity of cross-domain tasks. In addition, the asynchronous meta-training and adaptive strategies of the present application further ensure accurate cross-domain optimization. It is understandable that the above adaptive strategies can be applied to new domains of urban prediction tasks that have never been observed before, thereby improving the applicability of CDML in practical applications.
[0168] Therefore, the current gradient-based meta-learning methods (such as MAML, Reptile, etc.) can be regarded as special cases of CDML applied to single-domain tasks proposed in the embodiments of the present application, that is, CDML can be downgraded to a single-domain method by simply removing the domain-specific model and knowledge fusion unit in the model fusion block. And because CDML still follows the relevant rules of meta-learning, the current meta-learning techniques can also be applied to CDML to obtain better practice.
[0169] The present application also provides a device for enhancing the performance of a traffic prediction algorithm by using meta-learning, such as Fig. 9 As shown, the device comprises:
[0170] A first acquisition module is used to acquire a target model fusion block;
[0171] A first prediction module, used for obtaining a prediction result of the prediction task in the traffic prediction field by inputting the collected data of the prediction task in the traffic prediction field into the target model fusion block;
[0172] Wherein, the target model fusion block includes:
[0173] A meta-model for capturing domain shared knowledge, wherein the domain shared knowledge is used to characterize common influencing factors in different urban prediction fields including the traffic prediction field;
[0174] A traffic prediction domain-specific model, used to capture traffic prediction domain-specific knowledge, wherein the traffic prediction domain-specific knowledge is used to characterize specific influencing factors in the traffic prediction domain;
[0175] The knowledge fusion unit is used to combine the domain shared knowledge and the traffic prediction domain specific knowledge to determine the prediction result of the prediction task in the traffic prediction domain.
[0176] Optionally, the first acquisition module includes:
[0177] A first acquisition submodule is used to acquire pre-trained model fusion blocks associated with different city prediction fields, each of which shares a meta-model and a knowledge fusion unit, and each of which has a domain-specific model associated with a different city prediction field;
[0178] The second acquisition submodule is used to detect whether there is a model fusion block related to the traffic prediction field in each of the model fusion blocks;
[0179] A third acquisition submodule is used to determine the model fusion block associated with the traffic prediction field as an initial model fusion block when the model fusion block associated with the traffic prediction field is detected;
[0180] A fourth acquisition submodule is used to construct an initial model fusion block using a meta-model shared by each of the model fusion blocks when no model fusion block associated with the traffic prediction field is detected;
[0181] The fifth acquisition submodule is used to use the collected data set of the prediction task in the traffic prediction field to fine-tune the initial model fusion block to obtain the target model fusion block.
[0182] Optionally, the fourth acquisition submodule includes:
[0183] An initialization module, used to initialize the model by random initialization or based on the empirical expert knowledge in the field of traffic prediction to obtain an initial domain-specific model and an initial knowledge fusion unit;
[0184] A construction module is used to construct an initial model fusion block by utilizing the meta-model shared by each of the model fusion blocks, the initial domain-specific model and the initial knowledge fusion unit.
[0185] Optionally, the target model fusion block is obtained based on pre-trained model fusion blocks respectively associated with different city prediction fields, each of the model fusion blocks shares a meta-model and a knowledge fusion unit, and the city prediction fields associated with the domain-specific models of each of the model fusion blocks are different, and the domain-specific models of each of the model fusion blocks are connected in parallel with the meta-model shared by each of the model fusion blocks to avoid further back-propagation of the gradients of the cross-domain meta-tasks collected in the meta-model to the domain-specific models;
[0186] The apparatus further comprises a first training module, wherein the first training module is configured to perform the following steps:
[0187] Obtaining meta-task sets associated with different city prediction fields, extracting K meta-tasks from each of the meta-task sets, wherein the meta-tasks include: input data and expected output data corresponding to a single prediction task, where K is a positive integer;
[0188] Performing meta-training on each of the model fusion blocks using the K meta-tasks;
[0189] In the inner loop phase of meta-training, the gradients associated with the K meta-tasks are collected;
[0190] In the outer loop phase of meta-training, based on the gradient descent algorithm, all the collected gradients are used to update the parameters of the meta-model and knowledge fusion unit shared by each model fusion block, and for each city prediction domain, the gradient associated with the meta-task under the city prediction domain is used to update the parameters of the domain-specific model in the model fusion block associated with the city prediction domain;
[0191] When the training objectives are met, the meta-training is terminated to obtain the trained model fusion blocks.
[0192] Optionally, the training objective of the meta-training is expressed as follows:
[0193]
[0194] Among them, K represents the number of meta-tasks used in meta-training, represents the kth meta-task, represents the prediction loss function, express The urban forecasting field represents the city prediction domain set used for meta-training, represents the parameter set of the model fusion block, Indicates the updated parameter set The associated model fusion block.
[0195] Optionally, the meta-task sets associated with the different city prediction fields include:
[0196] A meta-task set associated with the field of traffic prediction, wherein the meta-tasks in the meta-task set use the historical speed records corresponding to a single traffic speed prediction task as input data and use the actual average speed of a set node in the road network corresponding to the single traffic speed prediction task within a set time window as expected output data;
[0197] A meta-task set associated with the meteorological forecasting field, wherein the input data and expected output data of the meta-tasks in the meta-task set are obtained by dividing the historical meteorological indicator record sequence corresponding to the single meteorological indicator forecasting task;
[0198] A meta-task set associated with the air quality prediction field, wherein input data and expected output data of the meta-tasks in the meta-task set are obtained by dividing the historical air quality record sequence corresponding to a single air quality prediction task.
[0199] Optionally, in the target model fusion block, the meta-model is constructed based on the encoder architecture of Transformer, the knowledge fusion unit is constructed based on the decoder architecture of Transformer, and the traffic prediction domain-specific model is constructed based on the empirical model of the traffic prediction domain, and the empirical model is a model pre-trained using empirical expert knowledge in the traffic prediction domain.
[0200] It can be seen from the above technical solution that the embodiment of the present application provides a target model fusion block, which can capture the domain-specific knowledge of traffic prediction and the domain-shared knowledge of different city prediction fields including the traffic prediction field, and combine the domain-shared knowledge and the domain-specific knowledge of traffic prediction to determine the prediction results of the prediction task in the traffic prediction field, thereby reducing the impact of the limitations of the influencing factors that can be represented by the domain-specific knowledge of traffic prediction on the accuracy of the prediction results, thereby achieving the enhancement of the performance of the traffic prediction algorithm.
[0201] The present application also provides an electronic device, referring to Fig.10 , Fig.10 Schematic diagram of an electronic device according to an embodiment of the present application. Fig.10 As shown, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus communication. The memory 110 stores a computer program, which can be executed on the processor 120, thereby implementing the steps in the method for enhancing the performance of a traffic prediction algorithm using meta-learning disclosed in an embodiment of the present application.
[0202] The embodiment of the present application also provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the method of using meta-learning to enhance the performance of a traffic prediction algorithm as disclosed in the embodiment of the present application is implemented.
[0203] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method of using meta-learning to enhance the performance of a traffic prediction algorithm as disclosed in the embodiment of the present application.
[0204] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0205] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0206] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, systems, devices, storage media, and program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0207] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0208] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0209] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0210] The above is a detailed introduction to a method provided by the present application that uses meta-learning to enhance the performance of a traffic prediction algorithm. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for enhancing the performance of a traffic prediction algorithm using meta-learning, characterized in that: The method comprises: Get the target model fusion block; By inputting the collected data of the prediction task in the traffic prediction field into the target model fusion block, the prediction result of the prediction task in the traffic prediction field is obtained; Wherein, the target model fusion block includes: A meta-model for capturing domain shared knowledge, wherein the domain shared knowledge is used to characterize common influencing factors in different urban prediction fields including the traffic prediction field; A traffic prediction domain model, used to capture traffic prediction domain knowledge, wherein the traffic prediction domain knowledge is used to characterize influencing factors in the traffic prediction domain; A knowledge fusion unit, used to combine the domain shared knowledge and the traffic prediction domain knowledge to determine the prediction result of the prediction task in the traffic prediction domain; Get the target model fusion block, including: Obtaining pre-trained model fusion blocks respectively associated with different city prediction fields, wherein each of the model fusion blocks shares a meta-model and a knowledge fusion unit, and each of the model fusion blocks has a different city prediction field associated with its own domain model; Detecting whether there is a model fusion block related to the traffic prediction field in each of the model fusion blocks; In case that a model fusion block associated with the traffic prediction field is detected, determining the model fusion block associated with the traffic prediction field as an initial model fusion block; In the case where no model fusion block associated with the traffic prediction field is detected, constructing an initial model fusion block using a metamodel shared by each of the model fusion blocks; The initial model fusion block is fine-tuned using a collected data set of a prediction task in the traffic prediction field to obtain the target model fusion block.
2. The method according to claim 1, characterized in that Using the meta-model shared by each of the model fusion blocks, an initial model fusion block is constructed, including: A random initialization method is used, or the model is initialized based on the empirical expert knowledge in the traffic prediction field to obtain an initial domain model and an initial knowledge fusion unit; An initial model fusion block is constructed by utilizing the meta-model shared by each of the model fusion blocks, the initial domain model and the initial knowledge fusion unit.
3. The method according to claim 1, characterized in that The target model fusion block is obtained based on pre-trained model fusion blocks associated with different city prediction fields, each of the model fusion blocks shares a meta-model and a knowledge fusion unit, and the city prediction fields associated with the domain models of each of the model fusion blocks are different, and the domain models of each of the model fusion blocks are connected in parallel with the meta-model shared by each of the model fusion blocks to avoid further back-propagation of the gradients of the cross-domain meta-tasks collected in the meta-model to the domain model; Each of the model fusion blocks is trained through the following steps: Obtaining meta-task sets associated with different city prediction fields, extracting K meta-tasks from each of the meta-task sets, wherein the meta-tasks include: input data and expected output data corresponding to a single prediction task, where K is a positive integer; Performing meta-training on each of the model fusion blocks using the K meta-tasks; In the inner loop phase of meta-training, the gradients associated with the K meta-tasks are collected; In the outer loop phase of meta-training, based on the gradient descent algorithm, all the collected gradients are used to update the parameters of the meta-model and knowledge fusion unit shared by each model fusion block, and for each city prediction domain, the gradient associated with the meta-task under the city prediction domain is used to update the parameters of the domain model in the model fusion block associated with the city prediction domain; When the training objectives are met, the meta-training is terminated to obtain the trained model fusion blocks.
4. The method according to claim 3, characterized in that The training objective of the meta-training is expressed as follows: Among them, K represents the number of meta-tasks used in meta-training, represents the kth meta-task, represents the prediction loss function, express The urban forecasting field to which it belongs, represents the city prediction domain set used for meta-training, represents the parameter set of the model fusion block, Indicates the updated parameter set The associated model fusion block.
5. The method according to claim 3, characterized in that: The meta-task sets associated with the different urban prediction fields include: A meta-task set associated with the field of traffic prediction, wherein the meta-tasks in the meta-task set use the historical speed records corresponding to a single traffic speed prediction task as input data and use the actual average speed of a set node in the road network corresponding to the single traffic speed prediction task within a set time window as expected output data; A meta-task set associated with the meteorological forecasting field, wherein the input data and expected output data of the meta-tasks in the meta-task set are obtained by dividing the historical meteorological indicator record sequence corresponding to the single meteorological indicator forecasting task; A meta-task set associated with the air quality prediction field, wherein input data and expected output data of the meta-tasks in the meta-task set are obtained by dividing the historical air quality record sequence corresponding to a single air quality prediction task.
6. The method according to any one of claims 1 to 5, characterized in that: In the target model fusion block, the meta-model is constructed based on the encoder architecture of Transformer, the knowledge fusion unit is constructed based on the decoder architecture of Transformer, and the traffic prediction domain model is constructed based on the empirical model of the traffic prediction domain, and the empirical model is a model pre-trained using empirical expert knowledge in the traffic prediction domain.
7. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method of using meta-learning to enhance the performance of a traffic prediction algorithm as described in any one of claims 1 to 6 is implemented.
8. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the method of using meta-learning to enhance the performance of a traffic prediction algorithm as described in any one of claims 1 to 6 is implemented.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method of enhancing the performance of a traffic prediction algorithm by using meta-learning as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Meta-learning for multi-task learning for neural networks
CN111328400A
Urban traffic flow prediction method based on deep learning fusion model
CN111861027A