**Alessandro Crivellari \* and Euro Beinat**

Department of Geoinformatics—Z\_GIS, University of Salzburg, 5020 Salzburg, Austria; euro.beinat@sbg.ac.at **\*** Correspondence: alessandro.crivellari@sbg.ac.at

Received: 27 October 2019; Accepted: 26 December 2019; Published: 1 January 2020

**Abstract:** The increasing availability of trajectory recordings has led to the mining of a massive amount of historical track data, allowing for a better understanding of travel behaviors by revealing meaningful motion patterns. In the context of human mobility analysis, the problem of motion prediction assumes a central role and is beneficial for a wide range of applications, including for touristic purposes, such as personalized services or targeted recommendations, and sustainability studies related to crowd management and resource redistribution. This paper tackles a particular case of the trajectory prediction problem, focusing on large-scale mobility traces of short-term foreign tourists. These sparse trajectories, short and non-repetitive, lack spatial and temporal regularity, making prediction analysis based on individual historical motion data unreliable. To face this issue, we hereby propose a deep learning-based approach, taking into account the collective mobility of tourists over the territory. The underlying semantics of motion patterns are captured by means of a long short-term memory (LSTM) neural network model trained on pre-processed location sequences, aiming to predict the next visited place in the trajectory. We tested the methodology on a real-world big dataset, demonstrating its higher feasibility with respect to traditional approaches.

**Keywords:** deep learning; LSTM; neural networks; location prediction; trajectories; smart tourism

#### **1. Introduction**

Human mobility analysis has gained increasing popularity due to the recent growth in people's location information availability in the form of massive trajectory data sets. Motion behaviors can be passively collected by mobile phones in terms of cell tower connection or GPS signal, or even actively shared by users on social media platforms. These large volumes of geo-located data enable the opportunity to reveal and integrate motion patterns in a wide variety of contexts [1,2], from recommendation systems [3,4] to mobility modeling applications for smart city and smart enterprise [5,6].

The rise of positioning technology and motion data availability has particularly boosted location prediction analysis, which has become a very active research area in the big picture of location-based services. Location prediction is interpreted as inferring the short-term future location of an individual, leveraging his/her current place, past motion activity, and possibly additional side information. Depending on the context, it may imply very different problems and approaches, comprising motion flow modeling [7–9], individual large-scale mobility analysis [10–12], and very fine resolution systems [13–15].

While the majority of works dealing with the prediction of individual mobility traces are set in contexts with a high level of spatial and temporal regularity (e.g., motion activity of users in everyday life), our paper contributes to extend trajectory prediction analysis in the opposite direction, when individual motion regularity is lacking due to the non-repetitiveness of single mobility traces.

Our focus and intended application is related to tourists' mobility within the growing field of smart tourism. Smart tourism integrates tourism resources with information technologies to design intelligent services to provide valuable outcomes to tourists and tourism-related industries. The development of smart tourism is particularly embodied in four main aspects, namely tourism experience, tourism management, tourism service, and tourism marketing [16–19]. The tracking and recording activity of space-time paths of individual tourists is inserted in this big wave of tourism mining, not as an ultimate purpose, but as a mean of providing valuable knowledge of tourists' mobility and travel behaviors. However, although spatial-temporal trajectory data have been widely utilized in studies of tourists' behavior, their use has been mainly limited to descriptive purposes at the level of clustering and pattern analysis [20–23]. But if forestalling actions require consideration, predictive investigations become an essential tool.

Our case study targets short-term tourists in a foreign country. Foreign tourism is major source of income for the tourism industry and it is an area of investigation for public and private organizations. Most destination strategies define measures specifically designed for foreign tourists, which have different behaviors and spending patterns compared to domestic users. For this reason, the unfolding of their tourism experience is used to understand and possibly leverage the insights to improve tourism policies and decision-making.

While in everyday life a person's mobility is described by a significant probability of returning to a limited number of highly frequented locations (e.g., home and workplace) [24–26], the natural characterization of foreign tourists' motion behavior is based on short and non-repetitive trajectories of users moving in areas they have never been to. The lack of individual historical location data leads methods relying on a set of individual pre-recorded motion trajectories to performing poorly when applied to traces covering areas that are unfamiliar to the user; a prediction algorithm solely based on a sequential approximation of a single probability distribution is not effective in this case. In addition, the focus on large-scale mobility often implies a very wide territory, introducing further problems such as trajectory data sparseness and a multitude of locations, involving the curse of dimensionality.

The proposed method aims to overcome these issues with the use of a deep learning-based approach that leverages the collective mobility of users over the territory. The method consists of a long short-term memory (LSTM) neural network trained on pre-processed location sequences to learn the underlying patterns of tourists' motion activity. Original traces are first transformed into discrete location sequences, and are subsequently fed into a deep neural network model composed of embedding and LSTM layers. The model captures motion patterns directly from mobility traces, without requiring any manual feature extraction. Each individual user's mobility prediction is therefore based on the collective analysis of tourists' behavior over the territory. For a wider application in various contexts, we do not resort to any additional information besides the users' motion traces, since useful secondary information is not available in many cases. In this way, the model can be applied to a variety of geo-located data types, as long as the recorded positional data generated by users can be properly organized into mobility traces in the form of sequences of locations.

Experiments on a real-world large-scale big dataset prove the higher feasibility of our forecasting method with respect to traditional approaches in this mobility regime, standing out as a potentially beneficial methodology for many real-life applications, including touristic services for personalized recommendations, targeted advertisement, and sustainability studies related to crowd management and resource redistribution. In general, this study contributes to the expansion of tourists' mobility analysis in the direction of actively integrating artificial intelligence into the tourism sector.

#### **2. Related Work**

The rise of motion data availability has boosted the interest in human mobility analysis, establishing various methods for trajectory data mining [27,28] to either describe the observable motion behavior [29] or to predict future activities [30].

Location prediction has a central role in human mobility analysis and is applied to numerous tasks such as crowd management, congestion prediction, transportation planning, and place recommender systems [31,32]. In the past few years, plenty of predictive models have been suggested, leveraging various methods including Markov models [33,34] and data mining approaches [35–37]. Previous research on location prediction can be roughly split into two broad groups: motion regularity-based methods and multiple mobility-based methods.

The first group is based on the regularity of individual user's motion history. Since most people tend to follow regular motion patterns in daily life, often returning to the same few locations, their personal past mobility is a valuable factor to predict their future trajectories [24–26]. Therefore, the majority of works on predicting a person's next visited location rely on historical motion data collected from this person exclusively, evaluating the regularity patterns in human mobility by learning individual, frequent traveling routes [38,39]. In this sense, the most common approach is the use of Markov models, representing locations as states and movement between locations as transitions [11,12,40]. States are defined by partitioning space into grids or reference points, and transition probabilities are defined by counting each user's transitions, identifying the most likely next destinations for each current location. This type of model achieves good performances in the presence of long, pre-recorded motion trajectories of the particular user under study.

The second group comprises methodologies combining individual past locations with collective motion information from multiple users. A subgroup is represented by collaborative filtering to find similarities among users' preferences in frequently visited destinations [41]. This includes methods for classifying users' preferences into point of interest categories [42] and recommendation systems based on generic, top interesting places or personalized location matching [43]. Another subgroup focuses on geographical elements, predicting the next locations based on the definition of features for each place and the relationships between places. These methodologies do not model individual preferences or similar preferences among users, but make predictions by using geographical statistics [44,45]. A final subgroup includes motion pattern mining techniques and prediction algorithms combining individual current movements with historical collective data to find frequent patterns and co-occurrences of locations. The methods comprise ensemble probabilistic algorithms [46,47], feature-based machine learning methodologies [48,49], and deep learning models [50,51] to predict users' locations over time, based on individual and collective behaviors.

In general, when people rarely share their history of past visited places with other users, location prediction methods based on previously seen locations of an individual user are likely to be chosen over other methodologies. However, in the case of irregular individual motion patterns, short data history users, and non-repetitive mobility behaviors, prediction algorithms approximating single probability distributions are not reliable and multiple mobility-based methods may be preferred. Moreover, it is worth mentioning that a large number of methods enrich trajectories with further context data, such as prior knowledge of motion information (e.g., acceleration, orientation) [11], external data (e.g., weather, social media analysis) [52,53], or user-specific features (e.g., home and workplace, user specific preferences) [44,54–57]. In these cases, the main disadvantage is of a practical nature, since secondary information is often insufficient or not available.

Over the last decades, academics and practitioners have increasingly approached the study of tourists' movements [20,58,59] and how to guide practical measures based on these findings [60–62]. Most studies focused on mapping and modeling movements between locations [21,63], as tourist destinations are involved in a complementary relationship [64,65]. These include travel itinerary models [66] and spatial pattern examination of travel flows [67,68], often leveraging a variety of measures within the study framework [21,69]. Only few studies, however, exclusively involved international visitors [70,71]. While the interest in mining movement patterns of tourists has been prominent, and studies are developing fast for collectively estimating the overall amount of visitors within single destinations [72], the explicit prediction of individual short-term tourists' mobility traces

still requires further expansion, being mainly based on Markov approaches for modeling location transitions [47,58,59].

This paper therefore introduces a deep learning model to predict individual trajectories of short-term foreign tourists. Its characteristics comprise: leveraging the collective mobility of people to predict individual traces, falling in the category of multiple mobility-based algorithms; learning mobility patterns without any manual feature extraction or secondary context data by simply feeding the model with sequences of locations, from a purely data-driven perspective; explicitly designed to predict the next location of a user, specifically when a very short data history is known about that user. The use of LSTM is tested in this particular mobility regime of short and non-repetitive traces to assess its feasibility when applied to large-scale movements of visitors in a foreign country.

#### **3. Methodology**

The proposed prediction method aims to model patterns hidden in the historical motion data of multiple people, in order to identify the most likely future movement of an individual user. Given a short mobility trace sampled at a given time step, the solution of our model consists of inferring the future visited location in the next time step. This section reports the details of the proposed methodology, from trajectory pre-processing to deep learning modeling.

#### *3.1. Trajectory Pre-Processing*

The first step of the path from original mobility traces to location prediction is characterized by trajectory discretization, a pre-processing phase transforming raw traces into the input for the neural network model.

An original mobility trace is described by a series of chronologically ordered track points *T* = *pi <sup>i</sup>* <sup>=</sup> 1, 2, 3, ... , *<sup>N</sup>* , generated by an individual user, whereby each point is defined by a coordinate pair enriched with a time stamp *pi* = (*loni*, *lati*, *ti*). The trajectory discretization task consists of aggregating continuous values of longitude and latitude into discrete locations and transforming the continuity of time into fixed time steps. This results in a pre-processed trajectory in the form of a sequence of locations (*LOC*1, *LOC*2, ... , *LOCN*), where, given a time step unit *t*, locations refer to time (*t*, 2*t*, ... , *Nt*). Time information is therefore encoded in the position along the sequence and the location associated to each time step is chosen as the one identified by the majority of track points recorded within that time period. The length of the time step is case specific, depending on the data source and the prediction problem: a short unit increases fragmentation in the presence of discontinuous traces and low time resolution data, a long unit may compromise a proper trajectory representation affecting prediction results. Moreover, even spatial resolution varies according to the data source, and may be further discretized (e.g., through clustering, reference point definition, and grid-based approaches) in relation to the time resolution and the specific purpose of different applications (e.g., prediction of motion traces over a whole country or mining city-level mobility). This is particularly suggested when trajectories are very sparse and there are many locations with only very few occurrences. In addition, because human mobility is not generally uniformly distributed over the territory, locations that are potentially inaccessible or irrelevant should be discarded; only those locations that are seen by a sufficient amount of people should be considered, avoiding bias samples in the data and worthless computational effort. The result should consist of a set of fixed points (or areas) over the territory, each of them associated with a particular unique identifier. A pre-processed trajectory is made of a sequence of these discrete locations unfolding in fixed time steps.

#### *3.2. Deep Learning Model for Trajectory Prediction*

The collection of the pre-processed trajectories from multiple users, in the form of sequences of unique location identifiers, is used as input data to the deep neural network model. The model is made of three building blocks: an embedding layer, a block of one or more LSTM layers, and a softmax layer. Each location identifier is initially associated to a particular corresponding embedding vector, encoding input trajectories into sequences of embeddings that are subsequently fed to the LSTM block, made of stacked LSTM neural network layers. The final trajectory representation, output vector of the last LSTM layer, becomes the input of a softmax layer for generating the probability distribution of the next predicted location in the trace. A graphic exemplifying overview of the whole model, with a block of two LSTM layers, is illustrated in Figure 1.

**Figure 1.** Exemplifying overview of the deep neural network model using a block of two long short-term memory (LSTM) layers and a four-location trajectory.
