CN110288170B - Prediction model construction method, traffic flow prediction device and electronic equipment - Google Patents

Prediction model construction method, traffic flow prediction device and electronic equipment Download PDF

Info

Publication number
CN110288170B
CN110288170B CN201910690647.4A CN201910690647A CN110288170B CN 110288170 B CN110288170 B CN 110288170B CN 201910690647 A CN201910690647 A CN 201910690647A CN 110288170 B CN110288170 B CN 110288170B
Authority
CN
China
Prior art keywords
road network
data
detected
field
source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910690647.4A
Other languages
Chinese (zh)
Other versions
CN110288170A (en
Inventor
许磊
周渝曦
刘芳岑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing College of Electronic Engineering
Original Assignee
Chongqing College of Electronic Engineering
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing College of Electronic Engineering filed Critical Chongqing College of Electronic Engineering
Priority to CN201910690647.4A priority Critical patent/CN110288170B/en
Publication of CN110288170A publication Critical patent/CN110288170A/en
Application granted granted Critical
Publication of CN110288170B publication Critical patent/CN110288170B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/26Government or public services

Abstract

The embodiment of the invention provides a prediction model construction method, a traffic flow prediction device and electronic equipment, wherein the prediction model construction method comprises the following steps: training a first network based on the road network data to be tested and the source road network data; the method comprises the steps that road network data to be detected represent road network structures of a field to be detected and traffic information of road sections corresponding to the road network structures, and source road network data represent road network structures of a source field and traffic information of the road sections corresponding to the road network structures at a plurality of time nodes; training a second network based on second data features of the source domain; the second data feature represents the characteristic of the road network structure in the source field, and the dimension of the second data feature is consistent with the dimension of the first data feature representing the characteristic of the road network structure in the field to be detected; and taking the output of the first network as the input of the second network to obtain a prediction model of the traffic flow in the field to be measured. The technical effects that the obtained prediction model has the migration characteristic and the prediction cost of the traffic flow is reduced are achieved.

Description

Prediction model construction method, traffic flow prediction device and electronic equipment
Technical Field
The application relates to the field of transportation, in particular to a prediction model construction method, a traffic flow prediction device and electronic equipment.
Background
The prediction of traffic flow, particularly the short-time traffic flow prediction is the basis of urban traffic control and guidance, and the accurate prediction of the congestion condition of road traffic in a short time period (10-30 minutes) has strong practical significance on traffic dispersion. The occurrence process of the traffic flow is influenced by multiple factors including weather conditions, holidays, peak hours of going to and from work, urban large-scale activities, urban road maintenance, traffic accidents and the like, has the characteristics of complexity and uncertainty, and is a technical problem for accurately predicting the traffic flow.
At present, a prediction model trained based on a time sequence is mainly used for predicting traffic flow, but the dependence of the prediction of the traffic flow on a road network is strong, the prediction model has no migration characteristic, namely the prediction model is not suitable for the road network with a new structure, and the traffic flow prediction accuracy of the road network with the new structure is low. For a new road network, a large amount of historical data of the road network is needed to retrain the prediction model, and the cost is high.
Disclosure of Invention
The present invention aims to provide a prediction model construction method, a traffic flow prediction method, a device and an electronic apparatus, which aim to overcome the above disadvantages in the prior art.
In a first aspect, an embodiment of the present invention provides a method for building a prediction model, where the method includes:
training a first network based on the road network data to be tested and the source road network data; the road network data to be detected represents the road network structure of the field to be detected and the traffic information of the road sections corresponding to the road network structure, and the source road network data represents the road network structure of the source field and the traffic information of the road sections corresponding to the road network structure at a plurality of time nodes;
training a second network based on second data features of the source domain; the second data feature represents the characteristic of the road network structure of the source field, and the dimension of the second data feature is consistent with the dimension of the first data feature representing the characteristic of the road network structure of the field to be detected;
and taking the output of the first network as the input of a second network to obtain a prediction model of the traffic flow of the field to be measured.
Optionally, the training of the first network based on the road network data to be tested and the source road network data includes:
inputting the road network data to be detected into a first characteristic network to obtain the characteristics of the road network data to be detected; taking the characteristics of the road network data to be detected as the input of a first loss function, and when the output of the first loss function meets a first preset condition, obtaining first data characteristics based on the characteristics of the road network data to be detected;
inputting the source road network data into a second characteristic network, and obtaining second data characteristics based on the characteristics of the source road network data when the characteristics of the source road network data output by the second characteristic network meet a second set condition;
obtaining a third loss function based on the first loss function, the first data characteristic, and the second data characteristic; and when the third loss function meets a third preset condition, stopping training the first characteristic network based on the road network data to be tested, and taking the first characteristic network as the first network.
Optionally, the obtaining a third loss function based on the first loss function, the first data characteristic, and the second data characteristic includes:
obtaining a maximum mean deviation value of the first data feature and the second data feature;
and obtaining the third loss function according to the maximum mean deviation value and the first loss function.
Optionally, the method further includes:
and training the prediction model based on the road network data to be tested to obtain the trained prediction model.
In a second aspect, an embodiment of the present invention provides a traffic prediction method, where the method includes:
obtaining road network data to be detected in the field to be detected;
and inputting the road network data to be detected into the prediction model, and taking the output of the prediction model as the traffic flow of the road section of the field to be detected in the next time period.
In a third aspect, an embodiment of the present invention provides a prediction model building apparatus, where the apparatus includes:
the first training module is used for training a first network based on the road network data to be tested and the source road network data; the road network data to be detected represents the road network structure of the field to be detected and the traffic information of the road sections corresponding to the road network structure, and the source road network data represents the road network structure of the source field and the traffic information of the road sections corresponding to the road network structure at a plurality of time nodes;
a second training module for training a second network based on second data features of the source domain; the second data feature represents the characteristic of the road network structure of the source field, and the dimension of the second data feature is consistent with the dimension of the first data feature representing the characteristic of the road network structure of the field to be detected;
and the construction module is used for taking the output of the first network as the input of a second network to obtain a prediction model of the traffic flow in the field to be detected.
Optionally, the first training module is further configured to:
inputting the road network data to be detected into a first characteristic network to obtain the characteristics of the road network data to be detected; taking the characteristics of the road network data to be detected as the input of a first loss function, and when the output of the first loss function meets a first preset condition, obtaining first data characteristics based on the characteristics of the road network data to be detected;
inputting the source road network data into a second characteristic network, and obtaining second data characteristics based on the characteristics of the source road network data when the characteristics of the source road network data output by the second characteristic network meet a second set condition;
obtaining a third loss function based on the first loss function, the first data characteristic, and the second data characteristic; and when the third loss function meets a third preset condition, stopping training the first characteristic network based on the road network data to be tested, and taking the first characteristic network as the first network.
In a fourth aspect, an embodiment of the present invention provides a traffic flow prediction apparatus, including:
the acquisition module is used for acquiring road network data to be detected in the field to be detected;
and the prediction module is used for inputting the road network data to be detected into the prediction model and taking the output of the prediction model as the traffic flow of the road section of the field to be detected in the next time period.
In a fifth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program is used for implementing the steps of any one of the above methods when executed by a processor.
In a sixth aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the steps of any one of the methods described above.
Compared with the prior art, the invention has the following beneficial effects:
the embodiment of the invention provides a prediction model construction method, a traffic flow prediction device and electronic equipment, wherein the prediction model construction method comprises the following steps: training a first network based on the road network data to be tested and the source road network data; the method comprises the steps that road network data to be detected represent road network structures of a field to be detected and traffic information of road sections corresponding to the road network structures, and source road network data represent road network structures of a source field and traffic information of the road sections corresponding to the road network structures at a plurality of time nodes; training a second network based on second data features of the source domain; the second data feature represents the characteristic of the road network structure in the source field, and the dimension of the second data feature is consistent with the dimension of the first data feature representing the characteristic of the road network structure in the field to be detected; and taking the output of the first network as the input of the second network to obtain a prediction model of the traffic flow in the field to be measured.
Based on the source road network data in the source field and the first network obtained by training the road network data to be detected in the field to be detected, the first network conforms to the characteristics of the road network structure in the source field and the characteristics of the road network structure in the field to be detected, and the network conforming to the source field is migrated to the first network suitable for the field to be detected. And the second network is used for predicting the traffic flow and is obtained based on the second data characteristic training of the source road network data of the source field, and the second network meets the prediction of the traffic flow of the source field.
Because the dimensionality of the first data feature of the field to be measured is consistent with the dimensionality of the second data feature of the source field, the traffic flow of the field to be measured can be predicted by the second network based on the first data feature, namely, the output of the first network is used as the input of the second network to obtain a prediction model of the traffic flow of the field to be measured, and the second network meets the prediction of the traffic flow of the field to be measured, so that a large number of training samples of the field to be measured are not needed to train the prediction network.
Therefore, the technical problems that in the prior art, the prediction model has strong dependence on a road network, the prediction model has no migration characteristic and low prediction accuracy, and for a new road network, the prediction model needs to be retrained by a large amount of historical data of the road network, and the cost is high are solved, the obtained prediction model has the migration characteristic, the method is suitable for the field to be tested, only a small amount of road network data of the field to be tested is needed, namely the traffic flow of the field to be tested is effectively predicted, the prediction accuracy of the traffic flow is improved, and the prediction cost of the traffic flow is reduced.
Additional features and advantages of embodiments of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a flowchart of a method for constructing a prediction model according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating another method for constructing a prediction model according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating a method for building a prediction model according to another embodiment of the present invention.
Fig. 4 is a schematic diagram illustrating a method for training a first network according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a prediction model according to an embodiment of the present invention.
Fig. 6 shows a flow chart of a traffic prediction method according to an embodiment of the present invention.
Fig. 7 is a schematic block diagram illustrating a prediction model building apparatus 200 according to an embodiment of the present invention.
Fig. 8 is a schematic block diagram illustrating a flow prediction apparatus 300 according to an embodiment of the present invention.
Fig. 9 is a schematic block diagram of an electronic device according to an embodiment of the present invention.
Icon: 200-a prediction model construction device; 210-a first training module; 220-a second training module; 230-a building block; 300-a flow prediction device; 310-an obtaining module; 320-a prediction module; 500-a bus; 501-a receiver; 502-a processor; 503-a transmitter; 504-a memory; 505-bus interface.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The road networks in different regions have the characteristic of complex space, that is, the road networks in different regions are different, and the current traffic flow prediction method needs a large amount of historical data of the road network to train the model to advance for each road network with a specific structure, which is very expensive. For a new network structure, obtaining a large amount of historical data is a difficult problem, the cost is high, even if a large amount of historical data of the field to be tested is obtained, the calculation amount of the training model is large, the cost is high, and the calculation amount is large, the real-time performance is poor, and the traffic flow prediction effect is poor.
In the prior art, the reason that the traffic flow prediction effect is poor is that: firstly, the complex spatial dependence on a road network is strong, the model universality is poor, the current prediction model trained based on a time sequence is only effective for a specific road network structure, does not have the migration characteristic of the model, is applied to new road network characteristics, needs a large amount of historical data to retrain, and is very high in cost. Secondly, the nonlinear time dynamics along with the change of the road condition also influences the traffic flow by various emergencies of different time and places, and the conventional prediction method is difficult to comprehensively consider all factors, so that the result of prediction is incomplete and the accuracy is low. Third, the inherent difficulty of long-term traffic flow prediction.
The application provides a prediction model construction method, a traffic flow prediction device and electronic equipment, which are used for solving the technical problems that in the prior art, the prediction model has strong dependence of traffic flow prediction on a road network, the prediction model has no migration characteristic and low prediction accuracy, and for a new road network, a large amount of historical data of the road network is needed to retrain the prediction model, so that the cost is high.
Examples
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for constructing a prediction model according to an embodiment of the present invention. The prediction model is used for predicting traffic flow. As an alternative embodiment, the prediction model construction method comprises S101-S103 shown in FIG. 1. S101 to S103 are explained below with reference to fig. 1.
S101: and training the first network based on the road network data to be tested and the source road network data.
The road network data to be detected represents the road network structure of the field to be detected and the traffic information of the road sections corresponding to the road network structure, and the source road network data represents the road network structure of the source field and the traffic information of the road sections corresponding to the road network structure at a plurality of time nodes.
S102: training is based on a second network based on second data features of the source domain.
The second data feature represents the characteristic of the road network structure in the source field, and the dimension of the second data feature is consistent with the dimension of the first data feature representing the characteristic of the road network structure in the field to be detected.
S103: and taking the output of the first network as the input of the second network to obtain a prediction model of the traffic flow in the field to be measured.
By adopting the scheme, based on the source road network data in the source field and the first network obtained by training the road network data to be detected in the field to be detected, the first network conforms to the characteristics of the road network structure in the source field and the characteristics of the road network structure in the field to be detected, and the network conforming to the source field is migrated to the first network suitable for the field to be detected. The first network is used for extracting the first data characteristics of the field to be detected, and the mobility of the model extraction characteristics is realized. And the second network is used for predicting the traffic flow and is obtained based on the second data characteristic training of the source road network data of the source field, and the second network meets the prediction of the traffic flow of the source field. Because the dimensionality of the first data feature of the field to be measured is consistent with the dimensionality of the second data feature of the source field, the traffic flow of the field to be measured can be predicted by the second network based on the first data feature, namely, the output of the first network is used as the input of the second network to obtain a prediction model of the traffic flow of the field to be measured, and the second network meets the prediction of the traffic flow of the field to be measured, so that a large number of training samples of the field to be measured are not needed to train the prediction network. Therefore, the technical problems that in the prior art, the prediction model has strong dependence on a road network, the prediction model has no migration characteristic and low prediction accuracy, and a large amount of historical data of the road network is needed to retrain the prediction model for a new road network, and the cost is high are solved.
If the first network for extracting the data features of the field to be detected is obtained only by depending on the road network data training of the field to be detected, the first network has the following defects: firstly, the training data is less, the training samples are insufficient, and the accuracy of extracting the data characteristics of the field to be tested by the trained first network is low. Secondly, a large number of training samples are obtained, so that the cost is high, and meanwhile, the number of training samples is large, the calculation amount is large, and the cost is high.
In a field (referred to as a source field) in which a traffic flow prediction with high accuracy has been obtained, there is enough training sample data (historical road network data, referred to as source road network data) in the field, and in order to reduce the traffic flow prediction cost in a new field (a field to be measured), a traffic flow prediction model in the field to be measured may be trained depending on the road network data in the source field. However, since different road networks have different road network characteristics, a prediction model trained only by using road network data in the source domain has low prediction accuracy for the traffic flow in the area to be measured in the new road network structure different from the road network structure in the source domain, that is, the prediction model has no migration characteristics.
In order to solve the above problem, the first network is trained based on the source road network data and a small amount of road network data to be measured (road network data in the field to be measured), and the obtained first network combines the characteristics of the road network structure in the source field and the characteristics of the field to be measured, so that the network suitable for the source field has migration characteristics and is suitable for the field to be measured.
As an optional implementation manner, a manner of training the first network based on the road network data to be tested and the source road network data to obtain the first network with the migration characteristic may specifically refer to S101-1 to S101-4 in fig. 2, and the explanation of S101-1 to S101-4 in combination with fig. 2 is as follows:
s101-1: inputting the road network data to be tested into a first characteristic network to obtain the characteristics of the road network data to be tested; and taking the characteristics of the road network data to be detected as the input of a first loss function, and obtaining first data characteristics based on the characteristics of the road network data to be detected when the output of the first loss function meets a first preset condition.
S101-2: and inputting the source road network data into a second characteristic network, and acquiring second data characteristics based on the characteristics of the source road network data when the characteristics of the source road network data output by the second characteristic network meet a second set condition.
S101-3: a third loss function is obtained based on the first loss function, the first data characteristic, and the second data characteristic.
S101-4: and when the third loss function meets a third preset condition, stopping the first characteristic network based on the road network data to be detected, and taking the first characteristic network as the first network.
The execution sequence of S101-1 and S101-2 is not limited, S101-1 may be executed first and S101-2 may be executed, or S101-1 and S101-2 may be executed simultaneously. Namely, the road network data to be tested is input into the first characteristic network and the source road network data is input into the second characteristic network at the same time, namely, the first characteristic network and the second characteristic network are trained at the same time.
Wherein, S101-2 may specifically be: inputting the source road network data into a second characteristic network to obtain the characteristics of the source road network data; and taking the characteristics of the source road network data as the input of a second loss function, and obtaining second data characteristics based on the characteristics of the source road network data when the output of the second loss function meets a second preset condition.
The first preset condition may be that the first loss function converges or an output of the first loss function is smaller than a first set threshold. The second preset condition may be that the second loss function converges or an output of the second loss function is smaller than a second set threshold. The third preset condition may be that the third loss function converges or an output of the third loss function is smaller than a third set threshold. The first set threshold, the second set threshold and the third set threshold may be equal or different. The first feature network and the second feature network may be identical networks.
In order to make the first network have the migration characteristic, the loss function for training the first network needs to be adjusted, as described in S101-3, a specific implementation manner of S101-3 may be: obtaining a maximum mean deviation value of the first data characteristic and the second data characteristic; and obtaining a third loss function according to the maximum mean deviation value and the first loss function. The specific calculation method is as shown in the following formula (1) and formula (2):
Figure BDA0002147767270000101
wherein, FsiRoad network structure for representing source domainOf ith second data feature, FtjJ-th first data feature of the road network structure representing the field to be measured, M represents the number of second data features of the road network structure of the source field, N represents the number of first data features of the road network structure of the field to be measured, LossMMDThe maximum mean deviation value is indicated.
Loss=LossMMD+μ*Lossorg(2)
Therein, LossorgDenotes the first Loss function, μ denotes the influence factor, and Loss denotes the third Loss function.
Specifically, the alignment processing is performed on the characteristics (road network structure) of the road network data to be detected, and the characteristics of the road network data to be detected after the alignment processing are used as the first data characteristics. And acquiring second data characteristics based on the characteristics of the source road network data, specifically, performing alignment processing on the characteristics of the source road network data, and taking the characteristics of the source road network data after the alignment processing as the second data characteristics. The dimensions of the first data feature and the second data feature after the alignment processing are consistent.
By adopting the scheme, the third loss function is obtained based on the second data characteristic of the source field, the first characteristic of the field to be detected and the first loss function, the first characteristic network is trained based on the third loss function and the road network data to be detected, the trained first characteristic network is influenced by the source road network data of the source field, meanwhile, the method is suitable for characteristic extraction of the road network data to be detected, has the migration characteristic, and is high in accuracy of characteristic extraction. The first characteristic network applicable to the field to be detected can be obtained without a large amount of road network data to be detected in the field to be detected, so that the cost is reduced, and the cost is reduced.
In order to improve the effectiveness and accuracy of the first network, after the first network is obtained, the method for constructing the prediction model further includes: and finely adjusting (fine-tuning) the prediction model based on the road network data to be measured. The accuracy of the traffic flow output by the prediction model after fine-tuning (fine-tuning) is high. Specifically, the fine tuning mode is a fine-tuning mode, the prediction model is trained based on road network data to be tested, and the trained prediction model is obtained, specifically: and inputting the road network data to be tested into the prediction model as training data, modifying parameters of the prediction model, training the prediction model, and stopping training the prediction model when the output of the prediction model meets a fourth preset condition to obtain the trained prediction model. The prediction model is trained by the road network data to be tested in the field to be tested, so that the prediction model is suitable for the field to be tested, and the accuracy of the prediction model for predicting the traffic flow in the field to be tested is improved.
In an embodiment of the present invention, when the first feature Network and the second feature Network are the same, the first feature Network and the second feature Network may include a Graph Convolutional neural Network (GCN) and a fully connected adaptation Network (FC-ADAPT). And taking the output of the graph convolution neural network as the input of the adaptation network to obtain a first characteristic network and a second characteristic network. The graph convolution neural network is used for extracting the characteristics of the road network data to be detected and the characteristics of the source road network data, the adaptive network is used for aligning the characteristics of the road network data to be detected and the characteristics of the source road network data, and the dimensions of the aligned characteristics of the road network data to be detected and the aligned characteristics of the source road network data are the same.
As an alternative embodiment, the second network includes a Long Short-term memory network (LSTM) and a fully connected network (FC). And (4) taking the output of the neural network as the input of the fully-connected network by long-time memory to obtain a second network. The long-time and short-time memory neural network is used for predicting the traffic flow of the area corresponding to the data characteristic based on the data characteristic (the first data characteristic or the second data characteristic) output by the adaptive network, and the fully-connected network is used for outputting the traffic flow.
For clarity of explanation of the predictive network of the present application, the first feature network comprises GCN-T and FC-ADAPT-T and the second feature network comprises GCN-S and FC-ADAPT-S, as an example. The second network includes LSTM and FC. Namely, the prediction model comprises trained GCN-T, FC-ADAPT-T, LSTM and FC, namely, the output of the trained GCN-T is used as the input of the trained FC-ADAPT-T, the output of the trained FC-ADAPT-T is used as the input of the trained LSTM, and the output of the trained LSTM is used as the input of the FC.
Based on the above embodiments, please refer to fig. 3, fig. 4 and fig. 5 in combination as an example, and fig. 3 shows S301 to S305 included in a prediction model construction method.
S301: inputting the road network data to be detected into GCN-T, outputting the characteristics of the road network data to be detected by GCN-T, and aligning the characteristics of the road network data to be detected by FC-ADAPT-T when the first loss function outputs a first preset condition aiming at the characteristics of the road network data to be detected, so as to obtain first data characteristics.
S302: and inputting source road network data into GCN-S, outputting the characteristics of the source road network data by the GCN-S, and aligning the characteristics of the source road network data by the FC-ADAPT-S when the output of the second loss function aiming at the characteristics input as the source road network data meets a second preset condition to obtain second data characteristics.
As an alternative embodiment, the second data feature includes speed information of a plurality of road segments at a plurality of time nodes in the road network structure of the source domain, and each road segment corresponds to a plurality of speed information, that is, each road segment corresponds to a plurality of speed information of a plurality of time nodes. The first data characteristic may be speed information of a plurality of road segments in the road network structure to be tested at one or more time nodes, that is, each road segment may have only one speed information (of one time node). The dimension of the second data feature is consistent with the dimension of the first data feature, and the dimension of the second data feature may be the alignment of the road network structures of the first data feature and the second data feature.
S303: and inputting the second data characteristic into the LSTM, stopping training the LSTM when the prediction result output by the LSTM meets a fourth preset condition, and outputting the prediction result output by the FC in a full-connection mode.
Wherein the prediction result output by the LSTM represents the traffic flow of the predicted source field.
S304, the output of the GCN-T after training is used as the input of the FC-ADAPT-T after training, the output of the FC-ADAPT-T after training is used as the input of the LSTM after training, and the output of the LSTM after training is used as the input of the FC.
That is, the traffic flow of the area to be measured is predicted based on the first data feature by the trained LSTM trained based on the second data feature, and the result of the predicted traffic flow is output by the FC.
S305: and training the prediction model comprising the trained GCN-T, GCN-S, FC-ADAPT-T, LSTM and FC to obtain the trained prediction model.
Here, the execution order of S301, S302, and S303 is not limited, and S302 may be executed simultaneously before S303. Namely, the road network data to be detected is input into GCN-T and the source road network data is input into GCN-S at the same time.
Wherein, in FIGS. 4 and 5, vsiWhere i is 0, 2, … …, n +1 represents the source road network data at the ith time point, and n is the total number of time nodes. Specifically, the speed at the ith time point vt in the road network structure in the source domain may bejJ is 0, 2, … …, and n +1 represents the road network data to be measured at the jth time, and may be the speed at the jth time in the road network structure of the field to be measured. Ft is the first data characteristic, and Fs is the second data characteristic.
By adopting the scheme, the road network data to be detected is input into the GCN-T, the GCN-T outputs the characteristics of the road network data to be detected, and when a first loss function obtained based on the characteristics of the road network data to be detected meets a first preset condition, the characteristics of the road network data to be detected are aligned through the FC-ADAPT-T to obtain first data characteristics. Inputting source road network data into GCN-S, outputting the characteristics of the source road network data by the GCN-S, and aligning the characteristics of the source road network data through FC-ADAPT-S to obtain second data characteristics when a second loss function obtained based on the characteristics of the source road network data meets a second preset condition. And inputting the second data characteristic into the LSTM, stopping training the LSTM when the prediction result output by the LSTM meets a fourth preset condition, and outputting the prediction result output by the FC in a full-connection mode. And predicting the traffic flow of the field to be measured based on the first data characteristic through the trained LSTM trained based on the second data characteristic, and outputting the result of the predicted traffic flow through the FC. And fine-tuning the prediction model after training to obtain the prediction model after fine tuning. Firstly, the finely adjusted prediction model can accurately predict the traffic flow of each road section in the field to be measured. Secondly, a large amount of training data in the field to be tested is not needed, so that the cost of a training model is reduced, the cost is reduced, and the real-time property of traffic flow prediction is improved. Thirdly, a prediction model is obtained based on the source road network data and the road network data to be tested, and the prediction model can be self-adaptive to traffic data distribution under various influence factors, so that the predicted traffic flow precision is high.
Based on the prediction model for predicting the traffic flow proposed in the above embodiment, in the embodiment of the present invention, a flow prediction method based on the prediction model is proposed. Please refer to S401 and S402 included in fig. 6.
S401: and obtaining road network data to be detected in the field to be detected.
S402: and inputting the road network data to be measured into the prediction model, and taking the output of the prediction model as the traffic flow of the road section of the field to be measured in the next time period.
Preferably, the road network data to be measured is input into the prediction model after fine adjustment, so as to obtain more accurate traffic flow of the road section in the field to be measured in the next time period.
Wherein the length of the next short time may be in a time range of 10-30 minutes from the start of this time.
For step S401, the road network data to be detected in the field to be detected may obtain real-time positions (including time and position information) of the vehicles by collecting vehicle RFID data, taxi real-time GPS information, and bus GPS information of the road gate in the field to be detected, and then calculate the average speed of the road segment where the vehicles are located. And combining the average speed of each road section with the road network structure of the pre-constructed region to be detected to obtain road network data to be detected.
For the method of obtaining the average speed of the road section where the vehicle is located, a GPS vehicle speed calculation method, a floating car (taxi, bus) Radio Frequency Identification (RFID) data fusion speed calculation method, and the like can be adopted, and for the characteristic of large fluctuation of the travel time of the floating car, the travel time of the floating car is fitted and smoothed (here, an exponential smoothing method is adopted) by using the travel time of the section provided by the RFID, and then the travel time is segmented to each road section, so that abnormal fluctuation of the data of the floating car is solved, and more stable speed information is obtained.
The traffic flow includes vehicle flow speed of the road section. The flow prediction method further comprises the following steps: and obtaining road condition information according to the vehicle flow speed of the road section and the historical congestion record, and forming a historical road condition table according to the road condition information, wherein the historical road condition table comprises the vehicle flow speed of the road section and the historical congestion record.
In the embodiment of the present invention, the acquisition mode of the source road network data in the source field in the prediction model construction method may be implementation acquisition, or may be acquired from a training database. The source road network data includes a road network structure of a source domain, and speed information of each road segment at a plurality of time nodes. The speed information may be acquired in the same manner as the average speed in the source road network data.
The embodiment of the present application further provides an execution subject for executing the above steps, and the execution subject may be the prediction model building apparatus 200 in fig. 7. Referring to fig. 7, the prediction model constructing apparatus includes:
a first training module 210, configured to train a first network based on the road network data to be tested and the source road network data; the road network data to be detected represents the road network structure of the field to be detected and the traffic information of the road sections corresponding to the road network structure, and the source road network data represents the road network structure of the source field and the traffic information of the road sections corresponding to the road network structure at a plurality of time nodes.
A second training module 220 for training a second network based on second data features of the source domain; the second data features represent the characteristics of the road network structure of the source field, and the dimensions of the second data features are consistent with the dimensions of the first data features representing the characteristics of the road network structure of the field to be tested.
And the building module 230 is configured to obtain a prediction model of the traffic flow in the field to be measured by using the output of the first network as the input of the second network.
Optionally, the first training module 210 is further configured to: inputting the road network data to be detected into a first characteristic network to obtain the characteristics of the road network data to be detected; taking the characteristics of the road network data to be detected as the input of a first loss function, and when the output of the first loss function meets a first preset condition, obtaining first data characteristics based on the characteristics of the road network data to be detected; inputting the source road network data into a second characteristic network, and obtaining second data characteristics based on the characteristics of the source road network data when the characteristics of the source road network data output by the second characteristic network meet a second set condition; obtaining a third loss function based on the first loss function, the first data characteristic, and the second data characteristic; and when the third loss function meets a third preset condition, stopping training the first characteristic network based on the road network data to be tested, and taking the first characteristic network as the first network.
Optionally, the first training module 210 is further specifically configured to: obtaining a maximum mean deviation value of the first data feature and the second data feature; and obtaining the third loss function according to the maximum mean deviation value and the first loss function.
Optionally, the prediction model building apparatus 200 further includes:
and the fine tuning module is used for training the prediction model based on the road network data to be tested to obtain the trained prediction model.
The embodiment of the present application further provides an execution main body for executing the above steps, and the execution main body may be the flow rate prediction apparatus 300 in fig. 8. Referring to fig. 8, the traffic prediction apparatus includes:
an obtaining module 310 is configured to obtain road network data to be tested in a field to be tested.
The prediction module 320 is configured to input the road network data to be measured into any one of the prediction models, and use the output of the prediction model as the traffic flow of the road segment in the field to be measured in the next time period.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present invention further provides an electronic device, as shown in fig. 9, which includes a memory 504, a processor 502, and a computer program stored on the memory 504 and executable on the processor 502, where when the processor 502 executes the program, the steps of any one of the foregoing traffic prediction method and/or prediction model building method are implemented.
Where in fig. 9 a bus architecture (represented by bus 500) is shown, bus 500 may include any number of interconnected buses and bridges, and bus 500 links together various circuits including one or more processors, represented by processor 502, and memory, represented by memory 504. The bus 500 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 505 provides an interface between the bus 500 and the receiver 501 and transmitter 503. The receiver 501 and the transmitter 503 may be the same element, i.e. a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 502 is responsible for managing the bus 500 and general processing, and the memory 504 may be used for storing data used by the processor 502 in performing operations.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any one of the foregoing traffic prediction method and/or prediction model building method.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an apparatus according to an embodiment of the invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.

Claims (7)

1. A method of constructing a predictive model, the method comprising:
training a first network based on the road network data to be tested and the source road network data; the road network data to be detected represents a road network structure of a field to be detected and flow information of road sections corresponding to the road network structure, and the source road network data represents the road network structure of a source field and the flow information of the road sections corresponding to the road network structure at a plurality of time nodes; the source field is an area with a specific road network structure, and the field to be detected is an area with a new road network structure different from the road network structure of the source field; the training of the first network based on the road network data to be tested and the source road network data specifically comprises the following steps:
inputting the road network data to be detected into a first characteristic network to obtain the characteristics of the road network data to be detected; taking the characteristics of the road network data to be detected as the input of a first loss function, and when the output of the first loss function meets a first preset condition, obtaining first data characteristics based on the characteristics of the road network data to be detected;
inputting the source road network data into a second characteristic network, and obtaining second data characteristics based on the characteristics of the source road network data when the characteristics of the source road network data output by the second characteristic network meet a second set condition;
obtaining a third loss function based on the first loss function, the first data characteristic, and the second data characteristic; when the third loss function meets a third preset condition, stopping training the first characteristic network based on the road network data to be tested, and taking the first characteristic network as the first network;
the obtaining a third loss function based on the first loss function, the first data characteristic, and the second data characteristic comprises:
obtaining a maximum mean deviation value of the first data feature and the second data feature;
obtaining the third loss function according to the maximum mean deviation value and the first loss function;
training a second network based on second data features of the source domain; the second data feature represents the characteristic of the road network structure of the source field, and the dimension of the second data feature is consistent with the dimension of the first data feature representing the characteristic of the road network structure of the field to be detected;
and taking the output of the first network as the input of a second network to obtain a prediction model of the traffic flow of the field to be measured.
2. The method of claim 1, further comprising:
and training the prediction model based on the road network data to be tested to obtain the trained prediction model.
3. A method of traffic prediction, the method comprising:
obtaining road network data to be detected in the field to be detected; the field to be detected is an area with a new road network structure different from the road network structure of a source field, and the source field is an area with a specific road network structure;
inputting the road network data to be tested into the prediction model of any one of claims 1-2, and using the output of the prediction model as the traffic flow of the road section of the field to be tested in the next time period.
4. A prediction model construction apparatus, characterized in that the apparatus comprises:
the first training module is used for training a first network based on the road network data to be tested and the source road network data; the road network data to be detected represents a road network structure of a field to be detected and flow information of road sections corresponding to the road network structure, and the source road network data represents the road network structure of a source field and the flow information of the road sections corresponding to the road network structure at a plurality of time nodes; the source field is an area with a specific road network structure, and the field to be detected is an area with a new road network structure different from the road network structure of the source field; the first training module is further to:
inputting the road network data to be detected into a first characteristic network to obtain the characteristics of the road network data to be detected; taking the characteristics of the road network data to be detected as the input of a first loss function, and when the output of the first loss function meets a first preset condition, obtaining first data characteristics based on the characteristics of the road network data to be detected;
inputting the source road network data into a second characteristic network, and obtaining second data characteristics based on the characteristics of the source road network data when the characteristics of the source road network data output by the second characteristic network meet a second set condition;
obtaining a third loss function based on the first loss function, the first data characteristic, and the second data characteristic; when the third loss function meets a third preset condition, stopping training the first characteristic network based on the road network data to be tested, and taking the first characteristic network as the first network;
the obtaining a third loss function based on the first loss function, the first data characteristic, and the second data characteristic comprises:
obtaining a maximum mean deviation value of the first data feature and the second data feature;
obtaining the third loss function according to the maximum mean deviation value and the first loss function;
a second training module for training a second network based on second data features of the source domain; the second data feature represents the characteristic of the road network structure of the source field, and the dimension of the second data feature is consistent with the dimension of the first data feature representing the characteristic of the road network structure of the field to be detected;
and the construction module is used for taking the output of the first network as the input of a second network to obtain a prediction model of the traffic flow in the field to be detected.
5. A traffic flow prediction apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring road network data to be detected in the field to be detected; the field to be detected is an area with a new road network structure different from the road network structure of a source field, and the source field is an area with a specific road network structure;
a prediction module, configured to input the road network data to be tested into the prediction model according to any one of claims 1-2, and use the output of the prediction model as the traffic flow of the road segment in the field to be tested in the next time period.
6. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of claims 1-3 when executing the program.
CN201910690647.4A 2019-07-29 2019-07-29 Prediction model construction method, traffic flow prediction device and electronic equipment Active CN110288170B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910690647.4A CN110288170B (en) 2019-07-29 2019-07-29 Prediction model construction method, traffic flow prediction device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910690647.4A CN110288170B (en) 2019-07-29 2019-07-29 Prediction model construction method, traffic flow prediction device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110288170A CN110288170A (en) 2019-09-27
CN110288170B true CN110288170B (en) 2020-04-14

Family

ID=68024147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910690647.4A Active CN110288170B (en) 2019-07-29 2019-07-29 Prediction model construction method, traffic flow prediction device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110288170B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110956808B (en) * 2019-12-23 2020-11-24 北京交通大学 Heavy truck traffic flow prediction method based on non-full-sample positioning data
CN111145289A (en) * 2019-12-30 2020-05-12 北京爱康宜诚医疗器材有限公司 Extraction method and device of pelvis three-dimensional data
CN113496305A (en) * 2020-04-03 2021-10-12 浙江大学 Data processing method and device
CN113256985B (en) * 2021-06-28 2021-09-17 智道网联科技(北京)有限公司 Traffic congestion prediction method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107967532A (en) * 2017-10-30 2018-04-27 厦门大学 The Forecast of Urban Traffic Flow Forecasting Methodology of integration region vigor
CN109740785A (en) * 2018-10-22 2019-05-10 北京师范大学 The method of node state prediction based on figure convolutional neural networks
CN109887282A (en) * 2019-03-05 2019-06-14 中南大学 A kind of road network traffic flow prediction technique based on level timing diagram convolutional network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107967532A (en) * 2017-10-30 2018-04-27 厦门大学 The Forecast of Urban Traffic Flow Forecasting Methodology of integration region vigor
CN109740785A (en) * 2018-10-22 2019-05-10 北京师范大学 The method of node state prediction based on figure convolutional neural networks
CN109887282A (en) * 2019-03-05 2019-06-14 中南大学 A kind of road network traffic flow prediction technique based on level timing diagram convolutional network

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Using LSTM and GRU Neural Network Methods for Traffic Flow Prediction;Rui Fu 等;《31st Youth Academic Annual Conference of Chinese Association of Automation》;20161113;全文 *
基于深度学习的交通流量预测研究;邓烜堃 等;《计算机工程与应用》;20190131;第55卷(第2期);全文 *
基于深度学习的短时交通流量预测;乔松林 等;《青岛大学学报(自然科学版)》;20171130;第30卷(第4期);全文 *

Also Published As

Publication number Publication date
CN110288170A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
CN110288170B (en) Prediction model construction method, traffic flow prediction device and electronic equipment
US9159032B1 (en) Predicting arrival times of vehicles based upon observed schedule adherence
Yu et al. Hybrid model for prediction of bus arrival times at next station
DE102017108447A1 (en) Vehicle mode planning with learned user preferences
US10826808B2 (en) Vehicle application enabling and network routing systems implemented based on latency characterization and projection
CN103440422A (en) Bus behind-schedule recovering method based on arrival time predication with time window
DE102019205821A1 (en) ESTABLISHMENT AND PROCEDURE FOR TRAFFIC INFORMATION SERVICE
Chen et al. Position computation models for high-speed train based on support vector machine approach
DE102019135333A1 (en) SYSTEMS AND METHODS FOR DISPOSING AND ROUTE PLANNING OF VEHICLES
CN110288826B (en) Traffic control subregion clustering division method based on multi-source data fusion and MILP
DE102020124693A1 (en) Adaptive forecasting systems and forecasting methods for vehicles
Emami et al. A neural network algorithm for queue length estimation based on the concept of k-leader connected vehicles
US20150106171A1 (en) Dynamic pricing based on sliding mode control and estimation for high occupancy toll lanes
DE102018221023A1 (en) VEHICLE AND METHOD FOR PROVIDING ROUTE GUIDANCE USING PUBLIC TRANSPORT
DE102018125621A1 (en) Method for supporting a driving operation of a motor vehicle and for operating a motor vehicle, motor vehicle and server device
CN111667689B (en) Method, device and computer device for predicting vehicle travel time
CN108334079A (en) Pilotless automobile method for obtaining road condition information in real time
EP4171080A1 (en) Intelligent messaging framework for vehicle ecosystem communication
CN116278780A (en) Automobile braking speed planning method and electronic equipment
CN115762137A (en) Traffic situation prediction system
Fanani et al. Bus Arrival Prediction-to Ensure Users not to Miss the Bus
Wang et al. An approach to bus travel time prediction based on the adaptive fading Kalman filter algorithm
DE102019213562A1 (en) Method for calculating a function for a vehicle
Yamada et al. Applying portfolio theory to prediction correction of train arrival times
CN114863688B (en) Intelligent positioning method and system for muck vehicle based on unmanned aerial vehicle

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant