| Urban public transportation vehicles are an important part of the public transportation system and are closely related to the travel of urban residents.Effective management and detection of the operation of public transportation vehicles is a key link in urban traffic governance.Due to the public transportation vehicles operating on fixed operating routes and stopping at fixed bus stops midway,the speed of public transportation vehicles exhibits certain regularity in continuous time series.The driving process of public transportation vehicles is disturbed by various behavioral activities of other transportation entities,including passengers,drivers,pedestrians and motor vehicles.Abnormal situations occur frequently during the operation of public transportation vehicles,and the speed of public transportation vehicles also has randomness.Therefore,based on bus speed time series data with dual attributes,conducting bus speed prediction and anomaly detection research has important theoretical guidance value and practical significance for urban bus operation management.In view of this,based on the characteristics of time series speed of public transit vehicles,considering the correlation between the historical speed data and the current speed data,this paper constructs a speed prediction model based on the extreme gradient boosting decision tree algorithm(XGBoost).The prediction model converts the time series into supervised learning series as the input variable of the prediction model,realizes prediction by building a sliding time window,and introduces the Optuna parameter optimization method.With the objective of minimizing the loss function,the optimal parameters of the prediction model are obtained by traversing the parameter space.The mean absolute mean error(MAME)is proposed as a supplementary indicator for the evaluation of prediction models,avoiding the impact of the size of the prediction dataset on the evaluation results.Based on the bus speed prediction,a hierarchical dynamic threshold that based anomaly detection method is proposed to deeply analyze the internal composition of vehicle speed data.Based on the regularity,the vehicle speed data is decomposed into STL time series to obtain trend components,periodic components and residual components.Each component is predicted hierarchically and the error sequence between the predicted value and the actual value is solved.The dynamic threshold method is used to calculate the threshold of each component.According to the influence of components on the change of vehicle speed data,the component threshold is weighted and summed to obtain the total threshold.Finally,the total threshold is compared with the absolute value sequence of vehicle speed prediction error before decomposition.Those greater than the threshold are considered as outlier,and the abnormal time is output.The research results show that in the actual GPS dataset of Jakarta public transportation,the prediction model based XGBoost performs well.After optimizing the parameters using the Optuna framework,the final optimization iteration results and parameter importance ranking are obtained.The prediction model based Optuna can overcome the shortcomings of local parameter optimization and long optimization time.At the same time,by comparing Kalman filtering,random forest,CNN and CART algorithm,the prediction model based on XGBoost has MAE of 5.225,RMSE of 6.890 and MAME of22.717%.The evaluation indicators are smaller than the prediction results of other comparison models.Meanwhile,R~2_adjusted value is 0.638,indicating better fitting performance,further proving that the prediction model proposed in this paper performs more accurately.The layered dynamic anomaly detection model can detect four abnormal periods in the validation dataset,indicating the start and end times of the abnormal periods.Compared with the fixed threshold method,LOF,and DBSCAN methods,the detection method proposed in this article avoids the drawbacks of traditional detection,can more comprehensively locate abnormal data,reduce false positives in abnormal detection,and verify the effectiveness of the layered dynamic threshold detection method.It helps to improve the detection efficiency of abnormal situations during public transportation operation and ensure smooth and efficient operation of public transportation. |