# Travel Time Prediction on Long-Distance Road Segments in Thailand
## 1 Introduction  
For data-driven smart cities, predictive mobility is a key factor that can help city officers monitor the performance of traffic [1, 2, 3]. Having predictable traffic and travel times is important for traffic management authorities if they are to maintain proper policies and solve traffic problems. Furthermore, to achieve these aims, historical traffic data have become a key factor in the development of prediction models [4]. Accurate travel time prediction assists the various stakeholders such as drivers, travelers, and transportation agencies in transportation, making proper route plans, and managing traffic lights. In addition, predictable traffic facilitates good travel planning and helps reduce environmental problems because the release of carbon dioxide in traffic congestion is higher than that in free-flow traffic [5, 6].  
City mobility data are essential to the task of precisely predicting travel time on roads [4]. Owing to a collaborative project between King Mongkut's Institute of Technology Ladrakang and the Department of Land Transport of Thailand, some global positioning system (GPS) tracking data of trucks in Thailand have become available, which were beneficial to our study. Most of the data are for long-distance driving trucks. The dataset entry includes the masked identifier of each vehicle, the timestamp, the latitude, and the longitude, all of which were received from a GPS device for each truck at every minute; some example data are shown in Section 3.1. A thorough literature search revealed that there are research studies that have attempted to conduct travel time prediction, and most of these have taken advantage of time-series data analytics. Several studies, such as those in [7, 8, 9], used the Auto-Regressive Integrated Moving Average (ARIMA), a well-known statistical method for predicting travel time. Some machine learning techniques, such as Support Vector Regression (SVR), were also adapted to carry out regression analytics for travel time [10, 11, 12]. In addition, in recent years, researchers of travel time prediction have adopted neural network-based approaches such as Long Short-Term Memory (LSTM) [4, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] and its enhancement, Convolutional LSTM (ConvLSTM) [14, 22], together with attentions [13, 14, 16] and filters [8, 23, 24] to improve their prediction models.  
To introduce an approach to the prediction of long-distance travel time, we analyzed the time series data according to the average of the travel time every hour from all the trucks between the end points of 10 selected road segments. Our approach uses travel time over a period of 24 h to predict travel time in the following hour. We implemented some techniques from the related work shown in Section 4.1. LSTM provided the best performance against our dataset, so it was selected as a baseline. However, as we interpreted the Mean Absolute Error (MAE) of the LSTM, the error of 27.12 min per 100 km was considered highly inaccurate. Thus, in this study, we aimed to improve the LSTM using techniques that are often adopted in time-series analytics in order to reduce the MAE. In this case, a filter and attention were considered, and it was found that using the self-attention LSTM (SA-LSTM) model together with the Butterworth low-pass filter reduced the MAE to 12.15 min per 100 km.  
This manuscript is organized into five sections. First, the background and the objectives of this research are introduced in the Introduction. Second, the technical background from related work is reviewed in the Literature Review. Third, the data preparation, baseline implementation, our approach, and the experiment steps are described in the Materials and Methods section. Next, the results of all the experiments are shown in the Results and Discussion section. Finally, conclusions are drawn, and suggestions are offered in the Conclusion.