Traffic situation prediction method and device
The method improves traffic prediction model adaptability by dynamically adjusting network weights to regional characteristics using a multi-layer neural network structure, ensuring better regional fit and accuracy.
Patent Information
- Application Number
- CN202211411356.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-11-11
AI Technical Summary
Existing traffic situation prediction models exhibit poor adaptability to regional characteristics due to varying network structure and hyperparameters in different regions, such as urban and suburban areas.
A traffic situation prediction method using a first neural network model composed of n parent neural networks, each with k child neural networks, where the second parent neural network has two types of network weights, dynamically adjusted to adapt to regional characteristics by training two sets of weights in one iteration, retaining only the top k components for better regional fit.
The method enhances model adaptability to regional characteristics by optimizing network weights based on local data, resulting in a more accurate and region-specific traffic prediction.
Smart Images

Figure CN115762151B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent traffic engineering, and in particular to a traffic situation prediction method and device. Background Art
[0002] With the rapid development of artificial intelligence, deep learning is a commonly used method for traffic situation prediction. In the context of large amounts of traffic data and sufficient computing resources, neural networks are usually used as the basic structure of traffic situation prediction models to improve the effectiveness of the models.
[0003] The existing traffic situation prediction methods require artificial design of the organizational structure, number of layers, and number of trainable parameters of the neural network after experts evaluate the designated traffic area. This method has certain feasibility, but due to the large number of regional characteristics of traffic data in the traffic system, there are many ways to choose the network structure organization, and in different regions, such as urban and suburban areas, the characteristics of traffic data vary greatly, resulting in large differences in the optimal network structure. Even in the same model, the network hyperparameters in different regions may also vary greatly. Models constructed solely based on manual experience have the problem of poor adaptability to regional characteristics.
[0004] Based on this, there is an urgent need for a traffic situation prediction method to solve the problem of poor adaptability of models in existing technologies to regional characteristics. Summary of the invention
[0005] The purpose of the present invention is to provide a traffic situation prediction method and device to solve the technical problem that the model in the prior art has poor adaptability to regional characteristics.
[0006] The specific technical solution for achieving the purpose of the present invention is:
[0007] A traffic situation prediction method, the method comprising:
[0008] Acquire a first traffic flow, where the first traffic flow is a traffic flow measured in a first time period;
[0009] Obtaining a prediction result of a traffic situation according to the first traffic flow and a first neural network model, wherein the first neural network model is obtained by training based on a second neural network and a traffic data set, the input of the first neural network model is the first traffic flow, and the output of the first neural network model is the prediction result of the traffic situation;
[0010] The first neural network model includes n parent neural networks, and the second neural network model includes n parent neural networks, where n is a positive integer; wherein the first parent neural network in the first neural network model includes k first child neural networks, and the second parent neural network in the second neural network model includes m second child neural networks, where m and k are positive integers; the second parent neural network includes two types of network weights, namely: a network weight vector α with a dimension of m, and the network weights of the m second child neural networks themselves; the i-th component α in the network weight vector α i Corresponding to the i-th second sub-neural network, i is a positive integer; the k first sub-neural networks are obtained according to the second sub-neural networks corresponding to the largest first k components in the network weight vector α.
[0011] Optionally, k is smaller than m.
[0012] Optionally, the prediction result of the traffic situation includes a second traffic flow and situation classification information, the second traffic flow is the traffic flow in a second time period to be predicted, and the situation classification information represents the congestion level of the second traffic flow.
[0013] Optionally, the output result of the second parent neural network is obtained according to the output results of the m second child neural networks according to the following formula:
[0014]
[0015]
[0016] Among them, x represents the input value of the second parent neural network, o(x) represents the output value of the second parent neural network, and α i represents the weight value of the i-th second child neural network in the second parent neural network, Z i (x) represents the output value of the second neural network of the ith sub-network; Softmax(α i ) represents the probability value that the i-th second sub-neural network is the optimal network, which is used to determine the output value Z of the i-th second sub-neural network i (x) is the percentage of the output value of the second parent neural network.
[0017] Optionally, the network weight vector α is obtained through training.
[0018] An embodiment of the present invention provides a device, comprising:
[0019] The acquisition unit is used to acquire a first traffic flow, where the first traffic flow is a traffic flow measured in a first time period.
[0020] The processing unit is used to obtain a first neural network model, where the first neural network model is trained based on the second neural network and the traffic data set.
[0021] The first neural network model includes n parent neural networks, and the second neural network model includes n parent neural networks, where n is a positive integer; wherein the first parent neural network in the first neural network model includes k first child neural networks, and the second parent neural network in the second neural network model includes m second child neural networks, where m and k are positive integers; the weights of the m second child neural networks themselves form a network weight set w2; the second parent neural network includes a network weight vector α with a dimension of m, and the i-th component α in the network weight vector α i Corresponding to the i-th second sub-neural network, i is a positive integer; the k first sub-neural networks are obtained according to the second sub-neural networks corresponding to the largest first k components in the network weight vector α.
[0022] The prediction unit is used to output the prediction result of the traffic situation, and its input is the first traffic flow.
[0023] Optionally, for the processing unit, k is smaller than m.
[0024] Optionally, the processing unit is specifically configured to:
[0025] The output result of the second parent neural network is calculated according to the output results of the m second sub-neural networks according to the following formula.
[0026]
[0027]
[0028] Optionally, the processing unit is specifically used to: train the network weight vector α.
[0029] Optionally, the prediction unit, the prediction result of the traffic situation includes a second traffic flow and situation classification information, the second traffic flow is the traffic flow in a second time period to be predicted, and the situation classification information represents the congestion level of the second traffic flow.
[0030] In the present invention, the first neural network model is obtained by training the second neural network and the traffic data set. In the existing neural network training technology, only one set of network weights needs to be trained in one iteration, while in the present invention, two sets of network weights of the second parent neural network need to be alternately trained in one iteration, namely the weight α of the second parent neural network and the weights of the m second child neural networks, where the weight α is used to determine the output proportion of each second child neural network. For the data set of any region, the training optimizer will dynamically adjust the value in the α vector by learning the regional characteristics in the data set, so that the weight component α corresponding to the second child neural network that is more suitable for the characteristics of the region is i The larger it is, the larger the corresponding output proportion is; further, after training the second parent neural network, only the largest k components in the second parent neural network vector α and the corresponding second child neural network are retained, and the rest are deleted to obtain the first neural network model, which is obtained by training the second neural network and the given regional data set; if the second neural network is trained using a data set from another region, another first neural network model that is more suitable for the region will be obtained, thereby achieving the effect of adapting measures to local conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a flow chart corresponding to a traffic situation prediction method provided in an embodiment of the present invention;
[0032] Figure 2 A schematic diagram of a system architecture applicable to an embodiment of the present invention;
[0033] Figure 3 is a schematic diagram of a second neural network structure applicable to an embodiment of the present invention;
[0034] Figure 4 is a schematic diagram of a first neural network model structure applicable to an embodiment of the present invention;
[0035] Figure 5 is a schematic diagram of a second parent neural network structure applicable to an embodiment of the present invention;
[0036] Figure 6 A schematic diagram of a process flow corresponding to training a second parent neural network provided by an embodiment of the present invention;
[0037] Figure 7 A schematic diagram of the structure of a device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] See also Figure 1 As shown, an embodiment of the present invention provides a flow chart of a traffic situation prediction method, and the specific implementation method includes:
[0040] Step S101, obtaining a first neural network model by training a second neural network and a traffic data set.
[0041] Step S102: acquiring a first traffic flow, where the first traffic flow is a traffic flow measured in a first time period.
[0042] Step S103, input the first traffic flow into the first neural network model, and output the prediction result of the traffic situation.
[0043] The above traffic situation prediction method can be applied to, but is not limited to, Figure 2 In the system architecture shown, the system architecture includes a region A data set 201, a region B data set 202, a training server 203, a region A traffic collection device 204, a prediction server 205, a region A model 2051, a region B model 2052, a region B traffic collection device 206, and a display device 207.
[0044] In an embodiment of the present invention, the A region data set 201 can obtain the A region model 2051 after training on the training server 203. The B region data set 202 can obtain the B region model 2052 after training on the training server 203. In some embodiments, the traffic data obtained by the A region traffic collection device 204 can be input into the A region model 2051 to obtain the predicted result of the traffic situation and display it on the display device. The traffic data obtained by the B region traffic collection device 206 can be input into the A region model 2052 to obtain the predicted result of the traffic situation and display it on the display device.
[0045] It should be noted that in the embodiments of the present invention, Figure 2The two regions A and B are only an example, and there is no limit to the number of regions. Those skilled in the art can set the number of regions according to actual conditions. The regional traffic data set may include but is not limited to at least one of the following: a network public data set, a data set obtained by a regional traffic collection device. The regional traffic collection device may include but is not limited to at least one of the following: a piezoelectric sensor, a ground induction coil sensor, an infrared sensor, an ultrasonic detection device, a video device, and a portable GPS positioning device. The A region model 2051 and the B region model 2052 can be file-format products of the first neural network model obtained by the second neural network, and the file can be deployed on the prediction server without the training service.
[0046] Optionally, step 101 may be: obtain a first neural network model by training a second neural network and a traffic data set, wherein the first neural network model includes n parent neural networks, and the second neural network model includes n parent neural networks, where n is a positive integer; wherein the first parent neural network in the first neural network model includes k first child neural networks, and the second parent neural network in the second neural network model includes m second child neural networks, where m and k are positive integers; and the second parent neural network includes two types of network weights, namely: a network weight vector α with a dimension of m, and the network weights of the m second child neural networks themselves. The i-th component α in the network weight vector α i Corresponding to the i-th second sub-neural network, i is a positive integer; the k first sub-neural networks are obtained according to the second sub-neural networks corresponding to the largest first k components in the network weight vector α.
[0047] Optionally, in order to explain the relationship between the above networks more clearly, Figure 3 This is an example of an architecture of the second neural network in the training server 203. The second neural network 301 includes second parent neural networks 302 and 305; the second parent neural network 302 includes second child neural networks 303 and 304, and the second parent neural network 305 includes second child neural networks 306 and 307; the second parent neural network 302 includes network weights: w1, w2, α1, α2, and the second parent neural network 305 includes weights: w3, w4, α3, α4;
[0048] Optionally, in order to explain the relationship between the above networks more clearly, Figure 4This is an example of an architecture of the first neural network model in the training server 203. The first neural network model 401 is obtained by training the second neural network 301; the first neural network model 401 includes first parent neural networks 402 and 404; the first parent neural network 402 includes a first child neural network 403, and the first parent neural network 404 includes a first child neural network 405; the first parent neural network 402 includes network weights: w6, α1, and the first parent neural network 404 includes network weights: w7, α4;
[0049] Optionally, in order to explain more clearly the output calculation method of the second parent neural network, as Figure 5 As shown, an example of the architecture of the second parent neural network, the number of second child neural networks m=2, the second child neural network 5011 is composed of 5x5 convolution and ReLU activation function, the second child neural network 5012 is composed of 3x3 convolution and ReLu activation function, and the output of the second parent neural network 501 is obtained by the second child neural network 5011 and the second child neural network 5012.
[0050] Optionally, if n>1 is set, those skilled in the art may connect multiple second parent neural networks according to the situation, and all implementation methods are the same as when n=1, which will not be repeated here.
[0051] Optionally, in order to enable the m second sub-neural networks to be fused together for forward propagation, the output result of the second parent neural network is calculated according to the output results of the m second sub-neural networks according to the following formula.
[0052]
[0053]
[0054] Among them, x represents the input value of the second parent neural network, o(x) represents the output value of the second parent neural network, and α i represents the weight value of the i-th second child neural network in the second parent neural network, Z i (x) represents the output value of the second neural network of the ith sub-network; Softmax(α i ) represents the probability value that the i-th second sub-neural network is the optimal network, which is used to determine the output value Z of the i-th second sub-neural network i (x) is the percentage of the output value of the second parent neural network.
[0055] The following example will illustrate the specific implementation process of calculating the output value of the second parent neural network, so as to more clearly understand the implementation process of calculating the output value of the second parent neural network. Figure 5The second neural network architecture example is shown in Table 1, which is an example of calculating the output result of the second parent neural network. If the parameters in the second parent neural network are the first data in Table 1, that is, the value of α is {2.5, 3}, the output value Z1(x) of the second child neural network 5011 is 300, and the output value Z2(x) of the second child neural network 5012 is 600, first substitute α into formula (2) to obtain:
[0056]
[0057]
[0058] Then, the above calculated values and Z1(x) and Z2(x) are substituted into formula (1) to obtain the output value of the second parent neural network 401:
[0059] o(x)=Softmax(α1)·Z1(x)+Softmax(α2)·Z2(x)
[0060] Substituting specific numbers, we get:
[0061] 0.37*300+0.63*600=489.
[0062] The output of the second parent neural network in the second data in Table 1 is calculated in the same way as the first data, and will not be repeated here.
[0063] Table 1: An example of calculating the output of the second parent neural network
[0064]
[0065] Optionally, the network weight vector α is obtained through training. It should be noted that if n=1, that is, there is only one second parent neural network, only one vector α needs to be configured in the second neural network; for the case of n>1, technicians in this field can configure n vectors α, corresponding to the n second parent neural networks respectively. Optionally, in the process of training the second parent neural network, the components in the vector α will be updated with the iteration of the optimizer until convergence; in the first parent neural network, the components in the vector α are fixed constants, and their component values are the maximum top k component values of the vector α in the second parent neural network after convergence.
[0066] In the embodiment of the present invention, the first neural network model is obtained by training the second neural network and the traffic data set. In the existing neural network training technology, only one set of network weights needs to be trained in one iteration, while in the present invention, two sets of network weights of the second parent neural network need to be alternately trained in one iteration, namely the weight α of the second parent neural network and the weights of the m second child neural networks, where the weight α is used to determine the output proportion of each second child neural network. For the data set of any region, the training optimizer will dynamically adjust the value in the α vector by learning the regional characteristics in the data set, so that the weight component α corresponding to the second child neural network that is more suitable for the characteristics of the region is i The larger the value, the greater the corresponding output weight, making the model output more adaptable to regional characteristics. The specific training method can be as follows:
[0067] The traffic data set is divided into a first training set and a second training set. The first training set is used to train the first neural network model, and the second training set is used to train the second neural network. In this embodiment, only n=1, that is, the training method of a second parent neural network is discussed; for the case of n>1, those skilled in the art can connect the second parent neural networks in series and train them together, and the training method is the same as when n=1. Figure 6 As shown, the specific training steps of a second parent neural network can be as follows:
[0068] Step S601, randomly initialize the network weights of m second sub-neural networks.
[0069] Step S602, randomly initialize the network weight vector α of the second parent neural network.
[0070] Step S603, input the second training set to the second parent neural network to start training.
[0071] Step S604, optimizing and updating the network weights of the m second sub-neural networks.
[0072] Step S605, optimizing and updating the network weight α of the second parent neural network.
[0073] Step S606, determining whether the second neural network has converged, if not, returning to step S604.
[0074] Step S607, only retain the largest first k components in the second parent neural network vector α and the corresponding second child neural network, and delete the rest to obtain the first parent neural network.
[0075] Step S608, re-randomly initialize the network weights of the k first sub-neural networks.
[0076] Step S609, using the first training set to train the first parent neural network model, and obtaining the final first parent neural network after convergence.
[0077] In this embodiment, n=1, and the first father neural network finally obtained is the final first neural network model; if n>1, the n first father neural networks connected in series are the final first neural network model.
[0078] Optionally, the training code framework of the second parent neural network may include but is not limited to at least one of the following: Pytorch, TensorFlow, MXNet, Keras. The above frameworks all include the tools required in steps S601 to S609, and those skilled in the art may select the code framework according to actual conditions.
[0079] The following example illustrates the specific implementation process of training the second parent neural network, so that you can more clearly understand the implementation process of training the second parent neural network. This implementation example is implemented using the Pytorch code framework. The weight α of the second parent neural network and the network weight of the second child neural network are stored in torch.Tensor, the loss function uses nn.MSELoss, and the optimizer for updating weights uses torch.optim.SGD.
[0080] Optionally, combined Figure 5 Table 2 is an example of a second neural network architecture for training a second parent neural network, where:
[0081] The record number 1 corresponds to steps S601 to S602, which randomly initializes the weight vectors of α of the second sub-neural network 5011, the second sub-neural network 5012, and the second parent neural network 501;
[0082] The record with sequence number 2 corresponds to step S604, which updates the network weight values of the second sub-neural network 5011 and the second sub-neural network 5012; the record with sequence number 3 corresponds to step S605, which updates the weight value of α in the second parent neural network 501;
[0083] The record number 4 corresponds to step S604, which updates the network weight values of the second sub-neural network 5011 and the second sub-neural network 5012; the record number 5 corresponds to step S605, which updates the weight value of α in the second parent neural network 501;
[0084] The record number 6 corresponds to step S604, which updates the network weight values of the second sub-neural network 5011 and the second sub-neural network 5012; the record number 7 corresponds to step S605, which updates the weight value of α in the second parent neural network 501. At this time, the loss value converges, and the parameters in this record are used as the final parameters.
[0085] Table 2: An example of calculating the output of the second neural network
[0086]
[0087] Optionally, execute step S607. If k=1, the second component α1=1.5 in the record α of sequence number 7 has the largest value, so only the second sub-neural network 5012 is retained, and the second sub-neural network 5011 is deleted. The second parent neural network after deleting the second sub-neural network 5011 is the first parent neural network.
[0088] Optionally, in step S608, the network weights of the first sub-neural network are randomly reinitialized.
[0089] Optionally, in step S609, the first neural network model is trained using the first training set. After convergence, the training process ends and the first neural network model can be deployed as a model in the prediction server 205.
[0090] In step S607 of this embodiment, k is limited to be less than m, and only the largest k components in the second parent neural network vector α and the corresponding second sub-neural network are retained, and the rest are deleted. This can remove the impact of the second sub-neural network with lower performance on the final output, because these second sub-neural networks with lower performance are often unable to capture the characteristics of the region in the data set well. In addition, reducing the number of second sub-neural networks can reduce the parameters of the single-layer network, thereby increasing the upper limit of the stacking depth of the second parent neural network, so that the final model can capture more regional characteristics and have better adaptability to regional characteristics.
[0091] In this embodiment, the prediction result of the traffic situation includes a second traffic flow and situation classification information, the second traffic flow is the traffic flow in a second time period to be predicted, and the situation classification information represents the congestion level of the second traffic flow.
[0092] Optionally, as shown in Table 3, which is an example of situation classification, those skilled in the art may set the corresponding relationship between the second flow and the congestion level according to actual conditions.
[0093] Table 3: An example of a situation classification
[0094] Crowding Second flow rate<100 idle 100<Second flow<200 Crowded 200<Second flow<500 Very crowded 500<Second flow Severe crowding
[0095] Based on the same inventive concept, Figure 7 The schematic diagram of the structure of a device provided by an embodiment of the present invention is exemplarily shown, and the device includes an acquisition unit 701, a processing unit 702, and a prediction unit 703; wherein:
[0096] The acquisition unit 701 is used to acquire a first traffic flow, where the first traffic flow is a traffic flow measured in a first time period.
[0097] The processing unit 702 is used to obtain a first neural network model, where the first neural network model is trained based on the second neural network and the traffic data set.
[0098] The first neural network model includes n parent neural networks, and the second neural network model includes n parent neural networks, where n is a positive integer; wherein the first parent neural network in the first neural network model includes k first child neural networks, and the second parent neural network in the second neural network model includes m second child neural networks, where m and k are positive integers; the weights of the m second child neural networks themselves form a network weight set w2; the second parent neural network includes a network weight vector α with a dimension of m, and the i-th component α in the network weight vector α i Corresponding to the i-th second sub-neural network, i is a positive integer; the k first sub-neural networks are obtained according to the second sub-neural networks corresponding to the largest first k components in the network weight vector α.
[0099] The prediction unit 703 is used to output the prediction result of the traffic situation, and its input is the first traffic flow.
[0100] Optionally, in the processing unit 702, k is smaller than m.
[0101] Optionally, the processing unit 702 is specifically configured to:
[0102] The output result of the second parent neural network is calculated according to the output results of the m second sub-neural networks according to the following formula.
[0103]
[0104]
[0105] Optionally, the processing unit 702 is specifically used to: train the network weight vector α.
[0106] Optionally, the processing unit 703, the prediction result of the traffic situation includes a second traffic flow and situation classification information, the second traffic flow is the traffic flow in a second time period to be predicted, and the situation classification information represents the congestion level of the second traffic flow.
[0107] In the present invention, the first neural network model is obtained by training the second neural network and the traffic data set. In the existing neural network training technology, only one set of network weights needs to be trained in one iteration, while in the present invention, two sets of network weights of the second parent neural network need to be alternately trained in one iteration, namely the weight α of the second parent neural network and the weights of the m second child neural networks, where the weight α is used to determine the output proportion of each second child neural network. For the data set of any region, the training optimizer will dynamically adjust the value in the α vector by learning the regional characteristics in the data set, so that the weight component α corresponding to the second child neural network that is more suitable for the characteristics of the region is i The larger it is, the larger the corresponding output proportion is; further, after training the second parent neural network, only the largest k components in the second parent neural network vector α and the corresponding second child neural network are retained, and the rest are deleted to obtain the first neural network model, which is obtained by training the second neural network and the given regional data set; if the second neural network is trained using a data set from another region, another first neural network model that is more suitable for the region will be obtained, thereby achieving the effect of adapting measures to local conditions.
[0108] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take 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.
[0109] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing 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.
[0110] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising 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.
[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0112] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0113] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A traffic situation prediction method, characterized in that: The method comprises the following specific steps: Acquire a first traffic flow, where the first traffic flow is a traffic flow measured in a first time period; Obtaining a prediction result of a traffic situation according to the first traffic flow and a first neural network model, wherein the first neural network model is obtained by training based on a second neural network and a traffic data set, the input of the first neural network model is the first traffic flow, and the output of the first neural network model is the prediction result of the traffic situation; The first neural network model includes n parent neural networks, and the second neural network model includes n parent neural networks, where n is a positive integer; wherein the first parent neural network in the first neural network model includes k first child neural networks, and the second parent neural network in the second neural network model includes m second child neural networks, where m and k are positive integers; the second parent neural network includes two types of network weights, namely: a network weight vector α with a dimension of m, and the network weights of the m second child neural networks themselves; the i-th component α in the network weight vector α corresponds to the i-th second child neural network, where i is a positive integer; the k first child neural networks are obtained according to the second child neural networks corresponding to the largest first k components in the network weight vector α; wherein: k is less than m; The prediction result of the traffic situation includes a second traffic flow and situation classification information, wherein the second traffic flow is the traffic flow in a second time period to be predicted, and the situation classification information represents the congestion degree of the second traffic flow; The output result of the second parent neural network is obtained according to the output results of the m second child neural networks according to the following formula: Wherein, x represents the input value of the second parent neural network, o(x) represents the output value of the second parent neural network, α represents the weight value of the i-th second child neural network in the second parent neural network, and Z(x) represents the output value of the i-th second child neural network; Softmax(α) represents the probability value that the i-th second child neural network is the optimal network, and the probability value is used to determine the proportion of the i-th second child neural network output value Z(x) in the second parent neural network output value; The network weight vector α is obtained through training.
2. A traffic situation prediction device based on the method of claim 1, characterized in that: The device comprises: An acquiring unit, configured to acquire a first traffic flow, where the first traffic flow is a traffic flow measured in a first time period; A processing unit, configured to obtain a first neural network model, wherein the first neural network model is trained based on the second neural network and the traffic data set; The first neural network model includes n parent neural networks, and the second neural network model includes n parent neural networks, where n is a positive integer; wherein the first parent neural network in the first neural network model includes k first child neural networks, and the second parent neural network in the second neural network model includes m second child neural networks, where m and k are positive integers; the second parent neural network includes two types of network weights, namely: a network weight vector α with a dimension of m, and the network weights of the m second child neural networks themselves; the i-th component α in the network weight vector α corresponds to the i-th second child neural network, where i is a positive integer; the k first child neural networks are obtained according to the second child neural networks corresponding to the largest first k components in the network weight vector α; A prediction unit is used to output the prediction result of the traffic situation, and its input is the first traffic flow; wherein: k is less than m; The prediction result of the traffic situation includes a second traffic flow and situation classification information, wherein the second traffic flow is the traffic flow in a second time period to be predicted, and the situation classification information represents the congestion degree of the second traffic flow; The processing unit is specifically used for: The output result of the second parent neural network is calculated according to the output results of the m second sub-neural networks according to the following formula: The processing unit is specifically used to: train the network weight vector α.
Citation Information
Patent Citations
Traffic flow prediction method, prediction model generation method and device
CN105788249A
Short-term traffic flow prediction method and system based on neural network, and storage medium
CN112053560A
