# Modeling Users' Performance: Predictive Analytics in an IoT Cloud Monitoring System

Rosa Di Salvo, Antonino Galletta, Orlando Marco Belcore, Massimo Villari

► To cite this version:

Rosa Di Salvo, Antonino Galletta, Orlando Marco Belcore, Massimo Villari. Modeling Users' Performance: Predictive Analytics in an IoT Cloud Monitoring System. 8th European Conference on Service-Oriented and Cloud Computing (ESOCC), Sep 2020, Heraklion, Crete, Greece. pp.149-158, 10.1007/978-3-030-44769-4_12 . hal-03203278

HAL Id: hal-03203278

https://inria.hal.science/hal-03203278

Submitted on 20 Apr 2021

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
# Modeling Users' Performance: Predictive Analytics in an IoT Cloud Monitoring System

Rosa Di Salvo¹, Antonino Galletta¹, Orlando Marco Belcore² and Massimo Villari¹

(1) University of Messina, MIFT Department, IT

rdisalvo, angalletta, mvillari@unime.it,

(2) University of Messina, Department of Engineering, IT

obelcore@unime.it,

**Abstract.** We exploit the feasibility of predictive modeling combined with the support given by a suitably defined IoT Cloud Infrastructure in the attempt of assessing and reporting relative performances for user-specific settings during a bike trial. The matter is addressed by introducing a suitable dynamical system whose state variables are the so-called origin-destination (OD) flow deviations obtained from prior estimates based on historical data recorded by means of mobile sensors directly installed in each bike through a fast real-time processing of big traffic data. We then use the Kalman filter theory in order to dynamically update an assignment matrix in such a context and gain information about usual routes and distances. This leads us to a dynamical ranking system for the users of the bike trial community making the award procedure more transparent.

## 1 Introduction

In last years, Smart Cities are becoming more and more popular. There are several definitions of Smart Cities: according to Gifflinger et al. [1] a city becomes smart only if the performance indicators improve for several interconnected areas, such as economy, people, governance, environment, living and mobility; according to [2] and [3], e-health is a sub-area of the ICT strategies of smart cities. Smart mobility is emerging as a solution for many issues related to air and noise pollution, traffic congestion [4], transport and goods distribution slowness. In order to boost in this direction several initiatives have been proposed from local municipalities such as: i) discounts on the purchase of season tickets for public transport; ii) car pooling; iii) free loan for the use of bikes, etc. In this paper, considering as starting point the project "A scuola e a lavoro con il TPL", an Italian project funded by the ministry of the environment, we propose a model to quantify and predict the use of bikes in order to assign penalties or awards to users based on their behaviour. Aim of the paper is therefore to define a forecasting system based on real information as accurate as possible to be used for evaluating the level of activity of trail users on usual routes by monitoring behavior consistencies or progresses towards a more bike-friendly attitude compared to previous habits. More specifically, we proposed a system that, starting from the analysis of usual routes and distances (gathered by means of IoT sensors installed on bikes), by using Kalman filtering techniques inside a discrete-time dynamical system formulation let us to properly simulate traffic flows.
In view of the growing development of Smart City technologies, the IoT Cloud system for traffic monitoring described in this paper accounts for real-time information and provides prompt availability of a rich source of data to be exploited within a Kalman filtering approach in order to improve real-time path predictions and properly simulate traffic flows.

The remainder of the paper is organised as follows: Section 2 describes related works. Background and basic technologies are described in Section 3. Motivation are discussed in Section 4, proposed reference architecture and algorithms are discussed in Section 5. Finally, conclusions and our future directions are summarised in Section 6.

## 2 Related Work

It is well-known how the use of statistical methods in predicting specific parameters offers the opportunity to analyse huge amount of data and optimise a wide set of resources. In particular, a vast number of contributions dealing with the process of modelling traffic characteristics and developing shortterm traffic forecasting algorithms have been proposed and presented in the literature (see [5] for a critical discussion concerning the selection of the proper methodological approach). Moreover, in the last few years, numerous research studies have been conducted in order to address the relevant issue of collecting traffic data coming from sensors installed on roads and possibly sending alert messages to users. IoT Cloud systems with connected vehicles integrated with mobile sensors for traffic monitoring aimed at big traffic data processing, that is vehicular Cloud computing, actually assume a relevant role in road traffic management [6]. In [7], where an IoT Cloud system for traffic monitoring and alert notification based on OpenGTS and MongoDB is described, it turns out how the need to resort to big data and Internet issues appears as a necessary requirement when dealing with data recovery and data processing related to sensing systems in urban scenarios. This matter becomes especially important because of the exponentially increasing of information to be stored and dynamically recovered to control and manage vehicular traffic (see also [8] and [9] further details). In the emerging field of systems and computing paradigms for big data storage and analytics [10], the traffic monitoring approach proposed in [7] offers a flexible, scalable and inexpensive way to collect sensor data from private vehicles.

Since traffic forecasting represents in general an important learning task in the transportation domain intended as a dynamic environment, a large amount of literature has been concerned with the development of Intelligent Transportation Systems (ITS) technologies [11], as well as with producing predictions from time series models ranging from ARIMA to nonlinear multivariate modeling [12], or involving neural networks [13]. Possible frameworks for producing shortterm traffic forecasting models in realtime intelligent transportation systems may be based on several methodological approaches, such as Kalman filtering [14], exponential filtering [15], non-parametric statistical methods [16], multivariate state space analyses [17] or sequential learning [18].

In this direction, kept in mind the overwhelming progress of technologies, a composite modeling approach mixing tools derived from statistical analysis and ITS services would seem to provide an appealing setting with interesting perspectives.
# 3 Background

The development of the theoretical framework in which we are moving begins from both the setting of elastic Cloud-based designed micro-services and the traffic flows estimation approach adopted in [19]. Thus the system developed in this paper combines the advantages of a scalable Cloud-based infrastructure with a mesoscopic approach, where the kind of considered vehicles can be suitably defined, so that it can be applied to the considered case. Among dynamic traffic assignment models, classic mesoscopic approach, where packets of users belonging to the same mode move following a path, benefits from dynamic disaggregated traffic modelling (since the packets can be at least composed by a single vehicle modeled individually) adding the possibility of using macroscopic speed-density functions. In the following a short description of the theoretical assumptions and of the procedure is given.

## 3.1 Estimation of Origin-Destination flows

Several methods for analyzing and forecasting traffic counts based on other available information, such as historical information, and the issue of the off-line estimation of the OD (Origin Destination) demand matrices for link flows in a freeway network (a directed graph that represents local streets or groups of streets), are deeply analyzed in [20]. In transportation systems, the modelization of assignment problems allows to simulate how demand and supply interact in a transportation network. Starting from origin-destination demand flows, the calculation of performance measures and user flows for each supply element enables the description of path choice behaviors. In particular, in the context of a simulation model of a system of real-time traveler information providing short time forecasts of time-dependent link flows in a network, the iterative application of a sequential method combining observed traffic counts with historical information represents an interesting way to perform effectively the estimation/updating of an Origin-Destination trip table for the last interval. Consider an interval $h$, and let $d_h^H$ be the historical demand, while $f_h$ and $f_h^O$ represent the assigned and the observed link flows. Following [19], the estimated demand for the current interval, $d_h^E$, is obtainable by means of a generalized least square (GLS) estimator, say

$$d_h^E = \underset{d_h \ge 0}{\operatorname{argmin}}[(f_h - f_h^O)^T (f_h - f_h^O) + \theta(d_h - d_h^H)^T (d_h - d_h^H)], \quad (1)$$

where the parameter $\theta$ is related to the weight of flows with respect to the demand.

To deal with problems of traffic simulation-assignment and dynamic network loading (DNL) map by means of assignment matrices in order to estimate Origin-Destination demand flows based on the evaluation of assigned flows, depending on the link flows $f_h$, the solution of a fixed-point problem is therefore required.

## 3.2 Prediction of Origin-Destination flows

For solving the important and hard problem of predicting Origin-Destination (OD) tables for the forthcoming time intervals of a fixed predictive horizon either a direct or
an indirect approach can be used. In the former case, statistical methods or filtering techniques are applied so that estimates of the OD matrices for the actual time slices are derived from historical data series, whereas in the later case the prediction of traffic counts for the future time intervals is estimated before the computation of the demand matrices is performed. According to the direct approach described in [19], once introduced the variables $d_h^E$, $d_h^I$, and $d_h^P$, representing the historical, the estimated, and the predicted demand at the interval $h$, the predicted OD values can be estimated by means of the law

$$d_{h+1}^P = \alpha \left[ \frac{d_h^E}{d_h^H} d_{h+1}^H \right] + (1 - \alpha) d_{h+1}^H, \quad (2)$$

where $\alpha$ is a smoothing parameter, whereas the ratio $d_h^E/d_h^H$ has the meaning of taking into account possible unprecedented future events.

## 3.3 Dynamic traffic assignment

Let us divide the simulation period into subintervals and assume that all the travelling users experience the same traffic conditions. Moreover, for the sake of simplicity, we make the assumption that the length of each time interval $t$ is the same, and we consider a uniform distribution of the departures within the intervals. The network where the users are supposed to move is represented by means of a graph, composed of nodes and arcs. From a functional point of view, each arc $a$, of a certain length $L_a$, is thought of as divided into a running and a queuing segment.

The mesoscopic approach allows the evaluation of relevant traffic indicators by grouping the vehicles into packets made up, in general, by several users having homogeneous characteristics. We describe a mesoscopic model based on a packet approach (in which every packet is considered as a unique entity), providing an efficient way to carry out the dynamic traffic assignment (DTA) [21], by using the following general notation and terminology. In such a framework, the packet $P(t, k, u)$ represents in general a number of vehicles $x(t, k, u)$, belonging to class $u$, which depart during the same interval $t$ and move along path $k$. We shall here consider the specific case where the generic packet $P$ is made up by a single bike, that is $x(t, k, u) = 1$. Thus, the moment a new departure interval $t$ starts, a certain number of concurrently leaving packets (corresponding to the amount of means of transportation belonging to class $u$ which follow path $k$) is generated. When the time interval $t$ elapses, the evaluation of the outflow arc characteristics of interest for the purposes of the analysis, say queues, densities, speed, occupancy, is performed, and the obtained values are then used in view of the assignment of the outflow modalities of the points in the subsequent interval.

## 3.4 Kalman filtering

The Kalman filter [22] is a recursive procedure for computing the optimal estimator within the class of linear estimators of a state vector at a certain time, based on the available (even noisy) past information. It is based on the assumption of normality of the noise and the process. Let us introduce the matrices $A_k \in \mathbb{R}^n \times \mathbb{R}^n$, connecting the state $x_{k-1} \in \mathbb{R}^n$ at the previous time step ($k-1$) to the one at the current step ($k$)
(measurement sensitivity matrix), $B_k \in \mathbb{R}^n \times \mathbb{R}^l$, relating some optional control input $u_k \in \mathbb{R}^l$ to the state, and $H_k \in \mathbb{R}^m \times \mathbb{R}^n$, establishing the relation between the state and the measurement $z_k \in \mathbb{R}^m$. According to the original formulation, the measurements are obtained at each discrete point in time $k$ by means of the measurement model

$$z_k = H_k x_k + v_k, \qquad (3)$$

and the Kalman filter provides an estimate of the state of the controlled process that is governed by the linear stochastic difference equation (system dynamic model)

$$x_k = A_k x_{k-1} + B_k u_k + w_{k-1}, \qquad (4)$$

the normally distributed independent random variables $w_k$ and $v_k$ (i.e., $E < w_k v_j^T > = 0$ for all $k$ and $j$) representing the process and the white measurement noise, respectively, say $p(w_k) \sim N(0, Q_k)$, $p(v_k) \sim N(0, R_k)$ with $Q, R$ covariance matrices. Once introduced the Kalman gain matrix

$$\bar{K}_k = P_k(-) H_k^T [H_k P_k(-) H_k^T + R_k]^{-1}, \qquad (5)$$

the state estimate observational update at time $k$

$$x_k(+) = x_k(-) + \bar{K}_k [z_k - H_k x_k(-)] \qquad (6)$$

returns an a posteriori value of the estimate ($\tilde{x}_k(+) $) from the a priori estimate ($\tilde{x}_k(-)$) of the state $x_k$ of the system based on the information provided by the observation.

# 4 Case study

The framework described above fits into a pilot bike trial with the aim of providing a possible tool for evaluating the users' commitment. The definition of the IoT Cloud monitoring system modeling users' performance presented in this paper makes for predictive analysis in order to address the problem of establishing a dynamical ranking system by means of an algorithm designed considering that:

- each user is assigned the same starting score (depending on the duration of the experimental phase), which represents his/her initial rating;

- the usual routes of each user and the average distances traveled during working days are estimated by employing traffic flows estimation techniques on actual geolocation data collected in real-time by a GSM/GPRS/GPS TK103 tracker based system, forwarded to a GeoJSON parsing micro-service, and then analyzed by means of an IoT Cloud system providing fast big traffic data processing;

- the users' rankings are dynamically updated as a result of the comparisons with the individual averages (once fixed a suitable tolerance).

To further clarify how the mechanism driving the reward/penalty assignments works, consider the case of a pilot trial during a fixed number of weeks, and suppose that we do expect that, at least for a certain percentage of this time interval, the user reports a regular use of the bike provided in concession. After that each individual initial score has been assigned when the trial starts, at every check, if the user did not appear to be virtuous, his/her ranking would be decreased (alternatively, his/her score would increase), on condition that in case of negative scores the user loses the lease of the bike.
# 5 Architectural and Algorithm Design

<figure><img src="image_2.png" /><figcaption>(a) The IoT Cloud-based Monitoring System described in [7].</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>(b) A view of the functional diagram of the model.</figcaption></figure>

A suitably defined IoT Cloud Infrastructure for managing and mining sensor data, in a Smart City perspective, supports access to real-time urban data streams by exploiting interconnections in order to effectively approach a predictive traffic analysis.

The traffic flow estimation approach used in this paper is defined as follows. Let $\mathcal{S}$ be the system made up of the $N$ individuals which are the users of the bike trial community, say $\mathcal{S} = \{u_k\}_{k=1,...,N}$. With the aim of studying the OD flows in the five working days from Monday to Friday daily for each week, we define the state vector of the system $\mathcal{S}$ by considering the OD flows for each user recovered from the data produced by the IoT Cloud system for traffic monitoring and alert notification described in [7]. Such a kind of Cloud-based system, whose possible scheme is depicted in Fig.1(a), is designed by considering mobile sensors based on tracker devices gathering movement data from the transportation vehicles (in our case the bikes), and proved able to elastically scale up/down its internal micro-services thanks to Docker containers and send all geo-location data (in real-time by means of a 4G network connection) to an OpenGTS server storing them in a SQL database. In addition, incoming unstructured geo-location data are forwarded to a GeoJSON parsing micro-service in order to be inserted in a MongoDB distributed database (the unstructured data guarantees a good flexibility for further data analysis and manipulation, [7]). This compact size and simple management system for tracking mobile objects, besides supporting security, positioning, monitoring, GPRS data transmission and geo-localization, suitably provides historical OD data in the initialization phase of our approach. The variables $\{d_{k,l}\}_{k=1,...,N, l=1,...,7}$ are thus associated to the distances traveled by each user on working ($l = 1, ..., 5$) and
non-working (ℓ = 6, 7) days. As a start, we focus on the users' activity during the working days and consider the mean values $\bar{d}_k$ (ℓ = 1, ..., 5, k = 1, ..., N) of the distances travelled at the end of every week of the trial.

The methodology described below allows us to achieve good results in predicting flows also for few steps ahead. During each time slice (most likely every day) the values of the Origin-Destination (OD) matrices are estimated based on the acquired information on traffic movements during the time interval just elapsed, and the prediction of the OD matrices for the subsequent time intervals within the prediction horizon are estimated. At this point, suitable assignment matrices, to be intended as fractions of the OD matrices corresponding to the leaving time intervals that are related to the flow along the given link during the current interval, are derived by using a Dynamic Network Loading (DNL) approach, and then their entries are used within a filtering framework in order to produce flow forecasts. This approach (whose scheme, shown in Fig.1(b), refers to procedures clarified in section 3) lets us to model the usual paths of the various users in order to produce an estimate of the average distances which are intended as individual standards of use during the trial. After that, the dynamic traffic assignment (DTA) is carried out by means of a mesoscopic model based on packet approach (see [21] and references therein for more in-depth details) and traffic flow forecasting is directly related to the obtained results by means of a Kalman filtering technique. In particular, once at each step the transition matrix A and an assignment matrix B are evaluated within the DTA procedure on the basis of the speeds observed at the current and previous intervals, the transition and observation equations of the filter read

$$ 
\begin{aligned}
f_{k+1}^{E} &= A_k f_k^{E} + B_k u_k + w_k, \\
f_k^{O} &= H_k f_k^{E} + v_K,
\end{aligned} 
\quad (7) 
$$

where the subscript k indicates the time interval we are referring to, the variables $f_k^{E/O}$ represent the estimated/observed flow, $u_k$ is the historical variation of demand, whereas $w_k$ and $v_k$ are the process and the measurement errors, respectively.

To apply the Kalman filter and search for the optimal estimates, we perform the following steps: after the phase of initialization, in which we assign a starting value to the state vector and the covariance matrix based on the traffic data recovered and processed through vehicular Cloud computing, during the phase of correction we compute the Kalman gain matrix through which we update the a priori estimate and covariance; then, during the final phase of prediction, we obtain forecasts of the future state (through the correct a posteriori estimate) and of the covariance of the estimation error.

The application of the methods outlined above for the motivations and the reasoning set forth in section 4 results in carrying out the following steps:

1. Ranking initialization: $r_k^{(0)} = \tilde{r}_k$ for each k = 1, ..., N;

2. State vector initialization: the state vector of the system is initialized by taking into account the OD data provided by a scalable Cloud-based infrastructure for the processing of big traffic data;

3. Kalman filtering: through the application of a discrete KF the historical series of the state vector values is filtered so as to obtain forecasts on the future states of the system;
4. Tolerance definition: individual tolerances are established based on the average of the distances $m_k$ traveled by each user from the beginning of the trial: $\tau_k = \tau_k(m_k)$;

5. Check: every time step $t$, the users' ranking system is updated by adopting the rule acting as follows:

- if $\bar{d}_k^{(t-1)} < m_k - \tau_k$, then $r_k^{(t)} = r_k^{(t-1)} - 1$;

- if $\bar{d}_k^{(t-1)} \in [m_k - \tau_k, m_k)$, then $r_k^{(t)} = r_k^{(t-1)}$;

- if $\bar{d}_k^{(t-1)} > m_k$, then $r_k^{(t)} = r_k^{(t-1)} + b_k$, $b_k$ being some bonus related to the individual empowerment.

# 6 Conclusions and Future Work

The modeling approach described in this paper introduces a flow forecasting technique combined with an IoT Cloud Infrastructure for managing and mining sensor data in order to produce a predictive traffic analysis by taking advantage both of simulative and statistical methods. The valuable features in terms of performance of both information insertion and retrieval in MongoDB which characterize the scalable Cloud-based infrastructure used to implement an intelligent traffic monitoring system, where both OpenGTS server and micro-services were deployed by means of Docker containers, confer the implemented solution the advantage of supporting an efficient dynamic system update. Planned implementation and evaluation, immediately following the start of the trial, include the application of the IoT cloud system to storage and processing of geo-location historical data of the users of the community provided by tracker devices attached to the bikes and the use of the described dynamic network loading model for path forecast evaluation in order to obtain an efficient management of the merit ranking. Further investigations related to the application of this framework to concrete situations are planned with the goal of testing the practical application of the framework and extending the analysis and the services to more general and rich scenarios.

# ACKNOWLEDGMENT

This work has been partially supported by the Italian project "A scuola e a lavoro con il TPL". Authors would like to thank for their valuable work Alessio Catalfamo, Francesco Martella and all partners of the project.

# References

1. Giffinger, R., Gudrun, H.: Smart cities ranking: An effective instrument for the positioning of the cities. ACE: Architecture, City and Environment 4 (2010)

2. Al-AZZAM, M., Alazzam, M.: Smart city and smart-health framework, challenges and opportunities. Int. Journal of Adv. Computer Science and Appl. 10 (2019) 171–176

3. Ji, Z., Ganchev, I., O’Droma, M.: A generic iot architecture for smart cities. (2014) 196–199

4. Filocamo, B., Galletta, A., Fazio, M., Ruiz, J.A., Sotelo, M.A., Villari, M.: An innovative osmotic computing framework for self adapting city traffic in autonomous vehicle environment. In: 2018 IEEE Symp. on Computers and Comm. (ISCC). (2018) 01267–01270
5. Vlahogianni, E.I., Golias, J.C., Karlaftis, M.G.: Shortterm traffic forecasting: Overview of objectives and methods. Transport Reviews **24** (2004) 533–557

6. Ahmad, I., Noor, R.M., Ali, I., Imran, M., Vasilakos, A.: Characterizing the role of vehicular cloud computing in road traffic management. Int. J. of Distr. Sensor Networks **13** (2017)

7. Celesti, A., Galletta, A., Carnevale, L., Fazio, M., Lay-Ekuakille, A., Villari, M.: An iot cloud system for traffic monitoring and vehicular accidents prevention based on mobile sensor data processing. IEEE Sensors Journal **PP** (2017) 1–1

8. Al-Najada, H., Mahgoub, I.: Big vehicular traffic data mining: Towards accident and con- gestion prevention. (2016)

9. Lay-Ekuakille, A., Giannoccaro, N.I., Casciaro, S., Conversano, F., Velzquez, R.: Modeling and designing a full beamformer for acoustic sensing and measurement. International Journal on Smart Sensing and Intelligent Systems **10** (2017) 718–734

10. Fazio, M., Celesti, A., Villari, M., Puliafito, A.: The need of a hybrid storage approach for iot in paas cloud federation. (2014) 779–784

11. Figueiredo, L., Jesus, I., Machado, J., Ferreira, J.R., de Carvalho, J.L.M.: Towards the devel- opment of intelligent transportation systems. ITSC 2001. 2001 IEEE Intelligent Transporta- tion Systems. Proceedings (Cat. No.01TH8585) (2001) 1206–1211

12. Armstrong, J., (Dordrecht), K.A.P.: Principles of Forecasting: A Handbook for Researchers and Practitioners. Int. Series in Oper. Research & Manag. Science. Springer (2001)

13. Zhang, P.: Zhang, g.p.: Time series forecasting using a hybrid arima and neural network model. neurocomputing 50, 159-175. Neurocomputing **50** (2003) 159–175

14. Emami, A., Sarvi, M., Asadi Bagloee, S.: Using kalman filter algorithm for short-term traffic flow prediction in a connected vehicle environment. J. of Modern Transp. **27** (2019) 222–232

15. Ross, P.: Exponential filtering of traffic data. Number 869 in Transportation Research Record. NATIONAL ACADEMY OF SCIENCES (1982)

16. Clark, S., Grant-Muller, S., Chen, H.: Using non-parametric tests to evaluate traffic forecast- ing performance. Journal of Transportation and Statistics **5** (2002) 47–56

17. Stathopoulos, A., Karlaftis, M.: A multivariate state space approach for urban traffic flow modeling and prediction. Transp. Res. Part C: Emerging Technologies **11** (2003) 121–135

18. Chen, H., Grant-Muller, S.: Use of sequential learning for short-term traffic forecasting. Transportation Research Part C: Emerging Technologies **9** (2001) 319–336

19. Di Gangi, M., Croce, A., for European Transport, A.: Combining simulative and statistical approach for short time flow forecasting. In: EUROPEAN TRANSPORT CONFERENCE, Ass. for Europ. Transp. (2005)

20. Cascetta, E., Inaudi, D., Marquis, G.: Dynamic estimators of origin-destination matrices using traffic counts. Transportation Science **27** (1993) 363–373

21. Di Gangi, M.: Modeling evacuation of a transport system: Application of a multimodal mesoscopic dynamic traffic assignment model. Intelligent Transportation Systems, IEEE Transactions on **12** (2012) 1157 – 1166

22. Kalman, R.E.: A new approach to linear filtering and prediction problems. In: Transactions of the ASMEJournal of Basic Engineering. (1960)