1. Introduction
The widespread use of Global Positioning System (GPS)-enabled mobile devices has enabled the unobtrusive collection of myriads of location data for mobility analysis. As an example, mobility mining at community level [
1] allows to understand the dynamics of populations, the spatial distributions, and the categorization of mobility patterns of users in different communities [
2]. Furthermore, the development of human mobility-based services (MBS) has produced applications that adapt their behavior according to the user’s position and past mobility traces [
3]. These applications include recommender systems [
4,
5], individual’s mobility profiling [
5], mobility prediction using Hidden Markov Models (HMM) [
2,
6,
7], among others. Notably, the information generated by MBSs is of high relevance for large-scale developments, such as urban planning, traffic management, and more.
Mobility analytics commonly relies on a Mobile Cloud Computing (MCC) architecture on which the mobile device continuously acquires and transmits its location to a cloud-based system for off-line processing [
8]. Nevertheless, the transition to Internet of Things (IoT) technologies demands new requirements, such as autonomous operation, self-awareness, and fully distributed intelligence of devices [
9], which are hard to effectively achieve by relying exclusively on MCC. Additionally, MBSs in IoT must rely on simple yet efficient data processing techniques to achieve extended and continuous localization monitoring for accurate mobility understanding, also known as power minimized services [
10]. Such techniques should also consider that location data streams might be collected asynchronously, i.e., without a defined sampling frequency.
For IoT MBSs, on-device decision making enables on-line features with advantages over the MCC approach [
11]. For instance, on-line location analysis would provide nearly real time reactions at user-specific spatio-temporal scales [
5], a highly desirable feature in navigational services, assisted driving, etc. Also, on-device solutions reduce the cloud dependency and issues related to the time-varying wireless channel conditions, leading possibly to disconnections and/or uplink capacity bottlenecks. Furthermore, as location data transmissions to the cloud are mostly avoided, the on-device approach helps to deploy solutions with consistent performance regardless of the locally available infrastructure (3G, 4G); legal issues when offloading data to clouds in different countries are also avoided. Attending to these issues, we strongly believe that an on-device approach gives a more proactive role to connected devices in large-scale IoT systems. Given their large number, it is very plausible that many devices will be idle at every instant [
12]. Thus, a distributed and on-device approach will contribute to alleviate backhaul links bottlenecks, and to address MCC issues like device energy consumption, latency, and privacy reinforcement [
9,
12].
In this context, in our previous work [
13] we proposed a novel on-device cognitive sensing framework for IoT devices, on which we validated that cognitive features could be of use to characterize mobility from POIs and basic mobility events. Unlike existing approaches for on-device location tracking, we aim to enable the device with self-mobility understanding and contribute toward the distributed intelligence demanded by the future Cognitive IoT [
14].
Existing work on mobility modeling focuses on two kinds of approaches: spatio-temporal modeling and spatial movement modeling. The former aims to discover the prominent daily temporal habits as well as predicting future individual activities, meanwhile the later facilitates next-place and residence time prediction and the identification of departures from mobility routines [
2]. While probabilistic models (HMM) and traditional data mining algorithms (spatial clustering) work under the assumption that data is stored and always accessible, it becomes challenging to produce similar results on-the-fly. Thus, there is the need for solutions that model and extract mobility events from the GPS stream along with the plausibility to be implemented on device. In this article, we demonstrate how user’s mobility can be automatically captured in a comprehensive representation, a cognitive map, as an expanded spatio-temporal model suitable for further on-device individual mobility analysis. It is worth noting that although the term cognitive map has been employed in other disciplines to indicate the representation that humans mentally create from the space we interact with, in this work cognitive map refers to the spatio-temporal model that is created by a Cognitive Dynamic System. The cognitive map is constructed from events, structurally related to each other in the context of space and time, raised from the interaction between the device and its environment (POIs) during a learning stage; then in a testing stage this information could be exploited for mobility mining.
Our main contributions are: (a) a user-tailored spatio-temporal representation of mobility (referred to as a cognitive map), which is constructed from long exposure to simple individual mobility events, and (b) an event-based implementation consisting in a continuous perception-action cycle that incrementally constructs and updates the cognitive map on GPS-enabled mobile devices. Our cognitive map reflects the observed mobility from individuals, characterizing their regularity or patterns (if any). We validate the spatio-temporal accuracy of our approach to construct the cognitive map using an annotated database. Also, we outline how this cognitive map could be further exploited for mobility estimation and prediction, provided some regularity, without incurring in excessive computational and energy overheads. This shows experimental evidence for both, the accurate construction of the map with respect of fine-grain location data, and its exploitation for mobility mining on constrained mobile devices.
The rest of this article is organized as follows.
Section 2 summarizes the background of POIs, event-based systems, and the Cognitive Dynamic Systems (CDSs) framework.
Section 3 describes the event-based representation of mobility and the spatio-temporal modeling to construct the cognitive map.
Section 4 shows how the map can be further exploited for mobility prediction and place categorization, as well as its assessment based on spatio-temporal entropy. Experimental results are presented in
Section 5, followed by a discussion in
Section 6. Concluding remarks are presented in
Section 7.
2. Background
Characterizing the statistical properties of individual trajectories helps to understand the dynamics of human mobility. Broadly speaking, we consider a trajectory as the displacements between POIs and pauses at them, and we argue that studying the distribution of these pauses and traveled distances helps to assess such dynamics [
15,
16]. Interestingly, people have a very small number of POIs that are daily visited, and a higher but still limited number of POIs that are less frequently visited [
17]. As a result, the study and modeling of human mobility is feasible. We present a concise review of related approaches, some background of POIs, and event-based and cognitive frameworks. Herein after, we employ the symbols and notations in
Table 1.
2.1. Related Approaches
In this study, we focus on the use of mobile phone data to understand human mobility from the interaction of people with POIs. Previous work on this illustrates a pattern of preferential returns to previously visited locations and explorations of new places as a general and universal feature.
Yuan, et al. [
18] proposed a method for off-line GPS trajectory analysis to detect places and travel sequences. The method splits a trajectory in segments delimited by endpoints that represent the stop locations (POIs), so that most of the fixes are discarded in further computations. Endpoints are used to characterize a network of frequent paths between POIs, which are then employed to predict next user POI, provided the current trajectory is similar to existing ones. In [
19], authors present a mechanism to produce a compressed graph of an individual’s mobility. Authors identify POIs from cellular ID records, filtering those to which a user has been connected to for longer than an hour. Then, two stay points would be connected with an edge if the user has moved between their corresponding cells; the weight if the edge is the average traversing time. The sequence of POIs is used to build a graph, which is then compressed for a lightweight representation of the user’s mobility using the Shrink method. Similarly, in [
20] a mechanism to construct an individual-tailored mobility model is proposed. Using the off-line algorithm in [
21], authors calculate POIs and group them by spatial similarity. The POIs are sorted by arrival time and then are connected to reflect the sequence of POIs visited during the day in a directed graph. The more connections between POIs, the larger the edge weight. Another example of POIs sequence construction is proposed in [
22], on which POIs are also detected using the algorithm in [
21], for being later grouped using a hierarchical clustering algorithm. Clusters are assigned a semantic meaning (gym, store, etc.) using OpenStreetMap and authors construct the trajectories corresponding to the sequence of visits to such places. The trajectories are clustered using language processing techniques, which assist the prediction of places when a new trajectory is provided.
Notice that the above mining methods are founded on the assumption that data instances are independent and sometimes expecting that data is sampled with a constant frequency. Ignoring that data is structurally related to each other, both in space and time, can lead to poor accuracy and interpretability. Moreover, it is desirable to find suitable algorithms to extract meaningful stay locations for further analysis, reducing the noise in the big data.
In [
23], Kang et al. proposed a method suitable for mobile devices to calculate POIs in an on-line manner, based on spatio-temporal differences between individual location fixes. Such method queues fixes in a cluster as long as the traveled distance and elapsed time are within thresholds. Nevertheless, the distance evaluation and the queuing of fixes in a cluster requires the frequent recalculation of a cluster’s centroid, which can be an issue if many fixes are to be queued. Similarly, the connections between detected POIs are not investigated, and as a result such work merely acts as a yet efficient [
24] POIs detection mechanism, very much alike the ideas we explored before in [
25].
In this regard, our solution provides novel features for mobility analytics, as shown in
Table 2. In first term, the solution is completely on-device, suppressing the need for sharing data with external entities, which improves energy efficiency and contributes to user’s privacy since data is always kept locally. Secondly, it goes beyond the scarcely existing on-device approaches for POIs detection, as it explores the temporal attributes of the connections between POIs and how they can be exploited for further tasks such as POIs prediction and categorization. Such information is encapsulated in a spatio-temporal model that is incrementally constructed and updated reflecting user’s mobility and associated events, using the concepts described in the following text.
2.2. Trajectory and Points of Interest
Herein, we consider a trajectory as a sequence of GPS fixes, , and each fix, , with x, y, t as its latitude, longitude, and timestamp, respectively. The sequence’s length is , observed during the time interval .
Since trajectories intrinsically include time, they provide different semantics depending on whether they are analyzed according to spatial or spatio-temporal proximity [
26]. A POI refers to a trajectory
restricted within a geographical region with a spatial distance threshold
, where a user spent
units of time:
where
is the Haversine distance between two fixes.
A POI is defined as
, where
is the POI’s centroid computed as:
and
,
are the enter and exit times, respectively.
2.3. Event-Based Processing
Events are real-world occurrences that unfold over space and time, and that might involve a change in system’s state. Events can be atomic or complex. An atomic event is defined as , where is its unique identifier, are a set of n attributes that characterize it, and t is its occurrence timestamp. A complex event is defined as , and it is composed from atomic events using a function p, with and as its starting and ending times, satisfying . Instant-defined events are possible by specifying .
An event stream is an ordered event sequence, , where is atomic or complex. An event processing module consumes events and creates new (derived) ones using a set of p functions. The event processing module, event producers, and event consumers are inter-connected through push-style communication channels.
Notice that an atomic event, as the singlest piece of data that can be retrieved from sensors, can be associated with a single location fix, and a complex event can refer to an activity or behavior that is calculated from atomic events, for instance, a POI or the enter and exit from it. As it will be described later on, event-driven processing suits the process of complex activity recognition (in this case mobility), attending to the rich temporal dependencies between POIs and associated events [
27].
2.4. Reference CDS Framework
Herein, we briefly describe the reference on-device cognitive (CDS) framework proposed in [
13] for POIs and mobility events detection. Our CDS, overall architecture shown in
Figure 1, relies on a continuous perception-action cycle for events detection and mobility characterization in the cognitive map. The perceptors incrementally process asynchronous location data collected from the GPS receiver to detect new POIs and enter-exit events. We claim that long exposure to such events can help to incrementally summarize regular features of mobility in the form of a cognitive map, which would reside in the CDS perceptual memory. The map construction approach in this paper is only a possible way, yet simple and efficient, but other event-driven strategies could be employed as well.
The Probabilistic Reasoning Machine (PRM) could be able to exploit such cognitive map for knowledge extraction, mobility mining tasks like events predictions, and for generating cognitive actions. In the reference framework, cognitive actions are goal-oriented, for instance, in on-device MBSs adaptive GPS sampling can reduce energy consumption while performing an accurate perception. In this sense, a cognitive map can be considered as a basic component for adaptive behavior.
5. Evaluation and Experimental Results
We evaluated the performance of our cognitive map builder within the reference CDS considering the following aspects:
Its mobility characterization features, including the spatio-temporal accuracy of events detection.
Its ability for further on-device exploitation (mining).
Its feasibility for on-device execution, including an energy consumption assessment.
We conducted short-term experiments on a rather small but fully annotated database, consisting on trajectory data from 5 users using a dedicated fast sampling (1 Hz) GPS logger (QStarz GPS Logger device, model BT-Q1000EX, Taipei, Taiwan). All users explicitly labeled the POIs in trajectories, which include regular Work and Home routines of several weeks. Overall, we collected 19 trajectories from 5 users (min 3.26 days, max 34.31 days, avg. 10.8 days). The mobility information of these trajectories refer to daily routines, such as Home-Work and Work-Home commutes during weekdays, as well as some leisure places during weekends. For all the trajectories, the participant users mostly employed a vehicle as a transportation mode for moving between rather distant places As this database is labeled, we could measure the accuracy of the basic events that are used to construct the map. We also explored the findings of our solution under inconsistent mobility; to do so, we employed a subset of the Cabspotting database [
32], which includes mobility traces of taxi drivers, who are known for inherently irregular mobility; the subset was of 32 randomly selected 1-month taxi trajectories. Due to the many differences between our solution and existing works (no study of enter-exit events, no study of places categorization, etc.) we were unable to conduct a thorough comparison.
5.1. Implementation
We implemented the CDS reference framework with the map builder as a middleware for smartphones (Nexus 6 and Samsung Galaxy A5, with 3220 mAh and 2900 mAh batteries, respectively) running Android Operating System (OS) v7. We followed different workarounds to avoid energy-saving mechanisms at OS level that jeopardize continuous sampling [
13]. We also implemented a desktop version of the CDS using the Python 3 language to quickly evaluate CDS functionality using different parameters. The desktop CDS version employs files with collected traces (latitude, longitude and timestamp) to construct the map, and it allows to configure the sampling rate to stress the system under different sampling conditions.The source code for the desktop version of our platform is available at
https://github.com/s0lver/stm-creator.
It is worth noting that during its construction, the map evolves from a tensor to a directed multigraph. In the tensor, rows and columns hold the origin and destination POIs, so that when transition information from to is required, would provide all the transitions between such places. Each is in turn a container for each spatio-temporal link group of the list L from which we create the set of edges .
5.2. Cognitive Map Construction
We launched our CDS with the parameters shown in
Table 4. Note that these values are highly dependent on the information that shall be discovered (e.g., small values for
and
would reveal small POIs with short stay time). We focused on detecting relevant mobility attributes, hence the selected values.
Our CDS successfully created the cognitive map for all the trajectories of our annotated dataset.
Figure 5 shows a 2-week snapshot of the mobility of user 1 autonomously captured by the smartphone. The detected POIs and enter-exit events demonstrate that the CDS effectively perceives the input information to construct the cognitive map. Note the regularity of user 1 in
Figure 5; this information is promptly detected by the system to identify spatio-temporal mobility patterns that are incorporated in the cognitive map. The participant users validated the constructed cognitive maps using their labeled information.
Recall that the map construction process reflects the attributes of users mobility; as previously described, the cognitive map effectively detects patterns in regular mobility, but under inconsistent mobility there are no patterns to infer. In this regard, we also processed the Cabspotting database [
32] to construct the corresponding maps. Our system identified a high irregularity caused by the inherent mobility of most taxi drivers. We present more insights about such irregularity later in this section.
5.3. Cognitive Map Characterization
We measured the spatio-temporal accuracy of the cognitive map in terms of the POIs centroid distance, time difference of enter-exit events, and missed visits with respect of ground truth data (1 Hz) and a varying sampling rate. We generated the ground truth data by processing our labeled dataset with the CDS. Then, we processed the trajectories using a base sampling rate (within the set seconds) to study the degradation caused by reduced input data. This is relevant as IoT devices might not be able to collect location data with a high frequency due to energy constraints.
Table 5 shows the spatial accuracy of our map. Notice that despite the sampling rate, the missed POIs and centroid distance are small. Similarly,
Table 6 shows the temporal accuracy of the events employed to construct the map. Again, although a slow sampling rate introduces some degradation in terms of missed visits and increased time differences, in overall the detected events offer a reasonable accuracy for map’s construction. Missed visits are short, as in our 1 Hz dataset their average length is no longer than 80 s regardless of sampling rate. Although the observed results are highly dependent on the employed sampling rate and user’s mobility, they provide evidence for the CDS to be able to characterize mobility.
5.4. Human Mobility Mining
We also evaluated the exploitation of the cognitive map’s information for human mobility mining tasks as follows.
5.4.1. Place Categorization and POIs Relevance
We employed the stay time and visit frequency to POIs for their categorization using Equations (
7) and (
8).
Figure 6 shows the weights calculated from the cognitive map for user 1. For this user with regular mobility, Home and Work places are the most important POIs in terms of visit count (
) and (
) stay time. Nevertheless, interesting attributes of other places could be inferred from data; for instance, the
Fast food POI was occasionally visited but always during a short amount of time.
By applying k-means clustering to the obtained weights, we categorized POIs by visit count (into mostly, occasionally and exceptionally visited places), and by stay time (short, medium and long stay time), setting
.
Figure 7 shows both categorizations. Note that the centroids of these clusters (i.e., average stay times and visit counts) will be different for other users, as they interact with POIs at specific spatio-temporal scales. Since general thresholds are difficult to define, clustering techniques allow these groups to be user-tailored.
5.4.2. Mobility Prediction
We also explored the potential of the constructed maps for mobility prediction using the simple traversal-based prediction mechanism discussed in
Section 4.2. We used the fast sampling trajectories of our labeled dataset, defining one week as the learning period and the rest of each trajectory for testing. Focusing on the weekdays, after each exit event we generated a prediction for the next POI and enter time. As shown in
Table 7, during these trials the simple traversal-based predictor achieved an accuracy around 53–91%, with time differences of 29–110 min. Again, note that since the map is constructed by strictly sticking to users mobility, a consistent mobility will produce a map with a reduced set of spatio-temporal links, which in turn will enhance predictions’ accuracy.
Furthermore, as stated in [
2], given the diversity in prediction performance of different users, better prediction performance can be achieved for practical applications by applying different prediction models to users with distinct living habits. This is an issue that deserves to be further addressed in more detail, but the fact that the map includes a summarized representation of mobility represents a contribution toward more efficient prediction mechanisms that could be executed on-the-go.
5.4.3. Entropy of Mobility
Finally, under mobility mining we also performed a preliminary study of the entropy in the individual’s mobility during weekday’s hours. As shown in
Figure 8a, user 1 holds slight entropy variations during the intervals 7–11 and 16–22, which are explained by the differences of enter-exit times between
Home and
Work during mornings and evenings. The entropy is low for the rest of the day, which suggests consistent mobility. Evidently, under irregular mobility the entropy is expected to be higher. This was demonstrated after analyzing the Cabspotting database, on which we found high entropy values (
Figure 8b) indicating the mobility inconsistence of participant taxi drivers.
Observing the entropy profile over longer intervals might help to identify when the information in the cognitive map is no longer valid. An increasing entropy might imply the update of the cognitive map to account for new mobility patterns. Nevertheless, such decision also depends on the mobility profile, as some people inherently have a high entropy, like taxi drivers, delivery carriers or salespeople, whose mobility is hard to predict as studied in [
2]. We left for further study the definition of enhanced mechanisms based on the mobility entropy to specifically determine when the cognitive map can be safely updated.
5.5. Energy Overhead
Finally, using the following simple approaches, we measured the energy overhead caused by the map builder, which is of relevance in IoT systems with battery-powered devices.
5.5.1. Energy Consumption with and without Cognitive Map
We measured the energy consumption of a fixed sampling rate under two conditions:
The map builder was enabled (including events detection by and ).
The map builder was disabled (GPS data was simply collected but unprocessed, i.e., the smartphone was mobility-agnostic).
To incorporate the consumption of accelerometer data processing, we also detected the transportation mode for each collected location fix. The transportation mode is useful to further refine the information in the map, for instance, to identify how users move between POIs. We ran experimental trials using the Nexus 6 smartphones, which were carried together by a user to observe the same mobility and GPS satellite signal conditions. We switched the role of each smartphone to reduce, at some extent, the battery health factor in the trials.
Figure 9 shows the battery burnout of both implementations under a 30-second sampling rate. We also ran trials using a 60-second sampling rate. Overall, the smartphone executing the map builder achieved 98% of the running time of the agnostic smartphone, indicating only a slight impact on the energy resources of the mobile device.
5.5.2. Energy Consumption of Perceptors
In the second approach, we estimated the energy overhead of perceptors using mobile apps that continuously invoked each perceptor using synthetic data (energy of data collection was discarded). We simulated an individual travelling around the world as the worst scenario for and modules (i.e., continuously trying to create a POI, and never entering to any POI, respectively). For the module, we input 12 POIs to the cognitive map, causing 12 distance calculations per fix.
Figure 10 shows the estimated energy consumption of perceptors in two different smartphones. Based on this data, the Nexus 6 could continuously execute the
and
modules during 60.15 and 46.35 h, and the Galaxy A5, for 20.2 and 22.85 h. Notice that such continuous modules execution is not realistic, as energy would be consumed by other components and tasks run by the mobile platform. Nevertheless, from these results we do not identify a critical reduction of battery life; indeed, users are likely to charge their smartphones each day so that interrupted operation is avoided.
6. Discussion
The experimental results demonstrate the efficiency of the cognitive map to characterize user’s mobility with spatio-temporal accuracy with respect of high frequency GPS ground truth data. We also demonstrated that the cognitive map can be exploited for on-device mobility mining tasks such as POIs relevance, mobility prediction, and how its validity can be assessed via mobility entropy.
The cognitive map captures the regularity in user’s mobility (if any), which is relevant for further on-device mobility mining. In this regard, even a simple traversing-based prediction mechanism is possible thanks to the underlying graph of our map. Nevertheless, this could be improved with more complex strategies aimed at exploiting the spatio-temporal relationships for accuracy improvements. Moreover, additional experiments on mobility-diverse datasets are needed to obtain more conclusive assessments on prediction.
Although not explored in this article, mobility prediction can be exploited toward energy efficiency during POI visits and trajectories. In this regard, next POI predictions by the PRM might fail due to multiple factors causing uncertainty and risk. An active exploration approach aware of these factors could aid the system to update its predictions on the go. More specifically, mobility gradients [
33] could account for the changes in distance when people move, selecting the POI with the lowest gradient as the predicted destination. Not every POI should be included in such calculation, only those with existing links to current POI. Also, fine-grain mobility from accelerometer could aid sampling rate adjustments based on the speed (transportation mode) of the user.
7. Conclusions
We proposed a spatio-temporal cognitive map focused on modeling mobility in a per-user basis. The construction of the map follows an event-based representation of mobility on which the events that arise from user interaction with POIs are accounted for spatio-temporal mobility characterization. Rather than isolated, the cognitive map is a fundamental component of a fully functional CDS implemented in smartphone devices, which has the advantage of being decentralized and following a personalized scheme that gradually constructs the cognitive map without off-line training. The construction process is simple and energy efficient, which is a very looked feature for restricted IoT devices. We also provided experimental evidence of the exploitation of the cognitive map, and presented the entropy of the observed mobility patterns as a possible way to assess the validity of the learned information. We stress that evaluation results will be highly dependent on the regularity of user’s mobility, which if exists will be reflected in the constructed map.
Moreover, we argue that CDS systems might allow IoT devices to adapt to their dynamic environment and adjust their performance parameters accordingly. Besides the interesting results obtained in this work, many issues concerning individuals’ mobility are of great interest for further research. Cognitive control should be explored taking advantage of the cognitive map to adaptively adjust GPS sampling rate during visits and trajectories, while preserving the information about individual’s mobility without much redundancy.