- Research
- Open Access
- Published:

# Static force field representation of environments based on agents’ nonlinear motions

*EURASIP Journal on Advances in Signal Processing***volume 2017**, Article number: 13 (2017)

## Abstract

This paper presents a methodology that aims at the incremental representation of areas inside environments in terms of attractive forces. It is proposed a parametric representation of velocity fields ruling the dynamics of moving agents. It is assumed that attractive spots in the environment are responsible for modifying the motion of agents. A switching model is used to describe near and far velocity fields, which in turn are used to learn attractive characteristics of environments. The effect of such areas is considered radial over all the scene. Based on the estimation of attractive areas, a map that describes their effects in terms of their localizations, ranges of action, and intensities is derived in an online way. Information of static attractive areas is added dynamically into a set of filters that describes possible interactions between moving agents and an environment. The proposed approach is first evaluated on synthetic data; posteriorly, the method is applied on real trajectories coming from moving pedestrians in an indoor environment.

## Introduction

Analysis of trajectories performed by moving entities in environments is an important topic for different fields such as video surveillance [1], crowd/vehicle analysis [2, 3] and in general for monitoring systems, on which the dynamics of agents can lead to a better understanding of patterns and situations of interest [4, 5]. Abnormality detection is one of the most explored applications that involves analysis of trajectories. In such approach, by characterizing agents’ motions, it is possible to learn and identify normal/abnormal situations in a certain environment.

In general, approaches for abnormality detection are based on a set of observations that define the regular behaviors in a scene. Afterwards, abnormalities are defined as behaviors that do not match with patterns previously learned as normal, i.e., behaviors that have not been observed before [6]. Accordingly, observations that deviate from the characterized normal patterns are classified as potential abnormalities. Abnormality detection has been successfully used in real applications such as identification of hazardous massive crowds [7, 8], recognition of group activities [9, 10], traffic event classification [3, 11–14], detection of anomalies in maritime trajectories [15, 16], among others.

The recognition of motion patterns and interactions from trajectories is a challenging task, in particular when dynamics of moving agents are nonlinear through time and space. Moreover, a quick analysis of existent bibliography shows that current methods usually claim robustness and reliability for highly restricted scenarios, broad sensor availability and short video footages [17]. To alleviate these issues, a common approach is to represent the state of agents under a probabilistic framework and characterize the motion patterns by following a nonlinear Bayesian state estimation. This approach has been successfully applied in surveillance environments and complex motion patterns [12, 18].

In the present work, abnormalities from a proposed baseline model are used to parameterize characteristics of environments by looking at trajectories of individuals in an online way.

The majority of approaches that deal with analysis of trajectories are focused on characterizing agents’ dynamics through time [19–21] or learning interactive forces exerted by multiple moving agents. The latter can be understood as an evolution of the seminal paper of Helbing and Molnár [22], on which crowd motions are described by a combination of simple interactive forces between pedestrians. The methodology proposed by the authors is based on social force models, a concept originally introduced by [23]. In a recent work, Seer et al. [24] extend the work of Helbing by using three different shapes of social forces models, namely radial [22], elliptical [25], and a split version of forces [26]. The work of Seer is evaluated on real pedestrian trajectories.

A common trend in existent works is the characterization of moving agents’ trajectories based on their interactions among them, without taking into account the environment and its effects in the state of agents. Our work is motivated by the approach of Seer [24], with the main difference that the motion of our agents is characterized by environment forces revealed hierarchically due to interactions of the type agent-static zone.

This work tackles the analysis of moving agents in cases where the only information available is their location through time. The proposed strategy can be used in places on which a detailed map is unknown but agents’ positions can be obtained via GPS or other localization systems like Wi-Fi fingerprint for indoor environments [27, 28]. Furthermore, the proposed approach provides information of the moving agents’ surroundings that can be useful in cases of places monitored by cameras that provide noisy measurements, partial/full occlusion, or scenes with illumination changes [29].

The present work proposes a bank of Kalman filters (KFs) that explains the motion of agents in a hierarchical way. Models obtained from the bank of filters are incrementally learned by looking at abnormalities or deviations from a reference formulation based on a random walk behavior, such idea was first presented in [30], where an offline non-parametric method was proposed to characterize effects of static external objects in simulated environments.

In the current work, dynamical models that describe agents’ motions can be used to hypothesize a semantic representation of the environment effects [5, 31]. In other words, the agents’ motions incrementally reveal characteristics of the environment. By considering a Bayesian approach, the proposed method learns sequentially the nonlinear dynamics of moving agents over segments in which their orientations are relatively stable. Consequently, such segments can be seen as letters that are part of a vocabulary learned dynamically. As a future work, these vocabularies are proposed to be used for identifying normal and abnormal situations related to environment’s characteristics revealed on the fly.

The novelties of this work are itemized as follows: (i) It is proposed a Bayesian approach for understanding the physical and non-physical surrounding areas of moving agents based on their nonlinear dynamics. The proposed formulation allows to characterize parts of environments individually by using a bank of filters that encodes information about learned models in an incremental way. (ii) A parametric force field model based on a switching process is proposed to understand agents’ motions. Such model includes information about how static areas influence the dynamics of moving agents. Additionally, only agents’ positions are necessary to understand the effect produced by static areas through time. (iii) The proposed methodology does not need a broad sensor availability, since only location information is needed, any type of trajectory can be analyzed and modeled. Our approach is evaluated on synthetic data and real trajectories of pedestrians in an indoor place.

The rest of this article is organized as follows: A description of the agents considered in this work is provided in Section 2. Force model and problem definition are described in Section 3. A hierarchical representation of the environment is explained in Section 4. Results obtained with synthetic and real data are given in Section 5; Section 6 concludes the article.

## Agent paradigm

This work proposes a method for identifying and characterizing attractive areas in environments based on observations of cognitive entities that move through them. Accordingly, the present approach assumes that such moving entities can be represented as goal-based agents described in the work of Russell and Norvig [32]. Decisions made by such class of agents are based on a cognitive perception of their surroundings combined with a goal to be achieved. As can be seen in the diagram shown in Fig. 1, the agent’s goal plays a fundamental role at the moment of taking a decision.

In this work, agents’ goals are considered to be areas in the environment where agents tend to go. For modeling such areas, it is considered to use a formulation based on social force models. An idea was introduced by Helbing and Molnár in [22] for understanding pedestrian dynamics. Consistently, each main effect described in their work is here contextualized with the final purpose of explaining effects produced by unknown attractive areas in environments.

Helbing and Molnár propose that there are three main effects with which the motion of single pedestrians can be explained: *(i) destination to reach*—it consists in the shortest path to follow in order to go towards a goal; *(ii) influences caused by other pedestrians and barriers*—in which they define a repulsive force model for describing the effect that pedestrians exert among others at the moment of avoiding people. They also propose a repulsive model to explain the effect of barriers, such as borders of buildings or obstacles. *(iii) Temporary attractive effects*— they define a model that explains the sudden attractiveness that could be experienced by a pedestrian, it is the case of feeling attraction to other people (friends, street artists, etc.) or going towards static objects such as window displays.

Based on the three main effects described previously for understanding pedestrian dynamics, it is proposed to use the same reasoning to understand goal-based agents dynamics. From this viewpoint, main goals are assumed to be represented as *(i) destinations to reach* that can be modeled as attractive fields in the environment. *(ii) Influences caused by other pedestrians and barriers* and *(iii) temporary attractive effects* are proposed to be modeled as noise that deviates agents from their main destinations. Accordingly, the diagram in Fig. 2 explains the proposed model to understand the dynamics of moving agents in a scene.

In literature, the majority of works that deal with analysis of trajectories are focused on modeling and learning agents’ motions through time [4, 12, 16, 19–21]. However, in the proposed methodology, since an interaction between agents and the environment is assumed, it is useful to consider an attractive force model for explaining agents’ dynamics. Such model includes information about environment properties that define how moving agents are influenced by static areas in the scene. Accordingly, when an agent’s motion pattern is observed, the understanding of environment static characteristics is enriched.

By considering that dynamics of agents can be seen as the result of external forces acting on them, it is possible to associate such forces with the internal motivations that make agents perform certain actions (movements) [22] in order to reach a particular destination. From this perspective, each destination point is proposed to be modeled as an attractive area that exerts a force field in the environment.

The methodology proposed in this paper aims at the incremental understanding of attractive effects that static areas exert over moving agents. This work can be seen a method to improve the situation awareness (SA) of an environment by looking at moving entities. Formally, SA is defined as “the perception of elements within a volume of time and space, the comprehension of their meaning, the explanation of their present (observed) status and the ability to project the same in near future instants” [33]. Subsequently, the methodology proposed in this paper increases the SA of environments incrementally as agents’ motions are observed.

As an individual agent model is proposed, the current method aims at the understanding of agents’ surroundings in terms of attractive areas (goals) in cases where interactions with other agents are momentary, i.e., in situations where interactions between individuals can be modeled as a noise parameter. In cases of multi-agent systems composed by a large density of individuals as proposed in [34], the main goal of agents can be confused with the constant evasion of multiple individuals and the proposed approach would not work properly. Based on that, our method is focused on cases where there is a low density of agents that interact with each other.

## Force model and problem definition

Taking into consideration a classical mechanics approach, a force is defined as a vectorial quantity that acts on a body to cause a change in its state of motion [35]. Forces can be classified in action-reaction pairs: when bodies, which are in contact, change their momentum [35] and action-at-a-distance forces: when agents interact without being physically touched [36]. Throughout this work, motivations of agents are modeled as action-at-a-distance forces that can be characterized by looking at the motion of individuals.

A force field \(\vec {F}\) is defined as a vector point-function which has the property that at every point of the space takes a particular value related to the magnitude and direction of a force acting on a particle placed there and whose mass is considered as one [37]. Accordingly, moving agents’ dynamics are used to learn the effects produced by force fields in the environment.

A central force field \(\vec {F} = f(r) \hat {r}\) is a particular case of fields where the motion of agents is affected depending on the distance *r* to the location of an attractive/repulsive force source, called center of force. \(\hat {r}\) is a unit vector that points in the direction of *r*. Based on that, this article proposes radial force fields for modeling dynamics of agents through time.

For characterizing the effect that an attractive area exerts over moving agents, it is considered the second Newton’s law \(\vec {F} = m\vec {a}\), where *m*=1 as proposed before. Therefore, it is direct to infer that \(\vec {F} = \vec {a}\), i.e., the force exerted by an attractive area in the environment can be measured as the agent’s acceleration at a particular point where it is located.

It is hypothesized that information about the agent’s speed *V*(*t*) can be inferred through time *t*. Then, it is possible to relate agents’ speeds with their accelerations as can be seen in Eq. (1):

where *t*
_{1} and *t*
_{2} are two consecutive time instants, \(a_{t_{1}}\) represents the force magnitude that acts over an agent at time *t*
_{1} and *c* is an integration constant that represents the agent’s velocity \(V_{t_{1}}\) at the instant *t*
_{1}. By considering a number of *n* spatial dimensions from which trajectories of moving agents are observed, the location of a single agent can be expressed as shown in Eq. (2):

The velocity field experienced by an agent influenced by a central force field in terms of its location \(\mathcal {X}\) is shown in Eq. (3):

where it is possible to observe that dependencies of time *t* can be substituted by spatial coordinates \(\mathcal {X}\). Since force fields are fixed in one location and their influences are assumed to remain equal through time, agents’ dynamics will depend only on their own location \(\mathcal {X}\).

A switching model is proposed to characterize the velocity fields perceived by agents due to the presence of attractive radial force fields. Based on this, two motion stages are defined: i) When the agent is near to an attractive center of force (near range of interaction) and ii) When the agent is far from it (far range of interaction).

### Near range of interaction

In order to model the way by which moving agents arrive in attractive areas, it is considered a parametric function that describes their velocities depending on the distance *r* to a center of force. The proposed model is based on a top speed from which the agent continuously experiments a deceleration according to a function inspired by the repulsive terms offered by [22, 25] and the deceleration factor described on [26].

Consistently, for characterizing the arrival of agents in attractive areas, it is proposed a velocity field \(\vec {G}_{\text {near}}(r)\) that defines how their dynamics vary as they approach closer to an attractive area. Two global terms can explain such velocity field, one related to a baseline velocity and other based on a deceleration term, as described in Eq. (4):

where *r* is defined as the Euclidean distance between an agent and the attractive area in question, such that \(r = ||\mathcal {X}-\mathcal {X}_{0}||_{2}\), where \(\mathcal {X}\) represents the agent’s location and \(\mathcal {X}_{0}\) is the unknown position of the attractive area. *σ* is an unknown parameter that defines the way in which moving agents decelerate while they approach the center of force \(\mathcal {X}_{0}\). Low values of *σ*
^{2} are associated with abrupt agent decelerations; and high values are related to smooth decrements of speed while agents advance towards \(\mathcal {X}_{0}\). *β* is the top speed from which agents start decelerating until they arrive at the attractive area. *α* defines the final speed that an agent will have when arrives at \(\mathcal {X}_{0}\). In the ideal case *α*=*β*, which implies that moving agents reach the attractive point with a null speed. Figure 3 shows the proposed parametric function \(\vec {G}_{near}(r)\) for approximating velocity fields in a near range of interactions over a two-dimensional plane (*x,y*). For visualization purposes, it is considered \(\mathcal {X}_{0} = \left [ \begin {array}{c} x_{0} \\ y_{0} \end {array} \right ]\), *x*
_{0}=0, *y*
_{0}=0, *σ*
^{2}=15, *β*=1 and *α*=1.

Each velocity field in a near range of interactions can be described by the set of parameters \(\xi = [\beta,\alpha, \mathcal {X}_{0}, \sigma ]\). For estimating each of them, it is proposed an iterative gradient descent method explained in detail on Section 4.3.

As can be seen in Eq. (4), since *β* and *α* are always positive, it is assumed that moving agents decrease their speeds while they approach the attractive areas. Accordingly, the proposed model applies to moving agents that tend to remain on the attractive center of forces, i.e., their speeds tend to be null near it. By taking into consideration the latter assumption, it is possible to define a distance *r*
_{switch}, from which agents start decreasing their velocity at approaching to \(\mathcal {X}_{0}\).

In this sense, the model described in Eq. (4) is valid for *r*≤*r*
_{switch}. When distances between agents’ locations and attractive areas are greater than *r*
_{switch}, another model must be proposed to characterize the agents’ dynamics in terms of attractive forces. Under this perspective, the following section introduces a way to model agents’ velocities when they are located at far distances from \(\mathcal {X}_{0}\).

### Far range of interaction

When moving agents are located at a distance *r*>*r*
_{switch} from an attractive area, it is proposed to use a probability density function (PDF) to describe the agents’ velocities until they start reducing their speeds due to a near range of interactions effect previously explained in Section 3.1. From this viewpoint, the model of a far range of interaction works until agents present a continuous deceleration through time, which indicates they start approximating to an attractive area.

PDFs are proposed to characterize interactions at far distances from attractive centers of force due to their properties for representing stochastic phenomena. It is hypothesized that agents’ velocities at far ranges of interaction can be slightly affected by multiple factors different from the effect of attractive forces in the environment. Nonetheless, at this stage, it is assumed a predominant agents’ velocity due to their interactions with an attractive area, i.e., it is assumed a main constant influence on the agents’ velocity due to a particular destination point (goal) that makes them move towards a center of force \(\mathcal {X}_{0}\).

In this work, it is proposed to represent the velocity’s magnitude of an agent localized in *r*>*r*
_{switch} as the *L*
^{2} norm among the velocities experienced in each spatial axis, such that \(||V_{\mathcal {X}_{\text {far}}}||_{2}\), where \(V_{\mathcal {X}_{\text {far}}}\) represents the agent’s velocity in a single location measured in a far range of interaction. Based on that, the set of all velocities’ magnitudes due to an attractive area in a far range of interaction can be written as

where *J* is the total number of measurements taken in a far range of interaction. Since a main constant velocity is assumed during this stage, it is defined a random variable *γ* that distributes according to the log-normal distribution \(ln\mathcal {N}(\mu,\sigma _{\text {far}}^{2})\) that is adjusted based on ||*V*
_{far(set)}||_{2}. Such distribution allows to represent variables that are only defined for positive values and that can be concentrated mainly in one value, as it is the case of velocities’ magnitudes in far range of interactions. From this viewpoint, velocity fields in such stage can be written as shown in Eq. (5):

as explained before, *γ* is a random variable that distributes in accordance a log-normal distribution. After characterizing near and far interactions between agents and an attractive area of the environment, it is possible to define a full effect \(\vec {G}^{m}(r)\) produced by a particular area *m*, such as shown in Eq. (6):

Consequently, as different agents move through an environment, a total set of fields \(\vec {G}^{m}(r)\) can be obtained, where *M* is the number of identified attractive areas that have been characterized inside a scene. From this perspective, each effect can be seen as a letter that is part of a vocabulary which is learned hierarchically as new agents move inside an environment. The next section describes a methodology that aims at the incremental learning of environment properties based on moving agents’ observations.

## Hierarchical environment representation

The present section explains a methodology by which effects generated by static attractive areas can be modeled as control parameters into an initial Kalman filter (KF) formulation from which effects of interactive areas can be extracted and then modeled into it. It is also shown how trajectories that are globally nonlinear in terms of space can be incrementally grouped into segments in which agents’ dynamics preserve a constant orientation. Each identified segment is here explained by an attractive velocity field whose effect is modeled through the switching formulation described in Section 3. Finally, it is proposed that each trajectory can be seen as a sequence of attractive areas acting on the moving agents. This process can be considered as the activation of different letters in the environment (each one associated to an attractive area) that gives a semantic representation of activities in the environment.

### Kalman filter modeling

Supposing location measurements of single agents in an environment are defined as *Z*
_{
k
} for each instant of time *k* and assuming that such measurements are equally time spaced, i.e., *Δ*
*k* remains constant, it is possible to define the agent state vector *X*
_{
k
} as its position and velocity at *k*. Accordingly, let measurements and state of agents be related by the expression *Z*
_{
k
}=*HX*
_{
k
}+*ν*
_{
k
}, where *ν*
_{
k
} represents a zero-mean normal distributed noise due to errors on the measurements taken at time *k* and *H* is a matrix that maps the actual state space *X*
_{
k
} onto the observations *Z*
_{
k
}.

Since the proposed method aims at the hierarchical learning of agents’ temporally non-linear motions, initially, a random walk model centered on agents’ observations is hypothesized as the most general way to represent unknown dynamical behaviors. Based on this, observations of moving agents that deviate from a random walk model can be used to incrementally explain effects of attractive areas in a particular location *Z*
_{
k
} from which the deviation was observed.

Dynamics of agents are modeled by a bank of Kalman filters that grows sequentially as new patterns associated with attractive areas in the environment are revealed by looking at agents’ motions through time. Accordingly, Eq. (7) shows the initial KF dynamical model based on a random walk model from which the bank of filters is built up afterwards.

where

*w*
_{
k
} is a zero-mean normal distribution associated with the random noise of the proposed dynamic model and *n* represents the number of observed dimensions of the environment as shown in Eq. (2).

Let \(X_{k|k -1}^{0}\) be the prediction of a KF based on the random walk model described in Eq. (7) given the updated state estimation at the time *k*−1, i.e., \(X^{0}_{k-1|k-1}\). It is assumed that significant deviations from the KF’s predictions carry information about effects of unknown attractive areas. Accordingly, when the measurement *Z*
_{
k
} arrives, it is possible to compute \(\tilde {Y}^{0}_{k}\), called innovation of measurement residual, which is defined as shown in Eq. (8):

where \(X_{k|k-1}^{0} = FX_{k-1|k-1}^{0}\) and it is defined as the random walk KF’s prediction. In general, innovations can be seen as a quantity that measures the deviation that a proposed dynamical model presents respecting observations. In the ideal case, the value \(\tilde {Y}_{k}^{0}\) would tend to zero, which means that the proposed model, based on a random walk dynamics, can explain the observations of agents in the environment correctly. Following this reasoning, in cases where innovations are significantly different from zero, the dynamical model should be modified in order to describe more accurately the observed agents’ dynamics. To do so, it is considered a modification in random walk model, the new model formulation is shown in Eq. (9):

where a control parameter *BU*
_{
k
} is introduced in order to obtain innovations that tend to zero. *U*
_{
k
} can be seen as a velocity contribution that makes an agent follow certain motion when it is located at the coordinates *Z*
_{
k
}. *B* is a matrix that maps such velocity contribution into the agent’s state, such that \(B =\left [ \begin {array}{c} \Delta k I_{n} \\ I_{n} \end {array} \right ]\).

Similarly to the random walk model, innovations of the proposed new model are defined as \(\tilde {Y}_{k}^{1} = Z_{k} - H X_{k|k-1}^{1}\). Accordingly, in order to make \(\tilde {Y}_{k}^{1} = 0\), it is proposed to use the innovations produced by the random walk model, \(\tilde {Y}_{k}^{0}\), into the control parameter *BU*
_{
k
} of the proposed new model. By taking into consideration that \(X_{k|k-1}^{1} = F X_{k-1|k-1}^{1} + BU_{k-1}\), it is possible to rewrite the expression of innovations generated by the new model as shown in Eq. (10):

By substituting the updated state produced by the KF based on the proposed new model with the updated state found with the random walk based model, such that \(X_{k-1|k-1}^{1} := X_{k-1|k-1}^{0}\), it is possible to rewrite Eq. (10) as shown next:

from which it is possible to infer that

As can be seen in Eq. (12), the control vector *U*
_{
k
} is a velocity quantity related to the effect that attractive forces exert over moving agents in the particular measurement *Z*
_{
k
}. For this viewpoint, since different agents localized in the same coordinated point *Z*
_{
k
} can be motivated by different attractive areas, each velocity field effect should be individuated and included into the KFs’ dynamic models that compose the proposed bank of filters as shown (13):

where \(U_{k}^{s} = \frac {\tilde {Y}^{0}_{k,s}}{\Delta k}\), *s* is the indexation of each potential attractive area and *A*
_{
s
} corresponds to the dynamical model associated to each of them. In this sense, each *A*
_{
s
} represents a new KF model built from the innovations produced by the random walk model described in (7). At the moment of defining an attractive model *A*
_{
s
}, information about innovations generated by the previously characterized set of dynamical models {*A*
_{1},*A*
_{2}…,*A*
_{
s−1}} should be taken into consideration in order to merge similar velocity field models. In this work, a merging process of similar velocity fields is considered as a post processing step and a classic k-means algorithm is used to group similar fields. From this viewpoint, the proposed bank of KFs is created incrementally by observing deviations from a reference random walk model. Each learned new model includes information about attractive properties of the environment.

In order to relate the proposed attractive field described in Eq. (6) to the control inputs \(U_{k}^{s}\), it is necessary to identify parts on a trajectory in which velocity effects produced by radial attractive force fields are valid. For this purpose, it is considered a method for segmenting trajectories explained in Section 4.2.

### Trajectory segmentation

Since it is hypothesized that movements of agents are produced by static areas that exert radial attractive force fields, it is expected that trajectories performed by agents are spatially quasilinear and pointing every time at the direction of a main attractive area. Nevertheless, in real cases, motions of agents do not have the same orientation in every moment. However, they can be divided into quasilinear segments on which the assumption of interactions with attractive radial fields is valid.

The possibility of dividing a trajectory into quasilinear segments can be associated with the presence of multiple motivations that an agent follows as time evolves. In other words, a moving agent can be attracted by multiple areas that can be seen as dynamical motivations that change in time as the agent moves through the environment reaching multiple goals. An example of this behavior can be clearly identified in airplane trajectories, where aircrafts perform different approaches to intermediate points during a flight. Figure 4 depicts an example of such behavior for a commercial flight that goes from Amsterdam to Brussels on a latitude-longitude plane.

In Fig. 4, spatial quasilinear segments in the trajectory are identified with different colors. Red crosses show the points in which transitions between different quasilinear segments take place. Accordingly, from Fig. 4, it is possible to see how multiple quasilinear paths can explain a single trajectory in terms of spatial transitions. Accordingly, each segment identified in Fig. 4 is proposed to be explained by an attractive area that exerts a radial force field over the environment.

Angles produced by the estimated velocities *U*
_{
k
} are used in order to segment the trajectory into quasilinear motions in an online way. Since the control vector *U*
_{
k
} can be seen as the agent’s velocity due to the interaction with external forces when at observing *Z*
_{
k
}, the orientation of this vector can be used as a measurement of alignment with attractive centers of force. If an agent is approaching to an attractive area in the environment, it is expected that orientations of *U*
_{
k
} do not change significantly through time. Based on this, it is proposed to define a window time *t*
_{
w
} in which directions of velocities *U*
_{
k
} remain stable. Let *W*
_{
a
} be the windowed version of the velocities *U*
_{
k
} such that:

where *a* is the number of samples that fit in an interval of time *t*
_{
w
}. Once a number of *a* velocities *U*
_{
k
} is obtained, the window data *W*
_{
k
} is used to approximate the parameters of a von Mises distribution *μ*
_{
θ
} and *κ*
_{
θ
}. This distribution is selected due to its properties of representing the direction of entities in a probabilistic way, *μ*
_{
θ
} represents distribution’s mean and \(\frac {1}{\kappa _{\theta }}\) is analogous to the variance in a normal distribution.

Defining \(\hat {\mu }_{\theta,k}\) and \(\hat {\kappa }_{\theta,k}\) as the estimated parameters of the von Mises distribution based on the window data *W*
_{
k
}, it is proposed a deviation angle *θ*
_{
dev
} from which it is possible to distinguish when an agent moving aligned to a particular attractive area. Accordingly, when an accumulated probability higher than 0.9 is obtained in the range \([\hat {\mu }_{\theta,k}-\theta _{dev}, \hat {\mu }_{\theta,k}+\theta _{dev}]\), it is hypothesized that the agent is attracted to an area. Velocity contributions calculated in following times, i.e., from *U*
_{
k+a+1} onwards are compared with the current von Mises distribution through a Mahalanobis distance *D*
_{
M
} [38], in order to evaluate whether it belongs to the previously estimated distribution of if it is necessary to hypothesize a new one. For doing so, a distance limit *D*
_{
θ
} is introduced, such that if a number of *n*
_{
θ
} velocities contributions produce a distance *D*
_{
M
}>*D*
_{
θ
}, the process is reinitialized with a new window \(\phantom {\dot {i}\!}W_{k+a^{*}+1}\), where *a*
^{∗} is the minimum window size *a* together with the following velocity contributions that were classified as part of the von Mises distribution estimated from the window *W*
_{
k
}.

In this work, each quasilinear segment, indexed with the letter *s*, is associated with the presence of an attractive area in the environment, see Eq. (13). Accordingly, once a segment is detected, a velocity field approximation is iteratively performed based on an attractive force hypothesis. Algorithm 1 describes the proposed sequential process for identifying quasilinear motions in agents’ dynamics and approximating velocity fields from them.

Some algorithms for segmenting signals into linear components and reconstruction of trajectories were identified. However, for the particular problem addressed in this work, where moving agents are influenced by a main goal, information about the direction and magnitude of their velocities should be taken into consideration to make a correct segmentation in terms of attractive forces. The number of segments identified with this approach corresponds to the quantity of potential attractive areas in the environment. A list of the principal characteristics of identified algorithms for piecewise linear segmentation and reconstruction of trajectories are compared with the current proposal in Table 1.

From Table 1, it can be seen that the proposed method presents the advantage of being online. additionally, it uses the dynamics of agents as inputs for performing the segmentation process. Since produced segments are assigned to central force fields, the agents’ velocity angles result to be an important feature for detecting alignment with goals that agents desire to reach by taking the shortest possible path.

It is possible to see from Algorithm 1 that the final result of the proposed method consists of a set of velocity fields related to attractive areas identified by quasilinear segments in the agents’ motions. Accordingly, as a segment grows in time, an iterative estimation of the velocity field’s characteristics is performed based on the model described in Sections 3.1 and 3.2. Section 4.3 explains in detail how this process is performed as new agents’ observations are obtained.

### Learning of environment properties

Let the pair of vectors [*Z*
_{
k
},*U*
_{
k
}] be the agent’s observations with their respective control vectors obtained by the KF based on the random walk model proposed in Eq. (7). Additionally, suppose that [*Z*
_{
k
},*U*
_{
k
}] are acquired incrementally such that algorithm 1 is applied as new observations arrive such that \([Z_{k}^{s},U_{k}^{s}]\) are vectors that belong to a particular segment *s*, i.e., they are produced due to an unique attractor.

Since parameters \(U_{k}^{s}\) are related to velocity components that deviate agents from a random walk behavior, it is proposed to use them in order to fit the velocity field model presented in Eq. (6). Accordingly, for distinguishing between far and near ranges of interaction, magnitudes of \(U_{k}^{s}\) are analyzed through consecutive time instants, such that: If \(||U_{k}^{s}||_{2}\) values decrease continuously in a range of time *Δ*
*K*
_{switch}, the moving agent is assumed to be in a near range of interaction, proposed in Eq. (4). For this case, its measurements and control vectors will be labeled as \([Z_{k(\text {near})}^{s},U_{k(\text {near})}^{s}]\). Otherwise, the moving agent is assumed to follow the far range of interaction model described in Eq. (5), in such case, its measurements and control vectors will be labeled as \([Z_{k(\text {far})}^{s},U_{k(\text {far})}^{s}]\).

In order to characterize the velocity field in a far range of interaction associated to a segment *s*, the magnitudes \(||U_{k(\text {far})}^{s}||_{2}\) are used to estimate the random variable *λ*
_{
s
}, such as proposed in Eq. (5).

Estimating the center of force \(\mathcal {X}_{0}\) in a far range of interaction is not possible since there is not conclusive information about velocity decrements. Nonetheless, it is feasible to determine a line on which the center of force belongs. Such line is defined from the last observation *Z*
_{
k
} and has a slope determined by the mean of *λ*
_{
s
}.

\([Z_{k(\text {near})^{s}}, U_{k(\text {near})}^{s}]\) are used to estimate the unknown parameters in Eq. (4) for a particular attractive area *s*. The measurement and control input from which next \(||U_{k}^{2}||_{2}\) values start decreasing are labeled as \([Z_{k(\text {switch})}^{s}, U_{k(\text {switch})}^{s}]\). The magnitude of \(U_{k(\text {switch})}^{s}\) is taken as an estimation of to the term *β* of Eq. (4), such that \(\hat {\beta }_{s}= ||U_{k(\text {switch})}^{s}||_{2}\). Additionally, it is assumed \(\hat {\alpha }_{s} = \hat {\beta }_{s}\), such that moving agents tend to remain on the attractive center of force when they arrive in it. Then, an iterative gradient descent is proposed to minimize the error between magnitudes \(||U_{k(\text {near})}^{s}||_{2}\) and the proposed velocity field formulation of Eq. (4) based on the sparse space representation of the observed data *Z*
_{
k(near)}.

Accordingly, the function to optimize is the mean square error between \(||U_{k(\text {near})}^{s}||_{2}\) and the proposed velocity field function described in (4) with the fixed values of \(\alpha = \hat {\alpha }_{s}\) and \(\beta = \hat {\beta }_{s}\). By assuming a total number of *N* measurements with their control inputs identified in a near attractive range of interaction for an area *s*, i.e., \([Z_{k(\text {near})^{s}}, U_{k(\text {near})}^{s}]\) with *k* from 1 to *N*, the function to optimize is shown in Eq. (14):

Since *G*(*r*
_{near}) is a differentiable function respecting the parameters *σ* and \(\mathcal {X}_{0}\), a classical gradient descent algorithm is performed by taking the partial derivative of the function \(J(\sigma,\mathcal {X}_{0})\) respecting each of them. Both expressions are shown in Eq. (15):

where

As a moving agent is approaching an attractive center of force, the number *N* of measurements identified in a near range of interaction will increase as more vectors \([Z_{k(\text {near})}^{s},U_{k(\text {near})}^{s}]\) are available. In other words, each time that *N* increases, new estimations \(\hat {\sigma }_{s}\) and \(\hat {\mathcal {X}}_{0,s}\) made by gradient descent process are obtained. Supposing that a total number of *Q* estimations of \(\hat {\mathcal {X}_{0}}\) and \(\hat {\sigma }\) have been obtained by the multiple computations of the gradient descent method, it is proposed to fuse all of them for a given segment *s*, i.e., \([\hat {\mathcal {X}}_{0,s,q},\hat {\sigma }_{s,q}]\) where *q* goes from 1 to *Q*, by performing a weighted average over the *Q* estimations such as shown in Eq. (16):

where *w*
_{1,q
} is a weight related to the number of samples with which the gradient descent was executed in the iteration *q*. Each *w*
_{1,q
} is normalized respecting the maximum number of samples with which the gradient descent have been performed. *w*
_{2,s,q
} is a weight related to the error \(J_{s,q}(\beta, \alpha, \sigma, \mathcal {X}_{0})\) obtained on each iteration *q* at estimating the properties of the attractor associated to the segment *s*. *w*
_{2,s,q
} values are normalized respecting the lowest error obtained.

The pair of parameters \([\hat {\mathcal {X}}_{0,s(avg)},\hat {\sigma }_{s(\text {avg})}]\) obtained by applying Eq. (16), is the final estimation of the velocity field parameters [\(\mathcal {X}_{0},\sigma \)] related to the effects of an attractive area based on the segment *s*. \(\hat {\mathcal {X}}_{0,s(\text {avg})}\) represents the estimated location of the attractive center of force associated to based the segment *s* and \(\hat {\sigma }_{s(\text {avg})}\) encodes information about the shape of its effect in the environment.

By replacing the vector of parameters’ estimations \(\hat {\xi }_{s} = [\hat {\beta }_{s},\hat {\alpha }_{s}, \hat {\mathcal {X}}_{0,s(\text {avg})}, \hat {\sigma }_{s(\text {avg})}]\) in Eq. (4), it is possible to obtain an expression that explains the effect of an attractive area in a near range interactions, such that \(\hat {\vec G}_{\text {near}}^{s}(r) = \vec G_{\text {near}}(\hat {\xi }_{s})\). Similarly, for a far range of interaction, it is possible to write \(\hat {\vec G}_{\text {far}}^{s}(r) = \hat {\lambda }_{s}\). Consequently, a final estimation of attractive effects can be defined as

where *r*
_{
s(switch)} represents the distance from which agents start decreasing their velocities at approaching the attractor and \(r_{s} = ||Z_{k} - \mathcal {X}_{0,s}||_{2}\) is the distance between an agent and its center of force. Estimated velocity fields \(\hat {\vec {G}}^{s}(r_{s})\) can be used to rewrite Eq. (13) in terms of the proposed parametric function such as shown next:

As explained before, the purpose of this paper is to estimate the velocity fields \(\vec {G}^{s}(r_{s})\) generated by attractive areas in environments. From Eq. (17), it is possible to see that a bank of filters composed of the effects of attractive fields related to each segment *s* is obtained by applying the proposed methodology. From this viewpoint, each KF dynamical model *A*
_{
s
} can be seen as a letter that is learned on the fly as patterns in agents’ motions are detected. Consequently, as multiple letters are observed and characterized, it is possible to build a vocabulary in terms of learned environment properties. In the next section, some results at modeling such properties in synthetic and real trajectories are shown and discussed.

## Results

The proposed method was tested in two different scenarios: (i) synthetic data, in which an environment with different attractive areas is proposed and whose characteristics are inferred based on agents that move towards different goals; (ii) pedestrian dataset, where dynamics of people moving through an indoor place are analyzed and attractive points in the environment are identified.

### Synthetic data

In order to validate the proposed method, a simulated scenario in which moving agents are motivated by different attractive zones is considered. Three radial attractors that influence moving agents are proposed as shown in Fig. 5.

It is proposed that agents interact with at least one attractor before they reach their final destination. In this sense, situations in which agents change dynamically their destinations (goals) are simulated and analyzed in an online way. This simulation assumes that agents always start moving from a random side of the environment such as shown in Fig. 5. Noise from a uniform distribution \(\mathcal {U}(-b,b)\) is considered in order to affect the motion of agents in directions *x* and *y*. The value of *b* is selected according to the speed that agents present each instant of time, such that it is adjusted to a specific signal-to-noise ratio \(\textrm {SNR} = ||\vec {V}_{\mathcal {X}}||_{2}/b\), where \(\vec {V}_{\mathcal {X}(t)}\) is the velocity exhibited by an agent in a location \(\mathcal {X}\). Attractive areas’ effects are simulated according to the formulation shown in Eq. (4) with *β*=−*α*. The selected values of the parameters for each attractor are shown in the first column of Table 2.

It was considered a total of 150 trajectories that start randomly from one side of the environment and whose final/intermediate(s) points of attraction are also selected at random. The proposed method was applied to the trajectories in order to recognize attractive effects in the environment.

By taking the estimations of attractive centers of force generated by agents that behave according to a near range of interaction explained in Section 3.1. It is possible to obtain a map with different locations of attractive points such as shown in Fig. 6. As can been seen, similar centers of force can be clustered by using a classic *k*-means algorithm in order to identify attractive areas in the scene that combine information of similar attractors’ estimations.

From Fig. 6, it can be seen that each identified cluster corresponds to an attractive zone. Crosses are calculated by taking the average position of all the velocity fields that belong to a particular cluster. Similarly, the average of *σ* and *β* components of velocity fields is taken in order to characterize the properties of each merged attractor.

Attractors resulting from the clustering process can be seen as letters that conform a vocabulary that characterizes the environment. Accordingly, the parameters associated with each letter can be expressed as shown in Eq. (18):

where *m* indexes each identified cluster composed by similar estimated fields that in turn are indexed as *p*
_{
m
}. \(\hat {\xi }_{p_{m}}\) represents the estimated parameters \(\hat {\xi }_{s} = [\hat {\beta }_{s},\hat {\alpha }_{s}, \hat {\mathcal {X}}_{0,s(\text {avg})}, \hat {\sigma }_{s(\text {avg})}]\) coming from a segment *s* and relabeled according to the clusters (letters) reached with the k-means algorithm.

In order to evaluate the algorithm performance, it is possible compare the parameters estimated for each merged attractor with the respective ground truth values. Accordingly, Table 2 shows the values estimated at different SNRs for each attractor.

From Table 2, it can be seen that estimations of centers of force locations are not affected drastically at the presence of noise. However, it is observed a significant change in the estimations *β* and *σ* when SNR is close to 1. Such behavior indicates that at low SNRs the main direction of trajectories is preserved but the magnitudes of their velocities are significantly affected.

In order to illustrate how the overall performance in the estimation of \(\hat {\xi }_{s} = [\hat {\beta }_{s},\hat {\alpha }_{s}, \hat {\mathcal {X}}_{0,s(\text {avg})}, \hat {\sigma }_{s(\text {avg})}]\) at different SNRs, it is proposed to take the following expression shown in Eq. (19):

where

*m* and *τ* index the attractive zones and the different SNRs respectively. The total number of attractors and SNRs are represented with *M* and *T*. *ξ*
_{
m
} represents the ground truth of the parameters that define the attractor *m*. \(\hat {\xi }_{m,k}\) is the estimation of attractive parameters related to an attractor *m* at a specific SNR *k*.

By taking the normalized error expressed in Eq. (19), it is possible to obtain the performance results shown in Fig. 7 for different signal-to-noise ratios. Variances produced by estimations of the three attractive zones are plotted as error bars for each SNR case.

From results obtained with simulated data, it is possible to see that the proposed approach recognizes and characterizes radial attractive fields with different intensities and shapes at several SNR values by looking at the motion of individuals. Additionally, the proposed method does not need a large number of data vectors and parameterizes areas according to a known function. This represents a an advantage in comparison with our previous approach [30] that needs trajectories all around the environment for estimating correctly the effects of force fields in environments. For validating our method on real data, it is proposed to analyze a dataset composed by pedestrians’ trajectories in an indoor environment.

### Pedestrian dataset

The dataset proposed by Yi in [39] was used to test our approach. The database is composed by 12,684 pedestrian trajectories in an indoor place where each individual is manually labeled from a one-hour crowd surveillance video. In their work, they identify 10 zones that act as source/destination points for pedestrians and it is manually labeled in Fig. 8, as can be seen, an 11th zone is introduced as the center point of the scene that is hypothesized to be an attractor for some pedestrians that interact with it. Consequently, the plot shown in Fig. 8 can be seen as a map of attractors in the scene. By using our approach, it is expected to identify those points in terms of their location and the effect they produce on moving pedestrians.

By grouping similar estimations of attractive centers of force generated by pedestrians that behave according to a near range of interaction, it is possible to obtain a map of the attractive zones’ locations such as shown in Fig. 9. Similar to the case of synthetic data, parameters that belong to the same attractive zone are averaged based on Eq. (18) to obtain the parametrization of each merged version of attractive fields in the scenario. Estimations of attractive zones’ locations are depicted as red crosses on Fig. 9.

In order to visualize the presence and effect of each attractive zone, it is proposed a map that is shown in Fig. 10. Areas with null values (blue colors) represent the absence of attractive fields. Zones with larger values (red colors) represent the presence of attractors that where agents feel more attracted in terms of intensity. The shape of fields are visualized as the radius around each center of force (black cross) until the color map becomes totally blue. Consistently, the larger such radius is, the near range of interaction effect becomes broader, i.e., a larger period of deceleration is detected.

Results obtained in this database demonstrate that from the dynamics of moving agents it is possible to infer the locations and characteristics of attractive areas. Particularly, qualitative results can be seen by comparing our approximation of attractive centers of force shown in Fig. 10 with the zones manually labeled by [39] and depicted in Fig. 8. It can be seen that zones labeled as {*C,A,I,B,G,J,H,E*} in Fig. 10 correspond respectively to the labels {1,2,3,5,6,7,8,9,10} in Fig. 8.

Since there is not a ground truth available to verify the intensity or shape of attractors associated to *β* and *σ* values respectively, the only comparison that can be done it is terms of centers of force localizations between Figs. 8 and 10 as proposed before.

Additionally, it was identified the area labeled with letter *F* corresponds to an effect of a queue that pedestrians follow through the video. Zones identified as *K* and *D* are related to pedestrians’ interactions with the central object of the scene. Both, queue and object’s effect are illustrated in Fig. 11. According to that, it is demonstrated that the proposed methodology is capable of recognizing effects derived from contextual situations in the environment by looking at movements of dynamical agents through time.

## Conclusions

A method for characterizing attractive forces in statical environments based on movements of agents is proposed. To do that, it is put forward a methodology based on the minimization of innovations from a Kalman filter based on a random walk model. Innovations from this model are used in order to the explain external effects that affect agents’ motions. Information that encodes properties of the environment effects on agents is proposed to be added as a control input into the initial random walk formulation.

An incremental learning of environment properties is considered. Characteristics of attractive zones around observed agents are learned on the fly. A method for individuating attractive fields effect based on radial force hypothesis is proposed based on a quasilinear segmentation of the agents’ dynamics. An iterative method that approximates velocity fields produced by attractive zones is proposed when only information about agents’ dynamics is available.

Obtained maps can be used to perform further analysis by following a semantic approach where each characterized attractive area (letter) can be considered as part of a vocabulary, if activation sequences of attractive areas are detected with the proposed bank of filters, it would be possible to extract information about situations in an environment.

For future work, it is proposed to adopt a semantic representation of learned static areas properties, such that more complex interactions between agents and environments can be characterized by applying the built bank of filters based on attractive effects to new trajectories. For this approach, it is planned to using the innovations with their covariance matrices produced by the built bank of filters to characterize repulsive effects in environments.

## References

- 1
J-W Hsieh, Y-T Hsu, H-YM Liao, C-C Chen, Video-based human movement analysis and its application to surveillance systems. IEEE Trans. Multimedia.

**10**(3), 372–384 (2008). doi:10.1109/TMM.2008.917403. - 2
V Mahadevan, W Li, V Bhalodia, N Vasconcelos. Anomaly detection in crowded scenes, (2010), pp. 1975–1981, doi:10.1109/CVPR.2010.5539872.

- 3
O Aköz, ME Karsligil, Traffic event classification at intersections based on the severity of abnormality. Mach. Vis. Appl.

**25**(3), 613–632 (2014). doi:10.1007/s00138-011-0390-4. - 4
BT Morris, MM Trivedi, Trajectory learning for activity understanding: unsupervised, multilevel, and long-term adaptive approach. IEEE Trans. Pattern Anal. Mach. Intell.

**33**(11), 2287–2301 (2011). doi:10.1109/TPAMI.2011.64. - 5
X Wang, KT Ma, G-W Ng, WEL Grimson, Trajectory analysis and semantic region modeling using nonparametric hierarchical Bayesian models. Int. J. Comput. Vis.

**95**(3), 287–312 (2011). doi:10.1007/s11263-011-0459-6. - 6
K Kim, D Lee, I Essa. Gaussian process regression flow for analysis of motion trajectories, (2011), pp. 1164–1171, doi:10.1109/ICCV.2011.6126365.

- 7
D Helbing, I Farkas, T Vicsek, Simulating dynamical features of escape panic. Nature.

**407**(6803), 487–490 (2000). doi:10.1038/35035023. - 8
M Li, Y Zhao, L He, W Chen, X Xu, The parameter calibration and optimization of social force model for the real-life 2013 Ya’an earthquake evacuation in china. Saf. Sci.

**79:**, 243–253 (2015). doi:10.1016/j.ssci.2015.06.018. - 9
V Bastani, D Campo, L Marcenaro, C Regazzoni, Online pedestrian group walking event detection using spectral analysis of motion similarity graph. 12th IEEE International Conference on Advanced Video and Signal Based Surveillance (AVSS), 1–5 (2015). doi:10.1109/AVSS.2015.7301744.

- 10
S Zhou, Z Zhang, D Zeng, W Shen. Abnormal events detection in crowded scenes by trajectory cluster, vol. 9446, (2015), doi:10.1117/12.2180725.

- 11
W Hu, X Xiao, D Xie, T Tan, S Maybank, Traffic accident prediction using 3-D model-based vehicle tracking. IEEE Trans. Veh. Technol.

**53**(3), 677–694 (2004). doi:10.1109/TVT.2004.825772. - 12
V Bastani, L Marcenaro, CS Regazzoni, Online nonparametric Bayesian activity mining and analysis from surveillance video. IEEE Trans. Image Process.

**25**(5), 2089–2102 (2016). doi:10.1109/TIP.2016.2540813. - 13
M Haag, H-H Nagel, Incremental recognition of traffic situations from video image sequences. Image Vis. Comput.

**18**(2), 137–153 (2000). doi:10.1016/S0262-8856(99)00021-9. - 14
J Lan, Y Jiang, G Fan, D Yu, Q Zhang, Real-time automatic obstacle detection method for traffic surveillance in urban traffic. J. Signal Process. Syst.

**82**(3), 357–371 (2016). doi:10.1007/s11265-015-1006-4. - 15
F Castaldo, FAN Palmieri, V Bastani, L Marcenaro, C Regazzoni, Abnormal vessel behavior detection in port areas based on Dynamic Bayesian Networks. FUSION 2014 - 17th International Conference on Information Fusion.

**17:**, 1–7 (2014). - 16
P-R Lei, A framework for anomaly detection in maritime trajectory behavior. Knowl. Inf. Syst.

**47**(1), 189–214 (2016). doi:10.1007/s10115-015-0845-4. - 17
P Remagnino, SA Velastin, GL Foresti, M Trivedi, Novel concepts and challenges for the next generation of video surveillance systems. Mach. Vis. Appl.

**18**(3-4), 135–137 (2007). doi:10.1007/s00138-006-0059-6. - 18
JC Nascimento, MAT Figueiredo, JS Marques, Trajectory classification using switched dynamical hidden Markov models. IEEE Trans. Image Process.

**19**(5), 1338–1348 (2010). doi:10.1109/TIP.2009.2039664. - 19
M Andersson, F Gustafsson, D Prevost, L St-Laurent, Recognition of anomalous motion patterns in urban surveillance. IEEE J. Selected Topics Signal Process.

**7**(1), 102–110 (2013). doi:10.1109/JSTSP.2013.2237882. - 20
XD Lu, T Koga, Real-time motion detection for high-assurance aircraft tracking system using downlink aircraft parameters. Simul. Model. Pract. Theory.

**65:**, 81–92 (2016). - 21
B Cancela, M Ortega, A Fernández, G Penedo, Hierarchical framework for robust and fast multiple-target tracking in surveillance scenarios. Expert Syst. Appl.

**40**(4), 1116–1131 (2013). - 22
D Helbing, P Molnár, Social force model for pedestrian dynamics. Phys. Rev. E.

**51:**, 4282–4286 (1995). doi:10.1103/PhysRevE.51.4282. - 23
K Lewin, Field theory in social science: selected theoretical papers. Social science paperbacks (Happer, 1951).https://books.google.it/books?id=Q39EAAAAIAAJ.

- 24
S Seer, C Rudloff, T Matyus, N Brändle, Validating social force based models with comprehensive real world motion data. Transp. Res. Procedia.

**2:**, 724–732 (2014). - 25
D Helbing, A Johansson, Pedestrian, crowd, and evacuation dynamics. Encyclopedia of Complexity and Systems Science.

**16:**, 1–28 (2009). doi:10.1007/978-3-642-27737-5_382-5. - 26
C Rudloff, T Matyus, S Seer, D Bauer, Can walking behavior be predicted?Transp. Res. Record J. Transp. Res. Board.

**2264**(1), 101–109 (2011). doi:10.3141/2264-12. - 27
H Liu, Y Gan, J Yang, S Sidhom, Y Wang, Y Chen, F Ye,

*in Proceedings of the Annual International Conference on Mobile Computing and Networking, MOBICOM*. Push the limit of WiFi based localization for smartphones, 305–316 (2012). doi:10.1145/2348543.2348581. - 28
F Montorsi, F Pancaldi, GM Vitetta, Map-aware models for indoor wireless localization systems: an experimental study. IEEE Trans. Wirel. Commun.

**13**(5), 2850–2862 (2014). doi:10.1109/TWC.2014.040714.130893. - 29
A Yilmaz, O Javed, M Shah, Object tracking: a survey. ACM Comput. Surv.

**38**(4), 1–45 (2006). doi:10.1145/1177352.1177355. - 30
D Campo, V Bastani, L Marcenaro, C Regazzoni,

*in Proceedings of the IEEE 19th International Conference on Information Fusion (FUSION)*. Incremental learning of environment interactive structures from trajectories of individuals.**19:**, 589–596 (2016). - 31
J Lou, Q Liu, T Tan, W Hu,

*in Proceedings - International Conference on Pattern Recognition*. Semantic interpretation of object activities in a surveillance system.**16**(3), 777–780 (2002). doi:10.1109/ICPR.2002.1048115. - 32
SJ Russell, P Norvig,

*Artificial Intelligence: A Modern Approach*(Prentice Hall Press, Upper Saddle River, 2003). - 33
M Bhatt, HW Guesgen,

*Situational Awareness for Assistive Technologies - Volume 14 Ambient Intelligence and Smart Environments*(IOS Press, Amsterdam, 2012). - 34
AA Masoud, Decentralized self-organizing potential field-based control for individually motivated mobile agents in a cluttered environment: a vector-harmonic potential field approach. IEEE Trans. Syst. Man Cybern. Part A Syst. Hum.

**37**(3), 372–390 (2007). doi:10.1109/TSMCA.2007.893483. - 35
SM Wagh, DA Deshpande,

*Essentials of Physics*(PHI Learning, New Delhi, 2012). - 36
MB Hesse,

*Forces and Fields: The Concept of Action at a Distance in the History of Physics*(Dover Publications, Mineola, 2005). - 37
M Tenenbaum, H Pollard,

*Ordinary Differential Equations*(Dover Publications, Incorporated, Mineola, 2012). - 38
PC Mahalanobis,

*in Proceedings National Institute of Science, India*. On the generalised distance in statistics.**2**(1), 49–55 (1936). - 39
S Yi, H Li, X Wang,

*in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)*. Understanding Pedestrian Behaviors from Stationary Crowd Groups, 3488–3496 (2015). doi:10.1109/CVPR.2015.7298971. - 40
X Ge, P Smyth,

*Segmental Semi-Markov Models and Applications to Sequence Analysis*(University of California, Irvine, 2002). - 41
E Keogh, S Chu, D Hart, M Pazzani, Segmenting time series: A survey and novel approach. Data mining in time series databases.

**57:**, 1–22 (2004). - 42
J Zhou, G Ye, D Yu, A new method for piecewise linear representation of time series data. Phys. Procedia.

**25:**, 1097–1103 (2012). doi:10.1016/j.phpro.2012.03.205. - 43
J Hunter, N McIntosh, W Horn, Y Shahar, G Lindberg, S Andreassen, J Wyatt (eds.), Knowledge-Based Event Detection in Complex Time Series Data (Springer, Berlin, Heidelberg, 1999).

- 44
X Liu, Z Lin, H Wang, Novel online methods for time series segmentation. IEEE Trans. Knowl. Data Eng.

**20**(12), 1616–1626 (2008). doi:10.1109/TKDE.2008.29. - 45
B Teixeira, L Tôrres, P Iscold, L Aguirre, Flight path reconstruction—a comparison of nonlinear Kalman filter and smoother algorithms. Aerosp. Sci. Technol.

**15**(1), 60–71 (2011). doi:10.1016/j.ast.2010.07.005. - 46
J García, J Besada, J Molina, G De Miguel, Model-based trajectory reconstruction with {IMM} smoothing and segmentation. Inf. Fusion.

**22:**, 127–140 (2015). doi:10.1016/j.inffus.2014.06.004.

### Funding

This work was partially developed within the MIE (Mobilità Intelligente Ecosostenibile) project, co-funded by the Italian Ministry of University and Research for the National Technological Cluster for the Smart Communities.

### Authors’ contributions

All the authors have participated in writing the manuscript and have revised the final version. All authors read and approved the final manuscript.

### Competing interests

The authors declare that they have no competing interests of any type.

## Author information

## Rights and permissions

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## About this article

#### Received

#### Accepted

#### Published

#### DOI

### Keywords

- Kalman filtering
- Interactive force models
- Trajectory analysis
- Representation of environments
- Situation awareness