CN115099328A - Traffic flow prediction method, system, device and storage medium based on countermeasure network - Google Patents

Traffic flow prediction method, system, device and storage medium based on countermeasure network Download PDF

Info

Publication number
CN115099328A
CN115099328A CN202210704931.4A CN202210704931A CN115099328A CN 115099328 A CN115099328 A CN 115099328A CN 202210704931 A CN202210704931 A CN 202210704931A CN 115099328 A CN115099328 A CN 115099328A
Authority
CN
China
Prior art keywords
flow
data
prediction
information
network
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.)
Pending
Application number
CN202210704931.4A
Other languages
Chinese (zh)
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 Changan New Energy Automobile Technology Co Ltd
Original Assignee
Chongqing Changan New Energy Automobile Technology Co Ltd
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 Changan New Energy Automobile Technology Co Ltd filed Critical Chongqing Changan New Energy Automobile Technology Co Ltd
Priority to CN202210704931.4A priority Critical patent/CN115099328A/en
Publication of CN115099328A publication Critical patent/CN115099328A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/065Traffic control systems for road vehicles by counting the vehicles in a section of the road or in a parking area, i.e. comparing incoming count with outgoing count

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Traffic Control Systems (AREA)

Abstract

The invention relates to a traffic flow prediction method based on a BIDAF-GAN bidirectional attention flow confrontation network, which comprises the steps of converting traffic flow data of different vehicles on each road in each direction into a hexagonal flow link diagram in the same direction through vectors; each hexagonal flow link map represents a spatial position information map H of each vehicle at a fixed distance at a certain time T, a related comprehensive information construction sample set in the map H is obtained, the comprehensive information comprises traffic flow, vehicle speed, GPS position information, a map, weather information and social activities at a certain time, and the sample set is divided into a training set and a testing set according to a proportion; inputting the training set into a bidirectional attention flow confrontation network BIDAF-GAN for training until a loss function is converged on the test set to obtain a traffic flow prediction model and obtain a prediction network structure GNET; and inputting the road comprehensive data at a certain time into a prediction network structure GNET to predict the road traffic flow information.

Description

Traffic flow prediction method, system, device and storage medium based on confrontation network
Technical Field
The invention relates to a road traffic flow prediction technology, in particular to a traffic flow prediction technology based on a countermeasure network.
Background
With the continuous improvement of the consumption level of people, the automobile holding capacity is larger and larger, and the road congestion becomes a content which is continuously concerned by city governors and drivers and passengers. By predicting the road traffic flow, drivers and passengers can reasonably plan a travel route, the travel waiting time is reduced, city management personnel can pay attention to the road flow condition, the traffic management scheme is optimized, the traffic control is increased, and the requirements of relieving traffic pressure and the like become more and more urgent.
The traffic flow prediction is a key problem mainly concerned by drivers and drivers, is an important link of the automobile ecological cycle level of a host factory, and the prediction of the traffic flow by fully utilizing big data is a basic service capability of the host factory in the data era on the concept practice of intelligent automobiles, digital automobiles and the like.
The invention discloses a short-time traffic demand prediction method integrating multi-scale space-time statistical information, which is disclosed by the patent number CN112613630A, provides a multi-scale partition method for urban traffic demand statistical regions of multi-scale hexagonal partitions, and calculates traffic demand of each region under different space-time scales; constructing a convolution long-short term memory traffic demand prediction model fusing multi-scale hexagonal travel demand space-time information; and training the model according to historical data, and predicting the requirements of each region in real time by using the trained model. The hexagonal partition under the multi-scale is combined with the deep learning, the regional multi-scale space-time demand information is captured, and the prediction precision is effectively improved. Calculating the space-time demand of each partition under different scales to obtain the number of each level high-scale partition corresponding to the reference partition, constructing corresponding input and output samples, and dividing a training set and a test set under a time scale r according to a proportion; and adopting a convolution long-short term memory model to predict a space-time sequence, screening out a group with small error as a model overall loss function for calculation of required values under each space scale obtained by prediction each time, training the model according to historical data, predicting the requirements in real time, evaluating the prediction results under corresponding space scales, and establishing an optimal multi-space-time scale traffic demand prediction model.
However, the hexagonal partition is to perform hexagonal space partition on the original map, the space position cannot be changed, the space direction cannot be converted, the space cannot be expanded, and the influence of the space position relationship between the vehicle and the workshop is weak.
The invention patent of publication No. CN112330952B entitled "traffic flow prediction method based on generative confrontation network" constructs a network of traffic physical topological structure diagram: constructing a traffic physical topological structure diagram network according to the spatial connection relation among road sections in a traffic network, regarding the road sections as nodes, regarding the connected road sections as corresponding nodes to be connected, and further obtaining the traffic physical topological structure diagram network; constructing an initial neighborhood traffic map network and a high-order neighborhood traffic map network: the established traffic physical topological structure graph network is used as an initial neighborhood traffic graph network, and neighbor nodes of adjacent nodes of original nodes in the initial neighborhood traffic graph network are used as second-order neighborhood internal nodes of the original nodes, so that a second-order neighborhood traffic graph network is established, and the analogy is repeated, and further a high-order neighborhood traffic graph network is obtained; a generator for constructing a generative confrontation network GAN is constructed: the method comprises the steps that a generator of a generative countermeasure network is used for generating traffic data, a graph attention network GAT is adopted in the generator for feature extraction, based on an obtained initial neighborhood traffic map network and a plurality of high-order neighborhood traffic map networks, feature extraction is carried out on node information in each node neighborhood in the traffic map network, and predicted traffic data are generated, wherein the node information represents time sequence traffic data information of a detector on a road section; constructing a discriminator of the generating type confrontation network GAN: the discriminator of the generative confrontation network is used for discriminating whether the input traffic data is true, and the discriminator of the generative confrontation network adopts a multilayer full-connection network to discriminate the true and false of the traffic data; generating traffic data using a generative countermeasure network GAN: and finally generating predicted traffic data similar to the real traffic data by the mutual game of the generator and the discriminator in the generative countermeasure network, and verifying and calculating errors of the predicted traffic data and the real traffic data.
The G generation network in the countermeasure network is based on a graph attention layer, the data is complex and large in calculation amount, an initial neighborhood traffic map network and a high-order neighborhood traffic map network need to be constructed according to the connection relation of nodes in a traffic map, the connection relation of the nodes in the traffic map is damaged due to the space damage of the vector hexagons, and the flow simulation effect is poor due to the adoption of a structural mode based on the graph network.
The invention patent with application number CN202010741049.8A, entitled "urban traffic flow prediction method based on deep learning fusion model", comprises the following steps: constructing a traffic flow prediction data attribute library; dividing an urban road network into different blocks according to different purposes, preprocessing historical traffic flow data, respectively counting the traffic flow in different time periods, constructing a traffic flow input matrix, and establishing a binary vector diagram; constructing a 3DLSACN (three-dimensional convolution model), namely combining an LSTM and CNN (convolutional neural network) three-dimensional convolution model with a Resnet residual error network to serve as a deep learning fusion model for traffic flow characteristic extraction, performing characteristic extraction by using an established binary vector diagram as input, and respectively extracting space-time characteristics and periodic characteristics and fusing to obtain a primary fusion result; and manually extracting external influence factors to form external features, fusing the external features with the primary fusion result again, and finally outputting traffic flow information required to be predicted.
The road network division establishes a binary vector diagram, the essence is no space damage, the original space division is adopted, in addition, the supervision type deep learning is adopted, the training data only contains sample data, and a network with a complex structure is required.
Disclosure of Invention
Aiming at the problems that original data is numerous and complicated, the influence of the spatial position relationship between vehicles is not sufficient, a training network model is complex, calculation is inconvenient, the influence of weather and general social events on the vehicle flow is not considered completely and the like in the road traffic flow prediction in the prior art, the method innovatively provides vector conversion and arrangement to form a hexagonal traffic link diagram on the data processing level, integrates spatial information and speed information into one diagram, compresses and converts the data at a certain level, amplifies the spatial proportion and increases more spatial information; meanwhile, the traffic flow is trained and predicted by utilizing a BIDAF-GAN bidirectional attention flow confrontation network structure, on one hand, the calculation is carried out by utilizing less model depth, so that the model training does not need expensive hardware support.
The technical scheme for solving the technical problems is to provide a traffic flow prediction method based on a BIDAF-GAN bidirectional attention flow confrontation network. Converting the traffic flow data of different vehicles on each road in each direction into a hexagonal flow link diagram H diagram arranged in the same direction through vectors; acquiring comprehensive information such as traffic flow, vehicle speed, GPS (global positioning system) position information, a map, weather information, social activities and the like at a certain moment in the H picture to construct a sample set, and dividing the sample set into a training set and a testing set according to a proportion; inputting the training set into a bidirectional attention flow confrontation network BIDAF-GAN for training until a loss function is converged on the test set to obtain a traffic flow prediction model and obtain a prediction network structure GNET; and inputting the comprehensive data of a certain road in the H diagram at a certain moment into a prediction network structure GNET to obtain the traffic flow prediction information of the road. In particular to a method for preparing a high-performance nano-silver alloy,
a traffic flow prediction method based on a BIDAF-GAN bidirectional attention flow confrontation network comprises the following steps: the method comprises the steps that vehicles driving on various roads in all directions in a preset range and comprehensive information are converted and arranged into hexagonal flow link maps in the same direction through vectors, each hexagonal flow link map represents a space position information map H of each vehicle at a fixed distance in a certain period T, and the road serial number is marked as N; each vehicle in the H diagram is a round point, all vehicles running in the H diagram in the period T and the vehicle speed are obtained, and the flow S of all roads in the H diagram is obtained T-N Average speed V of all vehicles T-N-mean Labeling the weather conditions W of different roads in different time periods in the H diagram T-N Collecting social events around the road, and acquiring activity information P of different roads according to the period T and the positions of the activity events T-N (ii) a Acquiring related comprehensive information in an H picture to construct a sample set, dividing the sample set into a training set and a test set according to a proportion, inputting the training set into a bidirectional attention flow confrontation network for training until a loss function is converged on the test set to obtain a bidirectional attention flow confrontation network construction traffic flow prediction model; inputting the road comprehensive data at a certain time into a prediction model to predict the traffic flow information of the road, and generating disguised data and influence factors of loss functions by a coding structure in a bidirectional attention flow countermeasure network structureAnd the generating structure acquires the relationship between all data in the comprehensive information in the hexagonal flow link diagram and the relationship between the current period and the previous period of the comprehensive information data, the activating function acquires nonlinear information, and the judging structure judges the difference of the predicted data.
Further preferably, the vector transformation comprises: all roads in different directions are converted into roads in the same direction, the distance is divided on the roads according to the fixed length, and the space is expanded between the two distances, so that the two distances are changed into a regular hexagon from a rectangle, and the space expansion ratio is simultaneously reflected on gps positioning data of the vehicle.
Preferably, the countermeasure network generation structure acquires the relationship between each data in the integrated information in the hexagonal flow link diagram, captures the relationship between the current period and the previous period of the integrated information data, and activates the function to acquire nonlinear information; a random disturbance operator in the coding structure forms disguised data according to input predicted flow, KL divergence serves as an influence factor of a sorting loss function, the coding structure obtains characteristics of the data, information amount is amplified, and high-dimensional information is obtained.
Further preferably, the training comprises: flow data H corresponding to the T +1 th period hexagonal flow link diagram T+1 Obtaining disguised data ZK after random disturbance; will H T+1 Inputting discrimination structure DNET of countermeasure network to obtain prediction output D1, and checking true H T+1 Whether the judgment is correct or not; inputting ZK into a generation structure GNET of the countermeasure network to obtain a prediction output G1 for solidifying parameters of the generation structure GNET, so that the prediction output G1 is closer to the flow of the next period T +1, and then inputting G1 into a discrimination model to judge whether the generation of the simulated ZK flow data is performed; obtaining W in hexagonal flow link diagram T-N 、P T-N 、H T Inputting a generation structure GNET of the countermeasure network to obtain an output G2, and verifying whether the output G2 can predict the flow of the next period T + 1; g2 is input into a discrimination structure DNET of the countermeasure network to obtain an output D2, and whether the deviation from an actual value can be judged after the original data are subjected to GNET prediction is checked; g1 input through discrimination structure DNET of countermeasure networkD3, checking whether the disguised data can be identified; the above process is repeated until the loss converges on the test set.
Further preferably, the verification is true for H T+1 Whether the correctness can be judged is specifically as follows: according to the loss function, the predicted output D1 is compared with the flow data H obtained from the H picture T+1 Comparing whether the input H is consistent with the input H, if so, representing that the discrimination model can accurately identify the input H T+1 Is the true value, the loss function is: loss1 ═ BCEWithLogitsLoss (D1, true).
Further preferably, the verifying whether the raw data can be judged to be deviated from the actual value after the GNET prediction includes recognizing that an output D2 of the discrimination structure DNET is generated by real data according to a Loss function Loss2, wherein Loss2 is bcewithlogbits Loss (D2, True).
More preferably, the prediction output G1 is input to the output D3 of the countermeasure network discrimination structure DNET, whether or not the masquerading data ZK is recognizable is checked, and whether or not G1 is generated as analog data is judged based on the Loss function Loss3, where Loss3 is bcewithlogitssoss (D2, False).
Further preferably, according to the sub-loss functions of the pseudo data and the real flow data corresponding to different network results, a formula is called: d _ loss1+ loss2 calculates the loss function d _ loss so that the discrimination structure DNET can distinguish the masquerading data from the real data as much as possible, and calls a formula: g _ Loss ═ 0.3 ═ Loss3+0.7 ═ mselos (H) T+1 ZK) calculates the loss function g _ loss such that the error between the output prediction and the flow value of the next cycle is sufficiently small, MSELoss (H) T+1 ZK) as disguised data and T +1 period real flow data H T+1 The mean square loss function of (c).
The invention also provides a traffic flow prediction system based on the BIDAF-GAN bidirectional attention flow confrontation network, vehicles driving on each road in each direction in a predetermined range and comprehensive information are converted and arranged into hexagonal flow link maps in the same direction through vectors, each hexagonal flow link map represents a space position information map H of each vehicle at a fixed distance under a certain period T, and a road serial number is marked as N; each vehicle in the H diagram is a dot, all vehicles running in the H diagram and the vehicle speed in the period T are acquired,obtaining the flow S of all roads in the H diagram T-N Average speed V of all vehicles T-N-mean Labeling the weather conditions W of different roads in different time periods in the H diagram T-N Collecting social events around the road, and acquiring activity information P of different roads according to the period T and the positions of the activity events T-N (ii) a Acquiring related comprehensive information in an H picture to construct a sample set, dividing the sample set into a training set and a test set according to a proportion, inputting the training set into a bidirectional attention flow countermeasure network BIDAF-GAN for training until a loss function is converged on the test set to obtain a bidirectional attention flow countermeasure network construction traffic flow prediction model, wherein the bidirectional attention flow countermeasure network structure comprises: inputting a structure INPUT _ NET, a generating structure GNET, a distinguishing structure DNET and a coding structure ENCODE, wherein the coding structure generates camouflage data and influence factors of a loss function, and the generating structure and the distinguishing structure adopt the same structure and different activation functions.
Preferably, the generating structure GNET includes 1 ATTENTION FLOW LAYER structure ATTENTION _ FLOW _ LAYER, 1 long and short term memory network structure LSTM, 1 activation function ReLU, and the ATTENTION FLOW LAYER structure, the long and short term memory network structure, and the activation function ReLU are connected in series, and the ATTENTION FLOW LAYER structure obtains the relationship between each data in the integrated information in the hexagonal FLOW link diagram, and the long and short term memory network captures the relationship between the current period and the previous period of the integrated information data, and the activation function obtains the nonlinear information; the encoding structure ENCODE sequentially comprises 1 convolution structure Conv1d, 1 activation function ReLU, 3 full-connection layer structure Linear, 1 random disturbance operator and 1 KL divergence operator from an input end to a result end, the random disturbance operator forms disguised data according to input predicted flow, the KL divergence serves as an influence factor of a sorting loss function, the encoding structure obtains the characteristics of the data, the information amount is amplified, and high-dimensional information is obtained.
Further preferably, the vector transformation comprises: all roads in different directions are converted into roads in the same direction, the distance is divided on the roads according to the fixed length, and the space is expanded between the two distances, so that the two distances are changed into a regular hexagon from a rectangle, and the space expansion ratio is simultaneously reflected on gps positioning data of the vehicle.
Further preferably, the training comprises: flow data H corresponding to the T +1 th period hexagonal flow link diagram T+1 Obtaining disguised data ZK after random disturbance; h is to be T+1 Inputting discrimination structure DNET of countermeasure network to obtain prediction output D1, and checking true H T+1 Whether the judgment is correct or not; inputting ZK into a generation structure GNET of the countermeasure network to obtain a prediction output G1 for solidifying parameters of the generation structure GNET, so that the prediction output G1 is closer to the flow of the next period T +1, and then inputting G1 into a discrimination model to judge whether the generation of the simulated ZK flow data is performed; obtaining W in hexagonal flow link diagram T-N 、P T-N 、H T Inputting a generation structure GNET of the countermeasure network to obtain an output G2, and verifying whether the output G2 can predict the flow of the next period T + 1; g2 is input into a discrimination structure DNET of the countermeasure network to obtain an output D2, and whether the deviation from an actual value can be judged after the original data are subjected to GNET prediction is checked; g1 passes through the output D3 of the discrimination structure DNET of the countermeasure network to check whether the disguised data can be identified; the above process is repeated until the loss converges on the test set.
Further preferably, the verification is true for H T+1 Whether the correctness can be judged is specifically as follows: according to the loss function, the predicted output D1 is compared with the flow data H obtained from the H picture T+1 Comparing whether the input H is consistent or not, if so, representing that the discrimination model can accurately identify the input H T+1 Is the true value, the loss function is: loss1 ═ BCEWithLogitsLoss (D1, true).
Further preferably, the verifying whether the original data can be judged to be deviated from the actual value after the prediction by GNET includes identifying that the output D2 of the discrimination structure DNET is generated by real data according to a Loss function Loss2, wherein the Loss2 is bcewithlogtosloss (D2, True).
More preferably, the prediction output G1 is input to the output D3 of the countermeasure network discrimination structure DNET, whether or not the masquerading data ZK is recognizable is checked, and whether or not G1 is generated as analog data is judged based on the Loss function Loss3, where Loss3 is bcewithlogitssoss (D2, False).
The invention also proposes an electronic device comprising: a processor and a memory; wherein the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the traffic flow prediction system based on the BIDAF-GAN bidirectional attention flow countermeasure network as described above.
The present invention also proposes a computer readable storage medium on which a program or instructions are stored, the program or instructions being capable of being loaded and executed by a processor to perform the traffic flow prediction method based on the bidif-GAN bidirectional attention flow countermeasure network as described above.
The invention aims at the original space positions of roads and vehicles, and on one hand, the conversion of space directions is carried out, so that different road directions are converted into the same direction, namely the roads in the south and north directions and the roads in the east and west directions. On the other hand, on the basis of conversion of the space direction, space expansion is carried out, namely the distance between two vehicles which run close to each other and have the same-direction running of original data is different by 1 meter, and when the vector hexagon is subjected to space conversion, the distance between the two vehicles is different by 1.5 meters. The invention uses a mechanism of bidirectional attention flow and full connection layer, and has an independent coding structure for acquiring data characteristic information and strengthening the flow simulation effect. The invention uses a countermeasure network, and the data training has random value interference. Compared with a common grid map, the H map has the advantages of increasing the information of the speed of the vehicle, facilitating the model to obtain the space position by amplifying the space information, facilitating the model to obtain the influence of the narrow road on the traffic flow by small-range space distortion and the like. The BIDAF-GAN bidirectional attention flow confrontation network structure architecture can be freely expanded to jointly predict multiple data, can expand multiple other non-traffic data influencing traffic flow, does not need to change network parameters, has moderate complexity in training the network structure, can be trained and predicted quickly by an 8G GPU server, and does not need a large server. The training network fully learns the mutual influence among time, space, weather and events, the model is trained by using the same network structure for multiple times, the model is prevented from being larger, deeper and more complex, the prediction model only occupies about 10% of the training network, and the calculation in the prediction stage is quicker. The bidirectional attention flow can acquire the mutual influence among different lanes and can also acquire the weight of an attention parameter for finding the influence among different factors. The model shares one GNET or DNET for multiple times, so that the information acquisition condition of input data can be deepened continuously, and the fitting degree is more excellent.
Drawings
FIG. 1 is a schematic diagram of vehicles arranged into homodromous hexagonal traffic links by vector conversion;
FIG. 2 is a schematic diagram of a BIDAF-GAN bidirectional attention flow countermeasure network architecture;
FIG. 3 is a comparison graph of the actual value of a road and the predicted value of BIDAF-GAN.
Detailed Description
In order to clearly understand the present invention and make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help the full understanding of the embodiments of the present invention. Thus, it will be apparent to those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the invention. In addition, descriptions of well-known functions and constructions are omitted for clarity and conciseness. It should be understood that the examples are only for illustrating the present invention, and are not intended to limit the scope of the present invention.
Compared with a common rasterized graph, the H graph has the advantages of increasing the information of the speed of the vehicle, amplifying the spatial information, facilitating the acquisition of a model to obtain the spatial position, the position relation between the vehicle and the vehicle, facilitating the acquisition of the model to influence the traffic flow by a narrow road due to small-range spatial distortion and the like. As shown in fig. 1, the vehicles are arranged into hexagonal traffic link graphical representations in the same direction through vector conversion, the road sequence number is marked as N, the relevant information of the vehicles in a fixed period, such as GPS positioning information, the speed of the vehicles, a road traffic map, weather (rainy days, foggy days, snowy days, and general weather), social events (sports events, art shows, and art shows at the city level), and the like, are acquired, and the three data of the GPS positioning information, the vehicle speed, and the traffic map are marked as traffic flow data X. And (3) converting all vehicles on the traffic flow data X, all directions and all roads into a hexagonal flow link diagram in the same direction through vectors. And arranging vehicles running on the road in the preset range into a same-direction hexagonal flow link map through vector conversion to construct a vehicle space position information map H, wherein each hexagonal flow link map represents the space position information map H of each vehicle in a fixed distance at a certain period time T, and the vector conversion is carried out according to the road, the GPS positioning information of the vehicles, the vehicle speed information and the GPS positioning information of the road to construct the hexagonal flow link map.
The vector transformation process can adopt the following method: converting all roads in different directions into roads in the same direction, namely converting roads from southeast to northwest into roads from southeast to west; dividing intervals on a road according to a fixed length, and expanding the space between the two intervals to change the two intervals into a regular hexagon from a rectangle; the scale of the space expansion is simultaneously embodied on the gps positioning data of the vehicle.
Each vehicle in the H diagram is represented by one round point, if the round points are dense to represent that the vehicle flow is high, the round points are sparse to represent that the vehicle flow is low, all vehicles which enter the H diagram to drive at the moment T and the vehicle speed are obtained, and the flow S of all roads in the H diagram is obtained T-N Average speed V of all vehicles T-N-mean H background color depth in the graph using V T-N-mean /V max Is converted into a value of V max Is the maximum value of the vehicle speed in all the traffic flow data in the H diagram. In order to make the speed more intuitive, and the vehicle speed can be fused into the picture space, the model can conveniently capture the information between the vehicle speed and the space, and the darker the background color is, the faster the vehicle speed is.
According to the period T, obtaining the weather conditions W of different roads in different time periods in the H chart according to the weather forecast information T-N Collecting social events around the road, and acquiring activity information P of different roads according to the periodic time T and the positions of the activity events T-N . The weather information W of the Nth road at the moment T T-N And social activity information P of Nth road at time T T-N And the flow information S of the Nth road at the time T T-N And the flow data H of all roads in the hexagonal flow link diagram at the moment T T And dividing a training set and a testing set according to the proportion, wherein the sampling frequency of the social activity information and the weather information is kept consistent with the frequency of the H diagram, namely the social activity and the weather condition occur at the same time. Social event information and weather information are used as independent data input models.
And constructing a BIDAF-GAN training H graph, social activity information, weather information and other data of the bidirectional attention flow adversity network, and training an optimal network as a traffic flow prediction model.
As shown in fig. 2, the structure of the bidirection adversity network with bidirection adversity-GAN is schematically shown, and the bidirection adversity network is composed of a plurality of substructures, which are respectively an INPUT structure INPUT _ NET, a generating structure GNET, a discriminating structure DNET, and an encoding structure ENCODE,
INPUT structure INPUT _ NET obtains W T-N 、P T-N 、H T And (4) reading specific image pixel data of the H image through pixelization, wherein other data are original data, and outputting the result to a next generation structure.
The generating structure GNET comprises 1 ATTENTION FLOW LAYER structure ATTENTION _ FLOW _ LAYER, 1 long-short term memory network structure LSTM, and 1 activation function ReLU. The attention flow layer structure, the long and short term memory network structure and the activation function ReLU are connected in series, wherein the attention flow layer structure mainly obtains the relation between single data and all data and can also obtain the relation between the single data and the traffic condition of the previous time. The activation function is mainly used for adding nonlinear factors into the model and acquiring nonlinear information.
The encoding structure ENCODE sequentially comprises 1 convolution structure Conv1d, 1 activation function ReLU, 3 full-connection layer structure Linear, 1 random perturbation operator and 1 KL divergence operator from an input end to a result end, wherein the random perturbation operator is combined with input to form new disguised data, and the KL divergence is used as an influence factor of a sorting loss function.
Conv1d, 1 activation function ReLU and 3 full-connection layer structures Linear in the coding structure are mainly used for acquiring the characteristics of data, and the information quantity is amplified through the structures to acquire high-dimensional information. The 1 random perturbation operator and the 1 KL divergence operator mainly use simulation data in subsequent training and are one of core function points for constructing the countermeasure network.
The discrimination structure DNET comprises 1 ATTENTION FLOW LAYER structure ATTENTION _ FLOW _ LAYER, 1 long-short term memory network structure LSTM, 3 full-connection LAYER structures Linear and 1 activation function SIGMOD, the structure and the generation structure in the discrimination structure are similar, and the activation function SIGMOD different from the generation structure is adopted and is mainly used for discriminating whether simulation data can be identified through the discrimination structure.
By means of the associated sample parameter in the sample set, W T-N 、P T-N 、S T-N 、H T And training the BIDAF-GAN bidirectional attention flow confrontation network to obtain a training optimized generation structure GNET + discrimination structure DNET as a traffic flow prediction network model. The loss function can adopt two-class cross entropy loss BCEWithLoitsLoss and mean square loss function MSELoss functions. Both loss functions are themselves the deviation between the calculated true and predicted values.
Training the BIDAF-GAN bidirectional attention flow countermeasure network includes: obtaining flow data H of H picture T +1 moment T+1 And flow data H corresponding to the T +1 th period hexagonal flow link diagram T+1 The disguised data after random perturbation is noted as ZK.
The flow data H of the T +1 th period T+1 Obtaining a prediction output D1 by confronting a network input structure input judgment structure DNET, judging whether D1 is real data True or not, and checking True H T+1 Whether the judgment is correct or not. Flow data H obtained by using prediction output D1 and H picture T+1 Comparing whether the input H is consistent with the input H, if so, representing that the discrimination model can accurately identify the input H T+1 Is the true value. At this time, the countering network loss function loss1 is: loss1 is BCEWithLogitsLoss (D1, true), where BCEWithLogitsLoss is a type S classification cross-loss function. BCEWithLogitsLoss is BCELoss (predicted value, true value), and the BCEWithLogitsLoss firstly passes through an S-type function on the predicted valueProcessing the number, calculating the deviation between the true value and the S-shaped function processing value through two-classification cross entropy loss, sigmoid is the S-shaped function,
and inputting the ZK into the generation structure GNET through the INPUT structure INPUT _ NET to obtain a predicted output G1, simulating the flow of the ZK through G1 obtained by the generation structure GNET for solidifying parameters of the generation structure GNET, enabling the output result to be closer to the flow of the next period T +1, inputting G1 into a discrimination model, and judging whether the flow data generated by simulating the ZK is generated or not. H T+1 The encoding structure ENCODE can generate disguised data, wherein the encoding structure ENCODE comprises random disturbance, and the encoding structure ENCODE can be fully learned, so that the disguised data is more fitted with original data and is more approximate to the original data.
Handle W T-N 、P T-N 、H T The data are input together or input separately by ZK, mutual influence and weight between local data (such as a vehicle) and whole data (such as the flow of the whole road) in the input information are obtained through the attention flow layer structure, the periodic influence of the flow in different time is obtained through the long-term and short-term memory network, the activation function adds nonlinear information to the data of all input activation functions, model complexity information is increased, data mapping is more complex when the data flow in each module, and more information items are obtained.
W is to be T-N 、P T-N 、H T The output G2 is obtained by inputting the INPUT structure INPUT _ NET into the generating structure GNET (G2 is the traffic of the next cycle predicted according to the training data), and whether the traffic of the next cycle T +1 can be predicted is verified. And judging whether G2 is a real result by using dnet, and using Loss2 to perform a gradient descent method to help a training mechanism to optimize parameters so as to find the parameters at the highest precision of the confrontation network. By utilizing a back propagation technology, the partial derivative of the loss function to the DNET network weight is firstly solved to form the gradient of the loss function to the weight vector, the gradient is used as a basis for modifying the weight, and then the influence on the Gnet network weight is solved, so that the predicted value is continuously close to the real flow value.
And inputting an output G2 obtained by generating the structure GNET into the discrimination structure DNET to obtain an output D2, and verifying whether the deviation from an actual value can be judged after the original data are subjected to GNET prediction. The discriminant model can recognize whether the DNET output D2 was generated from real data according to the Loss function Loss2, where Loss2 is bcewithlogitotsloss (D2, True).
Inputting the predicted output G1 into the output D3 of the discrimination structure DNET, checking whether the disguised data can be identified, and according to the formula: loss3 ═ BCEWithLogitsLoss (D2, False) determines whether G1 was generated from the simulation data. Wherein False is failure.
The training is performed until the loss converges on the test set, and the convergence process is that the loss results are stable. And determining a loss function d _ loss according to loss sub-loss functions of the pseudo data and the real data corresponding to different network results, so that the discrimination structure DNET can distinguish the pseudo data from the real data as much as possible, and determining a loss function g _ loss so that the error between the output prediction result and the flow value of the next period is small enough. Wherein the above-mentioned loss function can be calculated according to a formula,
d_loss=loss1+loss2,g_loss=0.3*Loss3+0.7*MSELoss(H T+1 ,ZK)。
d _ loss mainly judges whether input data is pseudo data or real data according to Dnet, and the two data are separated as far as possible; loss1/loss2/loss3 are loss sub-loss functions, MSELoss (H), of pseudo data and real data, respectively, corresponding to different network results T+1 ZK) as dummy data Z and real flow data H T+1 The mean square loss function of (c). The method is used for refining loss results and improving accuracy. g _ Loss is whether the error between the predicted result of Gnet output and the actual flow value of the next cycle is small enough to make the two data consistent as much as possible, while Loss3 acts to allow Gnet to take into account the ability to separate the two data. Under the action of both g _ loss and d _ loss, an opposition is formed between the two, and the balance converges finally. And d _ loss and g _ loss depend on the deviation between the real value and the predicted value, and the partial derivative of the loss function to each network weight is calculated layer by layer through a back propagation technology to form the gradient of the loss function to the weight vector as the basis for modifying the weight, and the learning of the network is completed in the weight modifying process. And when the error reaches the expected value or the network error is in convergence balance, finishing the network training.
After the network training is finished, selecting the weight of the GNET, storing the optimal weight information when the error reaches an expected value or when the network error is in convergence balance, loading the weight into the Gnet network, and when a driver starts a vehicle or plans a driving route, inputting the data of the weather, social activities and the current traffic flow chart transmitted by the cloud platform into a prediction network model through the hexagon conversion, wherein the obtained output is the final flow data of the next period of each road.
FIG. 3 shows a comparison between the actual value of a certain road and the predicted value of BIDAF-GAN. BIDAF-GAN is known to be better than other known methods. FIG. 3 illustrates the difference between the BIDAF-GAN predicted value and the actual flow, where the future in the legend is the actual flow.
The above-described embodiment is only one of the embodiments of the present invention, and general changes and substitutions by those skilled in the art within the technical scope of the present invention are included in the protection scope of the present invention.

Claims (18)

1. A traffic flow prediction method based on a BIDAF-GAN bidirectional attention flow countermeasure network is characterized by comprising the following steps: vehicles driving on various roads in various directions within a preset range and comprehensive information are converted and arranged into hexagonal flow link maps in the same direction through vectors, and each hexagonal flow link map represents a spatial position information map H of each vehicle at a fixed distance under a certain period T; each vehicle in the H diagram is a round point, all vehicles running in the H diagram in the period T and the vehicle speed are obtained, and the flow S of all roads in the H diagram is obtained T-N Average speed V of all vehicles T-N-mean Labeling the weather conditions W of different roads in different time periods in the H diagram T-N Collecting the activity events around the road, and determining the activity information P of different roads according to the period T and the activity event positions T-N (ii) a Acquiring related comprehensive information in an H picture to construct a sample set, dividing the sample set into a training set and a testing set according to a proportion, inputting the training set into a bidirectional attention flow countermeasure network for training, and generating disguised data and a loss function by a coding structure in a bidirectional attention flow countermeasure network structureThe generating structure obtains the relationship between each datum in the current period comprehensive information in the hexagonal flow link diagram and the relationship between the current period comprehensive information datum and the previous period comprehensive information datum, the activating function obtains nonlinear information, and the judging structure judges the difference of the prediction data until the loss function converges on the test set to construct a traffic flow prediction model; and inputting the road comprehensive data at a certain time into a prediction model to predict the road traffic flow information.
2. The prediction method of claim 1, wherein the vector transformation comprises: all roads in different directions are converted into roads in the same direction, the distance is divided on the roads according to the fixed length, and the space is expanded between the two distances, so that the two distances are changed into a regular hexagon from a rectangle, and the space expansion ratio is simultaneously reflected on gps positioning data of the vehicle.
3. The prediction method according to claim 1, wherein the countermeasure network generation structure obtains the relationship between each data in the integrated information in the hexagonal flow link diagram, captures the relationship between the current period and the previous period of the integrated information data, and activates the function to obtain the nonlinear information; a random disturbance operator in the coding structure forms disguised data according to input predicted flow, KL divergence serves as an influence factor of a sorting loss function, the coding structure obtains characteristics of the data, information amount is amplified, and high-dimensional information is obtained.
4. The prediction method according to one of claims 1 to 3, characterized in that the training comprises: flow data H corresponding to the T +1 th period hexagonal flow link diagram T+1 Obtaining disguised data ZK after random disturbance; will H T+1 Inputting discrimination structure DNET of countermeasure network to obtain prediction output D1, and checking prediction H T+1 Whether the flow rate can be consistent with the real flow rate of the next period or not; inputting ZK into the structure GNET generated by the countermeasure network to obtain a predicted output G1, solidifying isomorphic G1 to generate parameters of the structure GNET, and enabling the predicted output G1 to be corresponding to the next periodThe real flow is closer, and then G1 is input into a discrimination model to judge whether the flow is generated by simulating ZK flow data; obtaining W in hexagonal flow link diagram T-N 、P T-N 、H T Inputting a generation structure GNET of the countermeasure network to obtain an output G2, and verifying whether the output G2 can predict the real flow of the next period; g2 is input into a discrimination structure DNET of the countermeasure network to obtain an output D2, and whether the deviation from the real flow value can be judged after the original data are subjected to GNET prediction is verified; g1 passes through the output D3 of the discrimination structure DNET of the countermeasure network to check whether the disguised data can be identified; the above process is repeated until the loss converges on the test set.
5. The prediction method of claim 4, wherein the predicted H is T+1 Whether the real traffic can be consistent with the real traffic of the next period is specifically as follows: according to the loss function, the predicted output D1 is compared with the flow data H obtained from the H picture T+1 Comparing whether the input H is consistent with the input H, if so, representing that the discrimination model can accurately identify the input H T+1 Is the true value, the sub-loss function is: loss1 ═ bcewithlogtosloss (D1, true).
6. The prediction method of claim 4, wherein the verifying whether the original data can be predicted by GNET to determine the deviation from the actual value comprises identifying that the output D2 of the dnET structure is generated by real data according to a Loss sub-function Loss2, wherein Loss2 is BCEWithLogitsLoss (D2, True), determining whether G2 is a real result by using DNET, optimizing and finding the parameter under the highest precision of the countermeasure network by using Loss2 to perform gradient descent method, calculating a partial derivative of the DNET network weight according to Loss2 to form the gradient of the Loss function to the weight vector, and using the gradient as the basis for modifying the weight to make the predicted value approach the real flow value continuously.
7. The prediction method according to claim 4, wherein the prediction output G1 is input to the output D3 of the discrimination structure DNET of the countermeasure network, it is checked whether the masquerading data ZK can be recognized, and it is judged whether G1 is generated by simulation data according to the sub-Loss function Loss3, wherein Loss3 is BCEWithLoitsLoss (D2, False).
8. The prediction method according to one of claims 5 to 7, characterized in that, based on the sub-loss functions of the pseudo data and the real traffic data corresponding to different network results, the formula is invoked: d _ loss1+ loss2 calculates the loss function d _ loss so that the discrimination structure DNET can distinguish the masquerading data from the real data as much as possible, and calls a formula: g _ Loss ═ 0.3 Loss3+0.7 mselos (H) T+1 ZK) calculates the loss function g _ loss such that the error between the output prediction and the flow value of the next cycle is sufficiently small, MSELoss (H) T+1 ZK) is disguised data and T +1 period real flow data H T+1 The mean square loss function of.
9. A traffic flow prediction system based on a BIDAF-GAN bidirectional attention flow confrontation network is characterized in that vehicles driving on each road in each direction in a preset range and comprehensive information are converted and arranged into hexagonal flow link maps in the same direction through vectors, and each hexagonal flow link map represents a space position information map H of each vehicle in a fixed distance in a certain period T; each vehicle in the H diagram is a round point, all vehicles running in the H diagram in the period T and the vehicle speed are obtained, and the flow S of all roads in the H diagram is obtained T-N Average speed V of all vehicles T-N-mean Labeling the weather conditions W of different roads in different time periods in the H diagram T-N Collecting social events around the road, and determining activity information P of different roads according to the period T and the activity event position T-N (ii) a Acquiring related comprehensive information in an H picture to construct a sample set, dividing the sample set into a training set and a test set according to a proportion, inputting the training set into a bidirectional attention flow confrontation network for training until a loss function is converged on the test set to obtain a bidirectional attention flow confrontation network construction traffic flow prediction model, wherein the bidirectional attention flow confrontation network structure comprises: inputting a structure INPUT _ NET, a generating structure GNET, a distinguishing structure DNET and a coding structure ENCODE, wherein the coding structure generates disguised data and influence factors of a loss function, and the generating structure and the distinguishing structure adopt the same structure and are differentThe function is activated.
10. The prediction system of claim 9, wherein the generating structure GNET comprises 1 ATTENTION FLOW LAYER structure ATTENTION _ FLOW _ LAYER, 1 long and short term memory network structure LSTM, 1 activation function ReLU, and the ATTENTION FLOW LAYER structure, the long and short term memory network structure, and the activation function ReLU are connected in series, and the ATTENTION FLOW LAYER structure obtains the relationship between each piece of data in the current period in the integrated information in the hexagonal traffic link map, and the long and short term memory network captures the relationship between the current period and the integrated information data in the previous period, and the activation function obtains nonlinear information; the encoding structure ENCODE sequentially comprises 1 convolution structure Conv1d, 1 activation function, 3 full-connection layer structures, 1 random disturbance operator and 1 KL divergence operator from an input end to a result end, the random disturbance operator forms disguised data according to input predicted flow, the KL divergence operator is used as an influence factor of a sorting loss function, the encoding structure obtains the characteristics of the data, information quantity is amplified, and high-dimensional information is obtained.
11. The prediction system of claim 9, wherein the vector translation comprises: all roads in different directions are converted into roads in the same direction, the distance is divided on the roads according to the fixed length, and the space is expanded between the two distances, so that the two distances are changed into a regular hexagon from a rectangle, and the space expansion ratio is simultaneously reflected on gps positioning data of the vehicle.
12. The prediction system according to one of claims 9-11, wherein the training comprises: flow data H corresponding to the T +1 th period hexagonal flow link diagram T+1 Obtaining disguised data ZK after random disturbance; h is to be T+1 Inputting a discrimination structure DNET of the countermeasure network to obtain a prediction output D1, and verifying whether the real flow of the next period can be correctly judged; inputting ZK into the generation structure GNET of the countermeasure network to obtain a prediction output G1 for solidifying parameters of the generation structure GNET, so that the prediction output G1 and the real flow of the next periodMore closely, inputting G1 into a discrimination model, and judging whether the flow data is generated by simulating ZK flow data; obtaining W in hexagonal flow link diagram T-N 、P T-N 、H T Inputting a generation structure GNET of the countermeasure network to obtain an output G2, and verifying whether the output G2 can predict the real flow of the next period; g2 is input into a discrimination structure DNET of the countermeasure network to obtain an output D2, and whether the deviation from an actual value can be judged after the original data are subjected to GNET prediction is checked; g1 passes through the output D3 of the discrimination structure DNET of the countermeasure network to check whether the disguised data can be identified; the above process is repeated until the loss converges on the test set.
13. The prediction system according to claim 12, wherein the verifying whether the real traffic in the next period can be correctly determined specifically is: according to the sub-loss function loss1, the predicted output D1 and the flow data H obtained from the H map are obtained T+1 Comparing whether the input H is consistent or not, if so, representing that the discrimination model can accurately identify the input H T+1 Is the true flow value, the sub-loss function is: loss1 ═ BCEWithLogitsLoss (D1, true).
14. The prediction system of claim 12, wherein said verifying whether the raw data is skewed from the actual values after GNET prediction comprises identifying that the output D2 of the discriminative structure DNET is True data from a Loss sub-function Loss2, wherein Loss2 is BCEWithLogitsLoss (D2, True).
15. The prediction system according to claim 12, wherein the prediction output G1 is input to the output D3 of the countermeasure network discrimination structure DNET, it is checked whether the masquerading data ZK can be recognized, and it is determined whether G1 is generated from the simulation data according to the sub-Loss function Loss3, wherein Loss3 is bcewithlogitssoss (D2, False).
16. Prediction system according to one of claims 13-15, characterized in that the sub-losses of different network outcomes are based on dummy data and real traffic dataMissing functions, call the formula: d _ loss1+ loss2 calculates the loss function d _ loss so that the discrimination structure DNET can distinguish the masquerading data and the real flow data as much as possible, and calls a formula: g _ Loss ═ 0.3 ═ Loss3+0.7 ═ mselos (H) T+1 ZK) is calculated such that the error between the output prediction and the flow value of the next cycle is sufficiently small, wherein mselos (H) T+1 ZK) is disguised data and T +1 period real flow data H T+1 The mean square loss function of.
17. An electronic device, comprising: a processor and a memory; wherein the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for implementing the traffic flow prediction system based on the BIDAF-GAN bidirectional attention flow countermeasure network according to any one of claims 9 to 16.
18. A computer-readable storage medium, storing thereon a program or instructions capable of being loaded and executed by a processor to perform the traffic flow prediction method based on a bidif-GAN bidirectional attention flow countermeasure network according to any one of claims 1 to 8.
CN202210704931.4A 2022-06-21 2022-06-21 Traffic flow prediction method, system, device and storage medium based on countermeasure network Pending CN115099328A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210704931.4A CN115099328A (en) 2022-06-21 2022-06-21 Traffic flow prediction method, system, device and storage medium based on countermeasure network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210704931.4A CN115099328A (en) 2022-06-21 2022-06-21 Traffic flow prediction method, system, device and storage medium based on countermeasure network

Publications (1)

Publication Number Publication Date
CN115099328A true CN115099328A (en) 2022-09-23

Family

ID=83292987

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210704931.4A Pending CN115099328A (en) 2022-06-21 2022-06-21 Traffic flow prediction method, system, device and storage medium based on countermeasure network

Country Status (1)

Country Link
CN (1) CN115099328A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115604131A (en) * 2022-12-15 2023-01-13 广州丰石科技有限公司(Cn) Link flow prediction method, system, electronic device and medium
CN116153089A (en) * 2023-04-24 2023-05-23 云南大学 Traffic flow prediction system and method based on space-time convolution and dynamic diagram
CN118280121A (en) * 2024-06-03 2024-07-02 陕西星辰电子技术有限责任公司 Target monitoring and early warning method and system based on unmanned aerial vehicle

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115604131A (en) * 2022-12-15 2023-01-13 广州丰石科技有限公司(Cn) Link flow prediction method, system, electronic device and medium
CN116153089A (en) * 2023-04-24 2023-05-23 云南大学 Traffic flow prediction system and method based on space-time convolution and dynamic diagram
CN118280121A (en) * 2024-06-03 2024-07-02 陕西星辰电子技术有限责任公司 Target monitoring and early warning method and system based on unmanned aerial vehicle

Similar Documents

Publication Publication Date Title
CN110164128B (en) City-level intelligent traffic simulation system
CN110264709B (en) Method for predicting traffic flow of road based on graph convolution network
CN109142171B (en) Urban PM10 concentration prediction method based on feature expansion and fusing with neural network
CN115099328A (en) Traffic flow prediction method, system, device and storage medium based on countermeasure network
CN115240425B (en) Traffic prediction method based on multi-scale space-time fusion graph network
CN109410575A (en) A kind of road network trend prediction method based on capsule network and the long Memory Neural Networks in short-term of nested type
CN118025203B (en) Automatic driving vehicle behavior prediction method and system integrating complex network and graph converter
WO2021013190A1 (en) Meteorological parameter-based high-speed train positioning method and system in navigation blind zone
CN111583648B (en) Urban traffic flow prediction method fusing GPS data and checkpoint flow data
CN111832615A (en) Sample expansion method and system based on foreground and background feature fusion
CN110909924A (en) City expansion multi-scenario simulation cellular automata method based on cross entropy optimizer
CN114511154B (en) Traffic flow prediction method based on space-time complex graph convolutional network
CN114944053A (en) Traffic flow prediction method based on spatio-temporal hypergraph neural network
CN110826244B (en) Conjugated gradient cellular automaton method for simulating influence of rail transit on urban growth
CN113591380A (en) Traffic flow prediction method, medium and equipment based on graph Gaussian process
CN112966853A (en) Urban road network short-term traffic flow prediction method based on space-time residual error mixed model
CN112633602B (en) Traffic congestion index prediction method and device based on GIS map information
CN112884014A (en) Traffic speed short-time prediction method based on road section topological structure classification
CN117494034A (en) Air quality prediction method based on traffic congestion index and multi-source data fusion
CN113327417A (en) Traffic flow prediction method based on 3D dynamic space-time residual convolution associated network
CN117494871A (en) Ship track prediction method considering ship interaction influence
CN115862324A (en) Space-time synchronization graph convolution neural network for intelligent traffic and traffic prediction method
CN113971496A (en) Urban traffic network state evolution trend prediction method and system under influence of activities
CN109636194B (en) Multi-source cooperative detection method and system for major change of power transmission and transformation project
CN114912719A (en) Heterogeneous traffic individual trajectory collaborative prediction method based on graph neural network

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