CN114328675A - Prediction method of bus travel time based on dual attention mechanism and bidirectional double layer LSTM - Google Patents
Prediction method of bus travel time based on dual attention mechanism and bidirectional double layer LSTM Download PDFInfo
- Publication number
- CN114328675A CN114328675A CN202210007787.9A CN202210007787A CN114328675A CN 114328675 A CN114328675 A CN 114328675A CN 202210007787 A CN202210007787 A CN 202210007787A CN 114328675 A CN114328675 A CN 114328675A
- Authority
- CN
- China
- Prior art keywords
- bus
- travel time
- time
- data set
- feature
- 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.)
- Granted
Links
- 230000002457 bidirectional effect Effects 0.000 title claims abstract description 25
- 230000007246 mechanism Effects 0.000 title claims abstract description 25
- 238000000034 method Methods 0.000 title claims abstract description 20
- 230000009977 dual effect Effects 0.000 title claims description 15
- 238000010219 correlation analysis Methods 0.000 claims abstract description 6
- 238000013528 artificial neural network Methods 0.000 claims abstract description 5
- 239000011159 matrix material Substances 0.000 claims description 14
- 238000000605 extraction Methods 0.000 claims description 13
- 230000002159 abnormal effect Effects 0.000 claims description 7
- 230000002596 correlated effect Effects 0.000 claims description 6
- 230000002123 temporal effect Effects 0.000 claims description 6
- 230000008569 process Effects 0.000 claims description 5
- 238000012549 training Methods 0.000 claims description 5
- 238000012360 testing method Methods 0.000 claims description 2
- 238000007781 pre-processing Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 238000012706 support-vector machine Methods 0.000 description 2
- 238000003915 air pollution Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013499 data model Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Landscapes
- Traffic Control Systems (AREA)
Abstract
Description
技术领域technical field
本发明涉及城市智能交通领域,具体涉及一种基于双注意力机制和双向双层LSTM的公交车行程时间预测方法。The invention relates to the field of urban intelligent transportation, in particular to a bus travel time prediction method based on a double attention mechanism and a two-way double-layer LSTM.
背景技术Background technique
公交车作为公共交通的重要组成部分,具有人均面积小,人均耗能低,承载能力大,总体运输成本低等优势。通过提升公交车的服务水平,吸引更多的人使用公共交通,有助于缓解城市交通拥堵,减少城市空气污染,保障城市健康良好的运行。因此,大力发展公交车是实现城市交通可持续发展,促进人与社会的良性循环,互动发展的重要举措。As an important part of public transportation, buses have the advantages of small area per capita, low energy consumption per capita, large carrying capacity, and low overall transportation cost. By improving the service level of buses and attracting more people to use public transportation, it will help alleviate urban traffic congestion, reduce urban air pollution, and ensure the healthy and sound operation of the city. Therefore, vigorously developing buses is an important measure to realize the sustainable development of urban transportation and promote the virtuous circle and interactive development between people and society.
目前公交调度主要通过调度人员从自身的经验出发进行估计,或基于传统的公交车行程时间预测模型(如:历史数据模型、时间序列模型、回归预测模型、支持向量机模型、卡尔曼滤波模型等)获取预计行程时间。该种方式估计误差往往较大,常出现调度不够及时,导致“串车”或“大间隔”的现象,进而导致公交车的运营效率较低,服务水平较差,吸引力不高,使用率远没有达到理想水平。At present, bus scheduling is mainly estimated by dispatchers from their own experience, or based on traditional bus travel time prediction models (such as historical data models, time series models, regression prediction models, support vector machine models, Kalman filter models, etc. ) to get the estimated travel time. The estimation error of this method is often large, and the scheduling is often not timely enough, resulting in the phenomenon of "cross train" or "large interval", which in turn leads to low operating efficiency of the bus, poor service level, low attractiveness, and low utilization rate. far from ideal.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明的目的在于提供一种基于双注意力机制和双向双层LSTM的公交车行程时间预测方法,能够更准确的公交车预计行程时间,实现高效的公交调度。In view of this, the purpose of the present invention is to provide a bus travel time prediction method based on dual attention mechanism and bidirectional double-layer LSTM, which can more accurately estimate the travel time of buses and realize efficient bus scheduling.
为实现上述目的,本发明采用如下技术方案:To achieve the above object, the present invention adopts the following technical solutions:
一种基于双注意力机制和双向双层LSTM的公交车行程时间预测方法,包括如下步骤:A bus travel time prediction method based on dual attention mechanism and bidirectional double layer LSTM, including the following steps:
步骤S1:获取公交车属性数据和进出站数据,并预处理,构建行程时间基础数据集;Step S1: obtain bus attribute data and inbound and outbound data, and preprocess to construct a basic data set of travel time;
步骤S2:获取公交车的基础特征、运行时间及运行时的天气特征,构建行程时间特征数据集;Step S2: obtain the basic characteristics of the bus, the running time and the weather characteristics during running, and construct the travel time characteristic data set;
步骤S3:基于相关系数和方差分析,对行程时间特征数据集中的特征因子与行程时间进行相关性分析,舍去不相关和相关性差的特征因子,并与行程时间基础数据集进行匹配,获取行程时间预测数据集;Step S3: based on the correlation coefficient and variance analysis, carry out a correlation analysis on the characteristic factors in the travel time characteristic data set and the travel time, discard the characteristic factors that are irrelevant and poorly correlated, and match with the travel time basic data set to obtain the travel time. time prediction dataset;
步骤S4:构建双注意力机制和双向双层LSTM神经网络公交车行程时间预测模型,将行程时间预测数据集输入到模型中,对公交车的行程时间进行预测,输出公交车的预计行程时间。Step S4: Build a bus travel time prediction model with a dual attention mechanism and a bidirectional double-layer LSTM neural network, input the travel time prediction data set into the model, predict the travel time of the bus, and output the estimated travel time of the bus.
进一步的,所述步骤S1具体为:Further, the step S1 is specifically:
步骤S11:获取公交车属性数据和进出站数据,直接剔除重复记录和异常的数据并补全缺失数据;Step S11: obtain bus attribute data and entry and exit data, directly remove duplicate records and abnormal data and complete missing data;
步骤S12:根据公交运营班次编号,将公交车属性数据和进出站数据进行匹配,获取各运营班次的公交车运行时间,构建行程时间基础数据集。Step S12: Match the bus attribute data with the inbound and outbound data according to the bus operation shift number, obtain the bus running time of each operation shift, and construct a basic data set of travel time.
进一步的,所述步骤S2具体为:获取公交车的车辆编号、驾驶员编号、车辆发车时间、发车间隔;获取上一天相似时间段、上一周相同特征日的相似时间段从始发站到终点站的运行时间;获取车辆运行时的天气特征包括天气类型、湿度、风速、温度,构建行程时间特征数据集。Further, the step S2 is specifically: acquiring the vehicle number, driver number, vehicle departure time, and departure interval of the bus; acquiring a similar time period of the previous day and a similar time period of the same characteristic day of the previous week from the starting station to the end point. The running time of the station is obtained; the weather characteristics of the vehicle during operation include weather type, humidity, wind speed, and temperature, and a data set of travel time characteristics is constructed.
进一步的,所述步骤S3具体为:Further, the step S3 is specifically:
步骤S31:利用皮尔逊相关系数相关系数对连续型特征因子和公交车运行时间之间做相关性分析,获取变量间的相关性;Step S31: using the Pearson correlation coefficient correlation coefficient to analyze the correlation between the continuous characteristic factor and the bus running time, and obtain the correlation between the variables;
步骤S32:将天气类型、司机编号、公交车编号等离散型特征因子进行分类编码,转化为分类型特征因子,利用方差检验分析分类型特征因子和公交车运行时间的相关关系;Step S32: classify and encode discrete characteristic factors such as weather type, driver number, bus number, etc., convert them into type-specific characteristic factors, and use variance test to analyze the correlation between the type-specific characteristic factors and the bus running time;
步骤S33:将不相关,相关性差的特征因子舍去,将所保留的特征与行程时间基础数据集进行匹配,获取行程时间预测数据集。Step S33: Discard irrelevant and poorly correlated feature factors, match the reserved features with the travel time basic data set, and obtain the travel time prediction data set.
进一步的,所述步骤S4具体为:Further, the step S4 is specifically:
步骤S41:将行程时间预测数据集输入到特征重要性提取模块中,根据特征的重要性差异,对特征分配不同程度的注意力,获得特征重要性矩阵;Step S41: input the travel time prediction data set into the feature importance extraction module, assign different degrees of attention to the feature according to the difference in importance of the feature, and obtain the feature importance matrix;
步骤S42:将特征重要性矩阵与模型的输入特征进行拼接,获得公交车运行状态矩阵;Step S42: splicing the feature importance matrix with the input features of the model to obtain a bus operating state matrix;
步骤S43:将公交车运行状态矩阵输入到时间特征提取模块中,利用双向LSTM,对公交车运行过程中的时间特征进行提取,生成运行时间特征矩阵;Step S43: Input the bus running state matrix into the time feature extraction module, and use the bidirectional LSTM to extract the time features during the bus running process to generate a running time feature matrix;
步骤S44:将获得的运行时间特征矩阵,输入到行程时间预测模块,将注意力融合到LSTM的时间步中,构建Attention_LSTM层,实现对不同时间距离的公交车的影响特征提取;在全连接层,使用均方根误差作为损失函数,将预测结果与实际结果进行对比,不断对模型进行训练;实现对公交车行程时间的预测。Step S44: Input the obtained running time feature matrix into the travel time prediction module, fuse the attention into the time step of LSTM, build the Attention_LSTM layer, and realize the feature extraction of the influence on buses of different time distances; in the fully connected layer , using the root mean square error as the loss function, comparing the predicted results with the actual results, and continuously training the model to predict the travel time of the bus.
一种基于双注意力机制和双向双层LSTM的公交车行程时间预测系统,包括A bus travel time prediction system based on dual attention mechanism and bidirectional double layer LSTM, including
特征重要性提取模块,使用注意力机制,获取各个特征的重要性权重,来生成特征重要性矩阵,区分不同特征对于公交车行程时间的影响,提高模型的预测效率和预测精度;The feature importance extraction module uses the attention mechanism to obtain the importance weight of each feature to generate a feature importance matrix, distinguish the influence of different features on the bus travel time, and improve the prediction efficiency and prediction accuracy of the model;
时间特征提取模块,利用双向LSTM较强的时间特征捕获能力,捕获前后运行的公交车的运行特征,获取公交车运行过程中的时间特征;The temporal feature extraction module uses the strong temporal feature capture capability of the bidirectional LSTM to capture the running features of the buses running before and after, and obtain the temporal features during the running process of the buses;
行程时间预测模块,将注意力引入到LSTM中,构建 Attention_LSTM层,对LSTM中的不同时间步给予不同的关注度,表现不同时间距离车辆对于公交车行程时间的影响。The travel time prediction module introduces attention into LSTM, builds the Attention_LSTM layer, and gives different attention to different time steps in LSTM, showing the impact of vehicles at different time distances on bus travel time.
本发明与现有技术相比具有以下有益效果:Compared with the prior art, the present invention has the following beneficial effects:
本发明将LSTM引入公交车行程时间预测中,一方面利用双向 LSTM捕获前后公交车运行过程中的时间特征;另外一方面,在双向 LSTM基础上,增加Attention_LSTM层,实现对不同时间距离的公交车的影响特征提取,有效提升了模型的预测精度;实现更准确的公交车预计行程时间,高效的公交调度。The present invention introduces LSTM into the bus travel time prediction. On the one hand, the bidirectional LSTM is used to capture the time characteristics of the front and rear buses during the running process; The impact feature extraction of the model effectively improves the prediction accuracy of the model; realizes more accurate estimated bus travel time and efficient bus scheduling.
附图说明Description of drawings
图1是本发明方法流程示意图;Fig. 1 is the schematic flow chart of the method of the present invention;
图2双注意力机制和双向双层LSTM的公交车行程时间预测模型结构图;Figure 2. Structure diagram of bus travel time prediction model with dual attention mechanism and bidirectional double-layer LSTM;
图3本发明实施例中B2公交路公交行驶线路图;Fig. 3 is a bus driving route diagram of B2 bus road in the embodiment of the present invention;
图4本发明实施例中所获得的行程时间预测结果与真实值对比图。FIG. 4 is a comparison diagram of the travel time prediction result obtained in the embodiment of the present invention and the actual value.
具体实施方式Detailed ways
下面结合附图及实施例对本发明做进一步说明。The present invention will be further described below with reference to the accompanying drawings and embodiments.
请参照图1,本发明提供一种基于双注意力机制和双向双层 LSTM的公交车行程时间预测方法,包括如下步骤:Referring to Fig. 1, the present invention provides a method for predicting bus travel time based on a dual attention mechanism and a bidirectional double-layer LSTM, comprising the following steps:
步骤S1、获取公交车属性数据和进出站数据,直接剔除重复记录和异常的数据并补全缺失数据。根据公交运营班次编号,将公交车属性数据和进出站数据进行匹配,获取各运营班次的公交车运行时间,构建行程时间基础数据集;In step S1, the attribute data and entry and exit data of the bus are obtained, and duplicate records and abnormal data are directly eliminated, and the missing data is filled. According to the bus operation shift number, match the bus attribute data with the inbound and outbound data, obtain the bus running time of each operating shift, and build a basic data set of travel time;
步骤S2、获取公交车的车辆编号、驾驶员编号、车辆发车时间、发车间隔等基础特征;获取上一天相似时间段、上一周相同特征日的相似时间段从始发站到终点站的运行时间等;获取车辆运行时的天气类型、湿度、风速、温度等天气特征,构建行程时间特征数据集;Step S2: Obtain basic features such as vehicle number, driver number, vehicle departure time, departure interval, etc. of the bus; obtain the running time from the starting station to the destination station in a similar time period of the previous day and the similar time period of the same characteristic day of the previous week etc.; obtain weather characteristics such as weather type, humidity, wind speed, temperature, etc. when the vehicle is running, and construct a travel time characteristic data set;
步骤S3、基于相关系数和方差分析,对特征数据集中的特征因子与行程时间进行相关性分析,舍去不相关和相关性差的特征因子,并与行程时间基础数据集进行匹配,获取行程时间预测数据集;Step S3, based on the correlation coefficient and variance analysis, perform a correlation analysis on the characteristic factors in the characteristic data set and the travel time, discard the characteristic factors that are irrelevant and poorly correlated, and match with the basic data set of travel time to obtain travel time predictions data set;
步骤S4、基于注意力机制和LSTM构建双注意力机制和双向双层LSTM神经网络公交车行程时间预测模型,将行程时间预测数据集输入到模型中,对公交车的行程时间进行预测,输出公交车的预计行程时间。Step S4, build a dual-attention mechanism and a bidirectional double-layer LSTM neural network bus travel time prediction model based on the attention mechanism and LSTM, input the travel time prediction data set into the model, predict the travel time of the bus, and output the bus The estimated travel time of the car.
实施例1:Example 1:
参考图3,本实施例以广州市B2路公交运营车辆为研究对象,选取了2020年10月1日至2020年12月11日工作日晚高峰 (17:00-19:00)的B2路上行公交车数据作为实例数据,具体实施方式如下:Referring to Figure 3, this embodiment takes the bus operating vehicles of B2 Road in Guangzhou as the research object, and selects the B2 road during the evening rush hour (17:00-19:00) on weekdays from October 1, 2020 to December 11, 2020 The bus data is used as instance data, and the specific implementation is as follows:
步骤S1、获取公交车属性数据和进出站数据,直接剔除重复记录和异常的数据并补全缺失数据。根据公交运营班次编号,将公交车属性数据和进出站数据进行匹配,获取各运营班次的公交车运行时间,构建行程时间基础数据集。In step S1, the attribute data and entry and exit data of the bus are obtained, and duplicate records and abnormal data are directly eliminated, and the missing data is filled. According to the bus operation shift number, the bus attribute data is matched with the inbound and outbound data, and the bus running time of each operating shift is obtained, and the basic data set of travel time is constructed.
1.收集数据。所收集的实验数据包括两部分:第一部分是静态数据,包含B2公交线路上的站台基础信息;第二部分是动态数据,包括B2公交车进出站数据,公交车属性数据。1. Collect data. The collected experimental data includes two parts: the first part is static data, including the basic information of the platform on the B2 bus line; the second part is dynamic data, including B2 bus entry and exit data, bus attribute data.
站台基础信息包括站台编号、站台经纬度、站台上下行标识等;公交车进出站数据包括路单ID、车辆编号、站台编号、站台名称、进站时间、出站时间、上下行标识、日期等;公交车属性数据包括路单ID、发车时间、车辆编号、驾驶员编号、线路类型、发车间隔等。The basic information of the platform includes the platform number, the latitude and longitude of the platform, the up and down identification of the platform, etc.; the bus entry and exit data includes the road list ID, the vehicle number, the platform number, the platform name, the entry time, the exit time, the up and down identification, the date, etc.; The bus attribute data includes road list ID, departure time, vehicle number, driver number, route type, departure interval, etc.
2.数据预处理。数据预处理主要包括公交车进出站数据预处理、公交车属性数据预处理、静态数据和动态数据匹配和行程时间获取。2. Data preprocessing. Data preprocessing mainly includes bus entry and exit data preprocessing, bus attribute data preprocessing, static data and dynamic data matching and travel time acquisition.
针对公交车调度数据预处理,主要是对重复记录的数据进行剔除,提取全程运行数据。For the preprocessing of bus scheduling data, the main purpose is to eliminate the repeated recorded data and extract the whole operation data.
针对公交车进出站数据预处理,包括剔除重复数据,校准异常数据、插值缺失数据和公交车行程时间获取。首先,对于重复记录的进出站数据直接剔除;其次,对异常数据进行处理,异常数据是指出现倒时、运行时间远小于平均站点运行时间等情况的数据,对其先剔除后进行插值填充;再次,对缺失数据进行处理,主要关注终点站到站时间缺失的数据。通过计算缺失站点内各部分平均行驶时间和平均停靠时间的占比,在缺失时间段内计算各部分插值时间,进行补全,最后,根据发车时间和终点站的进站时间获取所在运行班次的公交车行程时间。Preprocessing for bus entry and exit data, including removing duplicate data, calibrating abnormal data, interpolating missing data, and obtaining bus travel time. First, the inbound and outbound data of the repeated records are directly eliminated; secondly, the abnormal data is processed. The abnormal data refers to the data with time-down and running time far less than the average station running time, which is first eliminated and then filled with interpolation; Third, the missing data is processed, mainly focusing on the missing data of the terminal arrival time. By calculating the proportion of the average travel time and average parking time of each part in the missing station, the interpolation time of each part is calculated in the missing time period, and the completion is performed. bus travel time.
静态数据和动态数据匹配。根据公交运营班次编号将站台基础信息、公交车属性数据和公交车进出站数据进行匹配,获取行程时间基础数据集。Static data and dynamic data match. According to the bus operation shift number, the platform basic information, bus attribute data and bus entry and exit data are matched to obtain the basic data set of travel time.
步骤S2、获取公交车的车辆编号、驾驶员编号、车辆发车时间、发车间隔等基础特征;获取上一天相似时间段、上一周相同特征日的相似时间段从始发站到终点站的运行时间等;获取车辆运行时的天气类型、湿度、风速、温度等天气特征,构建行程时间特征数据集。Step S2: Obtain basic features such as vehicle number, driver number, vehicle departure time, departure interval, etc. of the bus; obtain the running time from the starting station to the destination station in a similar time period of the previous day and the similar time period of the same characteristic day of the previous week etc.; obtain weather characteristics such as weather type, humidity, wind speed, and temperature when the vehicle is running, and construct a travel time feature dataset.
步骤S3、基于相关系数和方差分析,对特征数据集中的特征因子与行程时间进行相关性分析,舍去不相关和相关性差的特征因子,并与行程时间基础数据集进行匹配,获取行程时间预测数据集。Step S3, based on the correlation coefficient and variance analysis, perform a correlation analysis on the characteristic factors in the characteristic data set and the travel time, discard the characteristic factors that are irrelevant and poorly correlated, and match with the basic data set of travel time to obtain travel time predictions data set.
1、利用皮尔逊系数相关系数对连续型特征(车辆发车时间、发车间隔、在运行班次的上一天相似时间段的行程时间、上一周相同特征日的行程时间、湿度、风速、温度)和公交车的行程时间做相关性分析。1. Use the Pearson coefficient correlation coefficient to analyze continuous features (vehicle departure time, departure interval, travel time in a similar time period on the previous day of the operating shift, travel time on the same characteristic day in the previous week, humidity, wind speed, temperature) and bus Correlation analysis of the travel time of the car.
2、利用方差分析对分类型特征(公交车辆编号、驾驶员编号、天气类型)和公交车的行程时间进行方差分析。2. Use variance analysis to perform variance analysis on classification features (bus vehicle number, driver number, weather type) and bus travel time.
3、根据相关系数和方差分析结果获得行程时间预测数据集。3. Obtain the travel time prediction data set according to the correlation coefficient and variance analysis results.
步骤S4、基于注意力机制和LSTM构建“双注意力机制和双向双层LSTM神经网络公交车行程时间预测模型”,将行程时间预测数据集输入到模型中,对公交车的行程时间进行预测,输出公交车的预计行程时间。Step S4, based on the attention mechanism and LSTM, construct a "dual attention mechanism and bidirectional double-layer LSTM neural network bus travel time prediction model", input the travel time prediction data set into the model, and predict the travel time of the bus, Output the estimated travel time for the bus.
1、基于Kares深度学习框架搭建双注意力机制和双向双层LSTM 的公交车行程时间预测模型。1. Build a bus travel time prediction model based on the Kares deep learning framework with dual attention mechanism and bidirectional double-layer LSTM.
2、对行程时间预测数据集进行划分,将2020年10月1日至2020 年12月4日的工作日晚高峰的B2路公交车运营数据用于训练;将 12月7日至12月11日的工作日晚高峰的B2路公交车运营数据用于验证。2. Divide the travel time prediction data set, and use the bus operation data of B2 during the evening rush hour on weekdays from October 1, 2020 to December 4, 2020 for training; use December 7 to December 11 The operation data of the B2 bus in the evening rush hour of the working day is used for verification.
3、将行程时间预测数据集中的训练数据输入到双注意力机制和双向双层LSTM的公交车行程时间预测模型中进行训练,以均方根误差为衡量指标。3. Input the training data in the travel time prediction data set into the bus travel time prediction model of the dual attention mechanism and the bidirectional double-layer LSTM for training, using the root mean square error as the measurement index.
4、对12月7日至12月11日的工作日晚高峰的B2路公交车的行程时间进行预测,输出预计行程时间。4. Predict the travel time of the B2 bus in the evening rush hour on weekdays from December 7th to December 11th, and output the estimated travel time.
遵循以上具体实施步骤,得到12月7日至12月11日的工作日晚高峰的公交车运行时间预测值和真实值对比图。基于本发明所预测得到的公交车行程时间预测时间,平均绝对误差为6.23%。Following the above specific implementation steps, a comparison chart of the predicted value and the actual value of the bus running time during the weekday evening peak from December 7 to December 11 is obtained. Based on the predicted time of the bus travel time predicted by the present invention, the average absolute error is 6.23%.
表1Table 1
如表1所示,表1双注意力双向双层LSTM模型各工作日晚高峰预测结果对比;As shown in Table 1, Table 1 compares the prediction results of the evening peak of each weekday of the dual-attention bi-directional double-layer LSTM model;
周一到周五,模型的表现力存在差异,在周一到周四具有较高的预测精度,其平均误差均低于总平均误差,在周一预测精度最好,平均绝对误差在3分钟左右。但在周五的预测精度明显下降,其平均绝对百分误差仅有8.88%,平均绝对误差在7分钟左右。通过对B2公交车线路进行分析可发现,B2公交线路具有两大特点。特点一,B2线路途经较多的高校,共计7所,分别为:广州工业大学、广州工程技术学院、广州体育学院、华南师范大学、暨南大学、广东邮电技术学院和广东技术师范学院;特点二,B2路线途径较多的百货商场和购物中心,共计16处,分别为:时光里、丽柏广场、新大新百货、广百百货、VT101维多利广场、天河城购物广场、正佳广场、万菱汇、太古汇、摩登百货、天娱广场、沃尔玛、骏唐购物广场、天河城百货、聚时代星座广场、东圃购物中心。因此,在周五晚高峰时段,较多的高校学生和市民前往各大百货商场和购物中心游玩,出行量相较于周一到周四明显增加。在该种情况下,一方面,公交车上下车人数明显增加,各个站点的公交车停靠时间发生变化,运行的时空规律复杂度增大;另外一方面,私家车和网约车出行量增加,导致公交所在的运营路线的路况变得更为复杂。因此,模型在对周五晚高峰的公交车辆的行程时间进行预测时,预测难度较大,难以在复杂的交通环境下,捕获公交车运行的时空规律,精度有所下降,但平均误差仍低于9%,总体满足公交公司的公交调度需求。From Monday to Friday, there are differences in the expressiveness of the model. From Monday to Thursday, it has a high prediction accuracy, and its average error is lower than the total average error. The prediction accuracy is the best on Monday, and the average absolute error is about 3 minutes. However, the prediction accuracy on Friday dropped significantly, with an average absolute percentage error of only 8.88% and an average absolute error of around 7 minutes. Through the analysis of the B2 bus line, it can be found that the B2 bus line has two characteristics.
在本实施例中,通过双注意力双向双层LSTM模型与其他神经网络模型实验比对,表2为双注意力双向双层LSTM模型与其他神经网络模型实验结果对比。In this embodiment, the dual-attention bidirectional double-layer LSTM model is compared with other neural network models experimentally.
表2Table 2
具体的,为了更好的分析特征重要性提取模块、时间特征模块和行程时间预测模块对于行程时间预测精度的提升效果,从两个方面对比该模型的预测精度。一方面,将该模型与其他的神经网络模型进行对比:与单注意力双向双层LSTM模型进行对比,相对精度提升7.98%;相较于无注意力双向双层LSTM模型,相对精度提升16.3%;相较于双层LSTM,相对精度提升19.3%。另外一方面,与传统方法的行程时间预测模型进行对比:相较于多层感知机,相对精度提升29.0%;相较于支持向量机模型,相对精度提升31.0%。由对比结果可知,特征重要性提取模块和时间特征模块对于提升公交车行程时间预测的准确性具有较大的提升,可以挖掘公交车运行过程中的深层时间特征,并更具针对性将不同特征融入到模型预测中,以获得较高的预测精度。Specifically, in order to better analyze the improvement effect of the feature importance extraction module, the time feature module and the travel time prediction module on the travel time prediction accuracy, the prediction accuracy of the model is compared from two aspects. On the one hand, the model is compared with other neural network models: compared with the single-attention bidirectional double-layer LSTM model, the relative accuracy is improved by 7.98%; compared with the non-attention bidirectional double-layer LSTM model, the relative accuracy is improved by 16.3% ; Compared with the two-layer LSTM, the relative accuracy is improved by 19.3%. On the other hand, compared with the travel time prediction model of the traditional method: compared with the multilayer perceptron, the relative accuracy is improved by 29.0%; compared with the support vector machine model, the relative accuracy is improved by 31.0%. From the comparison results, it can be seen that the feature importance extraction module and the time feature module have a great improvement in improving the accuracy of bus travel time prediction. Incorporated into model predictions to obtain higher prediction accuracy.
以上所述仅为本发明的较佳实施例,凡依本发明申请专利范围所做的均等变化与修饰,皆应属本发明的涵盖范围。The above descriptions are only preferred embodiments of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention shall fall within the scope of the present invention.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210007787.9A CN114328675B (en) | 2022-01-06 | 2022-01-06 | Bus travel time prediction method based on dual attention mechanism and bidirectional two-layer LSTM |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210007787.9A CN114328675B (en) | 2022-01-06 | 2022-01-06 | Bus travel time prediction method based on dual attention mechanism and bidirectional two-layer LSTM |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114328675A true CN114328675A (en) | 2022-04-12 |
CN114328675B CN114328675B (en) | 2025-01-14 |
Family
ID=81024754
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210007787.9A Active CN114328675B (en) | 2022-01-06 | 2022-01-06 | Bus travel time prediction method based on dual attention mechanism and bidirectional two-layer LSTM |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114328675B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114881303A (en) * | 2022-04-21 | 2022-08-09 | 海南大学 | A long-term prediction method of water quality based on dual attention mechanism |
CN115565376A (en) * | 2022-09-30 | 2023-01-03 | 福州大学 | Vehicle travel time prediction method and system fusing graph2vec and double-layer LSTM |
CN116596126A (en) * | 2023-04-27 | 2023-08-15 | 苏州大学 | Method and system for predicting bus crossing |
CN117192063A (en) * | 2023-11-06 | 2023-12-08 | 山东大学 | Water quality prediction method and system based on coupled Kalman filtering data assimilation |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110459056A (en) * | 2019-08-26 | 2019-11-15 | 南通大学 | A Bus Arrival Time Prediction Method Based on LSTM Neural Network |
CN111899511A (en) * | 2020-08-03 | 2020-11-06 | 西南交通大学 | Bus arrival time prediction method for AVL data of collinear line |
CN113470365A (en) * | 2021-09-01 | 2021-10-01 | 北京航空航天大学杭州创新研究院 | Bus arrival time prediction method oriented to missing data |
WO2021212866A1 (en) * | 2020-04-21 | 2021-10-28 | 长安大学 | Vehicle travel volume prediction model construction method, and prediction method and system |
-
2022
- 2022-01-06 CN CN202210007787.9A patent/CN114328675B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110459056A (en) * | 2019-08-26 | 2019-11-15 | 南通大学 | A Bus Arrival Time Prediction Method Based on LSTM Neural Network |
WO2021212866A1 (en) * | 2020-04-21 | 2021-10-28 | 长安大学 | Vehicle travel volume prediction model construction method, and prediction method and system |
CN111899511A (en) * | 2020-08-03 | 2020-11-06 | 西南交通大学 | Bus arrival time prediction method for AVL data of collinear line |
CN113470365A (en) * | 2021-09-01 | 2021-10-01 | 北京航空航天大学杭州创新研究院 | Bus arrival time prediction method oriented to missing data |
Non-Patent Citations (1)
Title |
---|
姚江涛 等: ""基于行程数据的公交车到站时间预测"", 《福州大学学报(自然科学版)》, vol. 51, no. 03, 30 June 2023 (2023-06-30), pages 347 - 354 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114881303A (en) * | 2022-04-21 | 2022-08-09 | 海南大学 | A long-term prediction method of water quality based on dual attention mechanism |
CN114881303B (en) * | 2022-04-21 | 2024-06-04 | 海南大学 | Water quality long-term prediction method based on double-attention mechanism |
CN115565376A (en) * | 2022-09-30 | 2023-01-03 | 福州大学 | Vehicle travel time prediction method and system fusing graph2vec and double-layer LSTM |
CN115565376B (en) * | 2022-09-30 | 2024-05-03 | 福州大学 | Vehicle journey time prediction method and system integrating graph2vec and double-layer LSTM |
CN116596126A (en) * | 2023-04-27 | 2023-08-15 | 苏州大学 | Method and system for predicting bus crossing |
CN117192063A (en) * | 2023-11-06 | 2023-12-08 | 山东大学 | Water quality prediction method and system based on coupled Kalman filtering data assimilation |
CN117192063B (en) * | 2023-11-06 | 2024-03-15 | 山东大学 | Water quality prediction method and system based on coupled Kalman filtering data assimilation |
Also Published As
Publication number | Publication date |
---|---|
CN114328675B (en) | 2025-01-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114328675A (en) | Prediction method of bus travel time based on dual attention mechanism and bidirectional double layer LSTM | |
CN109034566B (en) | A kind of intelligent dispatching method and device based on passenger flow above and below bus station | |
WO2021212866A1 (en) | Vehicle travel volume prediction model construction method, and prediction method and system | |
CN113177657B (en) | Rail transit passenger flow prediction method and device | |
CN105513337B (en) | The Forecasting Methodology and device of a kind of volume of the flow of passengers | |
CN103413443B (en) | Short-term traffic flow forecasting method based on hidden Markov model | |
CN106503869A (en) | A kind of public bicycles dynamic dispatching method that is predicted based on website short-term needs | |
CN112561187B (en) | A CNN-LSTM-based online car-hailing target order prediction method | |
CN107103758A (en) | A kind of city area-traffic method for predicting based on deep learning | |
CN112150207A (en) | Online taxi appointment order demand prediction method based on space-time context attention network | |
CN113380025B (en) | Vehicle driving quantity prediction model construction method, prediction method and system | |
CN110599236A (en) | Short-time parking demand prediction method based on GRU model | |
CN111861027A (en) | An urban traffic flow prediction method based on deep learning fusion model | |
CN110400462B (en) | Track traffic passenger flow monitoring and early warning method and system based on fuzzy theory | |
CN112419131B (en) | Method for estimating traffic origin-destination demand | |
CN111414719B (en) | Method and device for feature extraction and traffic demand estimation around subway stations | |
CN110490365B (en) | A method for predicting online car-hailing orders based on multi-source data fusion | |
CN111275971A (en) | Expressway traffic flow prediction method | |
CN112990536B (en) | Bus arrival time prediction method based on quantile convolution network | |
CN103606299A (en) | Parking space information sharing method based on smart phones | |
CN112488185A (en) | Method, system, electronic device and readable storage medium for predicting vehicle operating parameters including spatiotemporal characteristics | |
CN113380043B (en) | Bus arrival time prediction method based on deep neural network calculation | |
CN115565369A (en) | Hypergraph-based time-space hypergraph convolution traffic flow prediction method and system | |
CN115660501A (en) | Electric vehicle charging load adjustable margin evaluation method | |
CN112669595A (en) | Online taxi booking flow prediction method based on deep learning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |