## Figures

## Abstract

This study aims to develop a microscopic pedestrian behavior model considering various interactions on pedestrian dynamics at crosswalks. Particularly, we take into account the evasion behavior with counter-flow pedestrians, the following behavior with leader pedestrians, and the collision avoidance behavior with vehicles. Aerial video data at one intersection in Beijing, China are extracted for model calibration. A microscopic calibration approach based on maximum likelihood estimation is applied to estimate the parameters of a modified social force model. Finally, we validate step-wise speed, step-wise acceleration, step-wise direction change, crossing time and lane formation phenomenon by comparing the real data and simulation outputs.

**Citation: **Liu M, Zeng W, Chen P, Wu X (2017) A microscopic simulation model for pedestrian-pedestrian and pedestrian-vehicle interactions at crosswalks. PLoS ONE 12(7):
e0180992.
https://doi.org/10.1371/journal.pone.0180992

**Editor: **Charlotte K. Hemelrijk, Rijksuniversiteit Groningen, NETHERLANDS

**Received: **February 1, 2017; **Accepted: **June 23, 2017; **Published: ** July 17, 2017

**Copyright: ** © 2017 Liu et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

**Data Availability: **All relevant data are within the paper and its Supporting Information files.

**Funding: **The authors appreciate the National Natural Science Foundation of China (No. 51308475 and U1564212) for kind support of this research. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

**Competing interests: ** The authors have declared that no competing interests exist.

## Introduction

Studying the self-organization phenomena of pedestrian crowd is an active subject in transportation science. To date, pedestrian behavior modeling has attracted considerable attentions [1–7]. A better understanding of the interaction behavior would help to improve microscopic simulation and thus allow more accurate prediction of their behavior for various situations. This also helps to evaluate the service and safety level on pedestrian related traffic, such as pedestrian movement in urban streets and crosswalks.

Generally, existing pedestrian behavior models can be classified into three categories: macroscopic, mesoscopic and microscopic models. In the last decades, mesoscopic and microscopic models have attracted much attention because they enable to offer a more detailed analysis on pedestrian behavior.

The mesoscopic models are usually based on kinetic theory and game theory, in which the microscopic interaction can be represented through a statistical distribution of the microscopic position and velocity. One of the motivations of applying kinetic theory is to model the complexity issues of living systems such as crowds. Following the kinetic theory, Bellomo et al developed a simulation model representing the dynamics of collective behaviors [5, 8]. Degond et al introduced a hierarchy of kinetic and macroscopic models derived from a heuristic description at the micro-scale, and they developed an analogy between a Local Thermodynamically Equilibrium and Nash equilibria in a game theoretic framework [9]. Wang et al [10] developed two efficient numerical methods for a multiscale kinetic equation in the context of crowd dynamics with emotional contagion, and they particular focused on when the particle characteristics can cross and whose long time behavior is not flocking.

The family of microscopic models includes Cellular Automata [11, 12], social force model [13–15], velocity-based model [16, 17], discrete choice model [18] and lattice gas model [19, 20]. To our knowledge, Cellular Automata model and social force model are popular models for pedestrian dynamics because they are able to describe most of the self-organization phenomena of large crowd. Cellular Automata are microscopic models with grid-based motion decisions, in which a set of rules define the state/occupation of a cell in dependence of the neighborhood of the cell, and a transition matrix is used to update the cell states in successive time steps. However, pedestrians behave flexibly and the choice of next step is unrestricted dynamic, which cannot be fully taken into account by only choosing one option from a limited set of cells. The fluid crowd modeling method of Henderson [21] has been the starting point of the social force model. Later, a magnetic-force model [22] was developed by borrowing a motion equation used for magnetic fields. Based on these concepts, a more robust physical force based model, i.e., social force model [11], was developed and applied to evacuation analysis. The physical force based model makes it possible not only to accurately describe dynamic pedestrian movement in space, but also to reproduce the self-organization phenomenon such as lane formation, stop-and-go waves and turbulence [4].

Pedestrian microscopic simulation has gathered a lot of interest in the modeling of safety analysis of pedestrian infrastructures and crowd evacuation. Lian et al. analyzed collective movement characteristics on a four-directional intersecting flow and they found that putting an obstacle in the center of cross area will improve traffic stability [23]. Duives et al. found that the distance headway, the time headway, the sight angle, the interaction angle, the absolute speed and the number of pedestrians located nearby significantly influence on the strength of the reaction of pedestrians walking within a crowd [24]. Bellomo et al. [25] proposed to view human crowds as a large living system in evacuation dynamics. They found that the dynamics can be subject to the heterogeneous behaviors and social interactions. Ronchi et al [26] developed a multi-agent continuous model for large-scale evacuation safety simulation at music festivals. They found that the evacuation time curves coupled with the visual analysis allowed for identifying the predominant factor affecting evacuation such as delay time and flows through exits. In recent decades, a large number of studies have been focused on bi-directional flow in pedestrian dynamics [27, 28]. The basic characteristics related to fundamental diagrams [27] and self-organization such as lane formation [29, 30] and jamming transition [31], were investigated in experimental ground fields or actual scenes. Interestingly, there is no conclusion yet whether the traffic flow performance is different or not between uni-directional and bi-directional flows. Teknomo found that the two-way traffic performance reduces significantly as the number of pedestrians increase [32]. Lam et al. stated that there is no significant difference between bidirectional flow and unidirectional flow if the densities of the opposite streams are similar [33]. Helbing et al. stated that counter-flows could be more efficient than unidirectional flows [29]. However, they compare average flows without considering the influence of the density. Kretz et al. found that the speed and fluxes did not reduce a lot within bi-directional flow due to the self-organization phenomenon [28].

Crossing behaviors at unsigalized and signalized intersections are critical factors that may result in safety problems. A case study in China showed that the rates of compliance with traffic rules at signalized intersections are influenced by crossing distance, signal timing, and pedestrian volume [34]. Yang et al. [35] developed a microscopic simulation model for pedestrians’ signal non-compliance decision in the mixed traffic in China. Gorrini et al. [36] modeled the elderly inhabitants and risky pedestrian-vehicle interaction on unsignalized intersections. Feng et al. [37] built a microscopic model to simulate crossing behavior in a street to evaluate the service level. Li et al. [38] modified the social force model by considering the required space and the critical gaps with turning vehicles, which makes it possible to describe the stop/go decision to the conflicting vehicles. Anvari et al. [39] simulated the interaction between pedestrian and vehicle by using a rule-based social force model for shared space environments.

In addition, many research focused on the model calibration and validation. Isenhour et al. developed a pedestrian simulation tool for fire evacuation analysis and they recommended seventeen verification tests according to the United States’ National Institute of Standards and Technology [40]. Daamen and Hoogendoorn designed laboratory experiments to estimate parameters of the Nomad pedestrian simulation model for bottlenecks in the evacuation of a building and the simulation results showed that complex walker models can indeed be calibrated by empirical data [41, 42]. Campanella et al. further quantified the validation of the Nomad pedestrian simulation model by combining multi-objective assessments such as average travel times, the speed-density fundamental relation and bottleneck capacity [43]. Seer et al. estimated the model parameters and their distributions with nonlinear regression based on observed trajectories [44].

To develop and calibrate microscopic pedestrian models usually requires accurate and comprehensive trajectory data on individual pedestrian movement. The traditional data acquisition method is to shoot video and apply tools to detect and track the individual movement of each pedestrian. Both manual and automated tracking approaches can be found. Multiple cameras were usually used to shot videos at intersections and manually extracted trajectories of individual pedestrians and turning vehicles [6, 7]. The synchronization among multiple cameras from different views was complicated and required extra effort. To facilitate trajectory extraction process from video, some researches [44–47] conducted control experiments by equipping participants with distinctive wear, e.g., colored hats, for better identification. With the recent price drop of off-the-shelf unmanned aerial vehicle (UAV) products, increasing researchers are exploring the potentials of using UAVs for pedestrian and vehicle detection and tracking. On the basis of the authors’ ongoing work, this study will use UAVs to obtain accurate tracking data from a top-down view for pedestrian behavior model calibration.

In summary, there is growing interest in developing a simulation model for pedestrian dynamic behavior in various scenarios. However, only limited studies shed light on crossing behavior such as interaction with counter-flow pedestrians, turning vehicles, and traffic regulations. For practical applications such as traffic safety assessment at crosswalks, the current pedestrian models for crowd simulation are inadequate. This study aims to fill this gap by developing a microscopic model considering various interaction behaviors among road users at crosswalk. Furthermore, an estimation approach for calibrating the microscopic model based on real trajectory data is proposed. Last, the validation is conducted to confirm the model performance on step-wise location, fundamental diagram and lane formation phenomenon.

## Model description

As shown in Fig 1, the microscopic model includes two layers, i.e., a tactical layer and an operational layer, inspired by Hoogendoorn and Bovy’s conceptual modeling framework [48]. The desired direction of movement is determined in the tactical layer. The operational layer determines the microscopic behavior when pedestrians interact with other agents. In this layer, we assume that the subject pedestrian interacts with other pedestrians and vehicles. The interaction with surrounding pedestrians can be further divided into two types, i.e., interaction with counter-flow pedestrians and interaction with leading pedestrians. A repulsive force is used to represent the interaction with counter-flow pedestrians, while an attractive force is used to represent the interaction with leading pedestrians. The pedestrian-vehicle conflict mechanism is also included in this model. Risk-taking pedestrians might enter the crosswalk even though the vehicle is approaching. We model the “waiting/crossing” behavior with a bi-logit model and develop detour route plan and repulsive force model for pedestrian-vehicle interaction. The detail of the pedestrian behavior in the tactical and the operational layers is introduced in the following sections.

The microscopic model includes two layers, i.e., a tactical layer and an operational layer. The desired direction of movement is determined in the tactical layer. The operational layer determines the microscopic behavior when pedestrians interact with other agents.

### Desired direction

As shown in Fig 2, the desired direction is assumed to be determined by the desired exit position of the crosswalk. The desired exit position is defined as the intersecting point of the curve of crosswalk edge and the desired walking trajectory. Assumed that the shape of crosswalk is rectangular, the desired exit position can be represented by using the perpendicular distance to the crosswalk boundary (stop line side) when the pedestrian exits the crosswalk. We assumed that the distribution of exit positions is influenced by origin-destination (OD). More specifically, the exit position distribution is assumed to have a peak on the right side or left side and the side of skewness is dependent on the OD direction. However, most probability distributions (including Gamma, lognormal, and Weibull) cannot represent a distribution with right-side skewness and they assume that the random variable spreads over the whole range of the real number axis, but in practice, the exit position makes sense only within the width of the crosswalk. To fill this gap, the concept of truncated normal distribution is introduced, which is able to represent a distribution with arbitrary skewness and a specified range as shown in Fig 3. The probability density function is given by:
(1)
(2)
(3)
where *x* denotes the exit position; *a* and *b* denote the lower bound and upper bound of the truncated range, respectively, which are constrained by the crosswalk width; *Φ* denotes the cumulative distribution function of a standard normal distribution; *μ* and *σ* are the parameters to be estimated, which denote the mean and standard deviation of the non-truncated distribution, respectively.

The desired direction is assumed to be determined by the desired exit position of the crosswalk. The desired exit position is defined as the intersecting point of the curve of crosswalk edge and the desired walking trajectory.

The concept of truncated normal distribution is able to represent a distribution with arbitrary skewness and a specified range.

We assumed that the distribution of exit position is influenced by the OD direction, crosswalk length *d*_{l}, crosswalk width *d*_{w} and pedestrian density *ρ*. *μ* and *σ* can be expressed as the following regression functions.
(4)
(5)
where *M*_{0}, *M*_{1}, and *M*_{2} are the dummy variables representing eight directions of the OD on a crosswalk; *b*_{0},…,*b*_{6},*c*_{0},…,*c*_{6} are the model coefficients to be estimated.

### Driving force

The step-wise decision process of movement is assumed to include two steps. First, the pedestrian selects the velocity direction based on the desired direction and subsequently the desired speed. Second, the pedestrian adjusts the speed to avoid the conflict with other pedestrians and vehicles.

Pedestrians are assumed to move with individual desired speed and desired direction to the next destination. The desired direction is determined by the current position and the exit position at crosswalk. A deviation of the current speed vector from the desired speed vector leads to a force to recover to the desired speed within a certain relaxation time *τ*_{α}.

According to the empirical analysis [29], the desired speed is approximately normal distribution. To compensate for delays at signalized crosswalk, the desired speed is assumed to increase in the course of waiting time due to the traffic light. Assumed that the desired speed is influenced by the waiting time *t*_{w} and pedestrian density *ρ*, we formulate the regression function for desired speed as follows.
(8)
(9)
where *a*_{0}, *a*_{1}, and *a*_{2} are the model coefficients to be estimated; is the standard deviation of the error term.

### Interaction with counter-flow pedestrians

According to the social force theory [13], each conflicting pedestrian within the subject pedestrian’s visual range is assumed to generate a repulsive force to the subject pedestrian, as shown in Fig 4(A). In the original social force model, it is usually assumed that the magnitude of the repulsive force increases monotonically as the relative distance decreases. However, this assumption is not realistic, considering the fact that the repulsive effect might be quite weak if no potential conflict exists or the relative time to potential conflict point will be quite long. Fig 4(B) shows the case of valid and invalid conflicts. The potential conflict does not exist if their future trajectories have no intersect by keeping their current walking directions. The relative time to the potential conflict should be infinite and the repulsive effect does not exist if two pedestrians stop walking even though they are very close. As shown in Fig 5, the relative time to collision (RTTC) is defined as the time difference between the first road user arriving at the potential conflicting location and the second road user arriving at this location if they keep their current speeds. Here, we use the concept of time to conflict point (TTCP) to identify the valid conflict situation. TTCP is defined as the expected time for two pedestrians to pass the intersection point of their trajectories if they keep their current speeds and directions. The TTCP for the subject pedestrian *α* and the conflicting pedestrian *β* can be given as follows.

(a) It is usually assumed that the magnitude of the repulsive force increases monotonically as the relative distance decreases. (b) It shows the case of valid and invalid conflicts.

The relative time to collision (RTTC) is defined as the time difference between the first road user arriving at the potential conflicting location and the second road user arriving at this location if they keep their current speeds.

Where

- is the current position of the conflicting pedestrian
*β*; - is the intersection point of the two pedestrian trajectories.

The positive values of TTCPs of both pedestrians indicate that the conflict exists, while the negative values indicate that one pedestrian had passed the conflict point and no potential collision will occur.

Accordingly, TTCP can be formulated as follows.

(12)The relative time (*T*_{αβ}) to the conflict point instead of the relative distance is considered as the influential factors to the repulsive force. The repulsive force () of conflicting pedestrians can be presented as follows.
(13)
where is the interaction strength coefficient, is the interaction range coefficient for the relative time, *n* is the number of conflicting pedestrians, is the normalized vector which is pointing from pedestrian *β*_{i} to *α*.

### Interaction with leading pedestrians

We observed that pedestrians preferred to follow the leading pedestrians and joined the group with similar walking directions to avoid intensive interaction with the counter-flow pedestrians. In crowded situations, pedestrians can keep a stable speed and move smoothly by following the leading pedestrians without interactions with the counter-flow pedestrians frequently. Such leader-follower behavior naturally caused the lane formation phenomenon especially when the pedestrian flow became crowded. Even though the lane formation could be also generated without explicitly considering the leader-follower behavior, the generated “lanes” were weak and were easy to breakdown in our original model. To present the collective behavior that result in the swarming effect when the pedestrian density become high at signalized intersections, the attractive force from the leading pedestrians is also formulated.

As shown in Fig 6, it is assumed that the subject pedestrian will be attracted by the “footprints” of the pedestrians ahead with the same movement direction [49]. These “footprints” will disappear in the course of time with a rate 1/*T* where *T* can be regarded as the lifecycle of “footprints”. Different from the repulsive force, the function of the attractive force is not only related to the distance to “footprints”, but also related to the lifecycle of “footprints”. According to Helbing’s study [49], the attractive force () generated from “footprints” can be formulated as follows.

The subject pedestrian will be attracted by the “footprints” of the pedestrians ahead with the same movement direction.

*t*denotes the discretization interval of lifecycle

*T*,

*n*is the number of interval, is the position of the “footprint” of pedestrian

*β*

_{i}at time (

*t*−

*n*Δ

*t*), is the normalized vector pointing from pedestrian

*a*to the “footprint” of pedestrian

*β*

_{i}at time (

*t*−

*n*Δ

*t*), and are the coefficients to be estimated.

### Interaction with turning vehicles

Pedestrian-vehicle conflicts frequently occur due to the shared signal phase and risk-taking behavior. Drivers are usually required to yield to crossing pedestrians in a right-turn-permitted signal phase (right-hand traffic). However, in developing countries such as China, certain drivers might undertake risky behavior such as entering the crosswalk even if pedestrians are approaching. On the other hand, some risk-taking pedestrians enter the crosswalk before the green light or at the beginning of the red light, which also increase the severe conflict with the vehicles. Since this study mainly focuses on the crossing behavior of pedestrian, the behavior of vehicle is not discussed here. To model the pedestrian behavior during the pedestrian-vehicle interaction process, a three-layer strategy is implemented. In the upper layer, the pedestrian can choose to wait or cross to avoid the conflict when a vehicle is approaching. If the pedestrian chooses to cross, he/she will plan a detour route to avoid the potential collision in the middle strategy layer. Then, a repulsive force from the turning vehicle further acts on the pedestrian moving behavior in the lower layer.

In the upper layer of decision making, we assume that there are two types of pedestrian giving-way maneuvers when the pedestrian-vehicle conflict occurs: waiting until the vehicle passes by and crossing before the vehicle passes by. We expect that the probability of choosing crossing is lower if the pedestrian reaches the potential conflict point later than the vehicle. Therefore, a binary logit model can be utilized to describe this behavior, in which the utility function can be formulated by the relative time to the potential conflict point as shown in Fig 7. The “waiting/crossing” strategy is formulated as follows.

There are two types of pedestrian giving-way maneuvers when the pedestrian-vehicle conflict occurs: waiting until the vehicle passes by and crossing before the vehicle passes by.

*P*

_{r}(

*crossing*) is the probability of choosing “crossing”,

*T*

_{ttc}is the relative time to the potential conflict point,

*T*

_{veh}is the time to the potential conflict point for the vehicle,

*T*

_{ped}is the time to the potential conflict point for the pedestrian,

*e*

_{0}and

*e*

_{1}are the coefficients to be estimated.

In the middle strategy layer, we assume that pedestrians can identify possible routes to avoid the collision with vehicles based on the occupied location of conflicting vehicles. Pedestrians move through the desired route from their origin to destination via intermediate destinations. A link-node network as shown in Fig 8 can be used to describe this strategy layer. The initial link cost is set to be the distance between the adjacent cells and is dynamically updated using a penalized value that depends on the occupation of vehicle. It should be noted that the detour movement is determined by the combination effect of the desired route and the repulsive force from the conflicting vehicle.

The walking space is divided into separate cells where each cell is connected to each other by directed links.

As shown in Fig 8, the walking space is divided into separate cells where each cell is connected to each other by directed links. The size of each cell is usually set to 40×40 cm^{2} [11]. The initial link cost is set to the distance between the adjacent cells and is dynamically updated using a penalized value that depends on whether the cell is occupied by the turning vehicles. And then, a shortest path algorithm is applied to find the optimal route. It is assumed that pedestrians move with individual desired speeds along the optimal route. The desired moving direction is determined by the current position and the next node (center of the next cell) along the optimal route. Then, the driving force is updated as follows.
(18)
where is the moving direction along the detour route.

In the lower strategy layer, the microscopic moving behavior is assumed to be affected by the vehicle force field once the vehicle enters the personal interaction range. Similar to the force from an obstacle, the repulsive force is determined by the pedestrian position and the direction of speed. Since the size of a vehicle is much larger than the pedestrian, it cannot be regarded as a point. As shown in Fig 9, a vehicle is now represented by an ellipse with the radius *r*(*φ*_{Vα}) which depends on the angle between the moving direction of the vehicle and the moving direction of a close-by pedestrian. The radius can be formulated as follows.

A vehicle is now represented by an ellipse with the radius which depends on the angle between the moving direction of the vehicle and the moving direction of a close-by pedestrian.

*w*is the width of the turning vehicle and

*l*is the length of the turning vehicle.

Accordingly, the repulsive force from a conflicting vehicle can be presented as follows.
(20)
where *d*(*φ*_{Vα}) is the distance between the central of pedestrian *α* and the central of vehicle *V*, is the normalized vector pointing from the central of pedestrian *V* and the central of vehicle *α*, and is the normalized vector pointing from the central of pedestrian *α* and the central of vehicle *V*.

### Resultant force

The sum of the force terms exerted to pedestrian *α* from the desired destination, the counter-flow pedestrians, leading pedestrians, and turning vehicles can be expressed as follows.
(21)
where is the resultant force at time *t*_{k}, is the driving force at time *t*_{k}, is the repulsive force from conflicting pedestrian at time *t*_{k}, is the attractive force from leading pedestrians at time *t*_{k}, is the repulsive force from conflicting vehicle at time *t*_{k}, is the fluctuation term.

The step-wise speed and position can be expressed as follows: (22) (23) where

- : the updated speed at time
*t*_{k}; - : the previous speed at time
*t*_{k−1}; - Δ
*t*: the simulation time step which is set to 0.04s in this study; - : the updated position at time
*t*_{k}; - : the previous position at time
*t*_{k−1}.

## Calibration methodology

As shown in Fig 10, the empirical data were extracted using aerial videos captured by an optical camera with a 1920 × 1080 resolution mounted on a quadrotor with the flight altitude of about 40m-60m above the ground. The trajectories of pedestrians and turning vehicles at one intersection in Beijing, China were extracted from the video every 0.04s for model calibration. The dataset consists of the trajectories of 904 pedestrians and 156 turning vehicles. In total, 55,300 position samples are available. The available observations are trajectory profiles based on time series. From these data, all relevant quantities can be derived either directly or by applying finite differences, such as positions, velocities, accelerations, distances between pedestrians, and direction change.

Empirical data were extracted using aerial videos captured by an optical camera with a 1920 × 1080 resolution mounted on a quadrotor with the flight altitude of about 40m-60m above the ground.

To reproduce reasonable pedestrian trajectories in simulation, we calibrate the regression models (Eqs (4,5,8 and 15)) and the social force model (Eq (21)) based on maximum likelihood estimation (MLE). Because the social force model is two-dimensional (include x and y direction), a two-dimensional MLE [50] is introduced to calibration. The random error of Eq (21) is assumed to have a bivariate normal probabilistic density function with zero mean and a variance-covariance matrix (**Σ**). Accordingly, the likelihood *L*_{k} of a single prediction step is directly related to the probability density function of the normal distribution as follows.
(24)
(25)
where is the observed acceleration at time *t*_{k}, *θ*_{p} the model parameters to be estimated.

For a set of *N* independent individuals and each individual has *M*_{i} time steps, the two-dimensional normal likelihood function can be formulated as follows.

To facilitate the computation, the likelihood function is usually converted into a log-likelihood function as follows.

(27)The maximum log-likelihood estimates of model parameters are obtained such that Eq (27) is maximized. This could be achieved by minimizing the negative log-likelihood, i.e., -*lnL*(*θ*_{p}), in Matlab program. We use the “fminunc” function in Matlab to find a minimum of the negative log-likelihood function with several variables.

## Calibration result

Table 1 shows the parameter estimation for the distribution of exit position in Eqs (4) and (5). A parameter has statistical significance at a 95% confidence level if the p-value is less than 0.05. All of the parameters are statistically significant, indicating that the explanatory variables are meaningful. A positive sign of parameters means that the dependent variable increases as the explanatory variable value increases, while a negative sign means that the dependent variable decreases as the explanatory variable value increases. Interestingly, it is found that the increase in crosswalk length, crosswalk width and pedestrian density will lead to the increase of variation of exit position.

Table 2 shows the parameter estimation for the desired speed expressed by Eqs (8 and 9). All of the parameters are statistically significant. This result indicates that the desired speed increases with increasing waiting time because the parameter sign for waiting time is positive, whereas the desired speed decreases with increasing pedestrian density because the parameter sign for pedestrian density is negative.

Table 3 shows the parameter estimation for acceleration behavior in Eqs (15–17) when a conflicting vehicle is approaching. The positive sign of *e*_{0} indicates that pedestrians tend to cross if the arrival time to the potential conflict point is earlier than that of the conflicting vehicle. In such a situation, the conflict with the vehicle might be alleviated if the vehicle maintains speeds or decelerates. However, the conflict becomes severe if the vehicle chooses to accelerate.

Table 4 shows the calibration results for the social force model. The estimates are plausible in terms of their magnitude. According to the p-value at the 95% confidence level, all the parameters in the modified social force model are significant.

## Model Performance

### Error analysis

Fig 11(A) and 11(B) show the pedestrian trajectories from real data and simulation outputs, respectively. To quantify the trajectory performance, Fig 11(C) illustrates the location errors in x and y directions. It is found that 82.9% of the step-wise location errors are within 0.05m in x direction and 0.3m in y direction. To further illustrate the simulation performance, we compare the step-wise walking speed, step-wise acceleration, step-wise direction change and crossing time in observation and simulation. The comparison of the step-wise walking speed is shown in Fig 12(A). The average absolute error of walking speed in simulation is 0.16m/s. The speed distributions of the simulated environment match closely the observed data according to the t-value. Fig 12(B) shows the comparison of step-wise acceleration distributions. The observed and simulated values are not significantly different (t-value<1.96), which confirms the social force generated by the proposed model is reasonable. Fig 12(C) shows the distribution of the step-wise direction change between current and previous directions. Zero degree means the pedestrian keeps the current direction and move straight. The angle variation can reflect the frequency of interactions with conflicting pedestrians or other factors. According to the simulation results, most of the pedestrians keep their directions or only change a small angle in each time step, which agree with the statistics in the observed dataset. Fig 12 It was found that there are about 95% of the pedestrians finishing crossing within 36s. It is also consistent with the empirical observation.

(a) shows the pedestrian trajectories from real data and (b) shows simulation outputs.

(a) shows the average absolute error of walking speed. (b) shows the comparison of step-wise acceleration distributions. (c) shows the distribution of the step-wise direction change between current and previous directions. (d) shows the distribution of the crossing time at crosswalk.

### Fundamental diagram

Since the pedestrian flow characteristic can be represented by fundamental diagram, we compare the speed-density and flow-density diagrams in real data and simulation outputs to demonstrate the model performance. The spatial mean speed and density are calculated by taking a cell 40×40 cm^{2} in the crosswalk as the measurement area. We calculate the speed and density every 1s. As shown in Fig 13, the simulated fundamental diagrams are in good agreement with the observed ones. But the scattered points are more scattered in observed data. It could be explained by the stochastic moving behavior because the moving direction and speed are quite flexible in the real situation especially in free-flow situation. However, the stochastic moving behavior has not been fully reproduced by simulation even though we applied a complex social force model and several behavior strategies. To improve the performance of fundamental diagram, the personal heterogeneity and stochasticity should be investigated in the future study.

The simulated fundamental diagrams are in good agreement with the observed ones.

### Lane formation

Lane formation is one of the most interesting phenomena that characterize pedestrian flow. Such a phenomenon is caused by conflict avoidance and leader-follower behavior. To demonstrate this phenomenon, a crowded scenario is set for the simulation. The bi-direction pedestrian demand is set to be 57 pedestrians per signal cycle according to the video recording. Fig 14 shows the evolution of the lane formation in one signal cycle. The snapshot at 10 s shows the bi-directional pedestrian flow without conflict with opposite pedestrians. At this moment, the lane formation phenomenon is not significant because the conflict from the front pedestrian is not intense. However, the southbound pedestrian flow begins to form a group when the pedestrians perceive a serious conflict from the counter-flow. The group formation can be explained by the attractive effect of the front “footprints”, which improves the smoothness when a large counter-flow crowd arrives. The snapshot at 15s shows the beginning of conflict occurrence. At this point, the lane formation phenomenon begins to occur. The lane formation from the north side appears first and can be explained by the observation that the pedestrian crowd with a smaller group size perceives the conflict earlier than the opposite pedestrian crowd with a larger group size. Earlier lane formation enables easier progress through the pedestrian counter-flow. The simulation shows that lane formation occurs when the bi-direction pedestrian flow meets, which is consistent with the observed scenario. The snapshot at 20 s shows that the “lane” is formed when the bi-directional pedestrian flow merges. The observed scenario shows that the southbound pedestrian flow forms one “lane”, and this “lane” separates the opposite flow into two “lanes”. In this manner, intensive interaction with the opposite pedestrians can be reduced, and a higher and more stable speed is possible. The “lanes” generated by the proposed model are consistent with the observed “lanes”. It was found that the “lanes” have a similar size and maintain a relatively stable shape for the crossing period using the proposed model.

The evolution of the lane formation in one signal cycle.

## Conclusions and future work

A two-layer microscopic model is presented to simulate the interactions between pedestrians and vehicles at signalized intersections. A modified social force model considering the evasion behavior with counter-flow pedestrians, the following behavior with the leader pedestrians, and the collision avoidance behavior with vehicles was developed. The calibration is undertaken using the trajectory data (samples are given in S1 Table) of pedestrians and vehicles at one intersection in Beijing, China. The parameters of the developed model are calibrated by a two-dimensional MLE. Finally, the model performance is verified by comparing observed and estimated pedestrian flow characteristics, such as speed, acceleration, direction change, fundamental diagram and lane formation.

This simulation tool is recommended to be used by public authorities to gain more knowledge about how pedestrians and drivers interact with each other in the crosswalk. Furthermore, the cause of pedestrian-vehicle conflict can be identified in advance by simulation, which enables to provide information about potential safety problems prior to facility implementation.

## Supporting information

### S1 Table. Observed and simulated trajectory samples.

https://doi.org/10.1371/journal.pone.0180992.s001

(DOCX)

## Author Contributions

**Conceptualization:**ML.**Data curation:**WZ.**Formal analysis:**WZ.**Funding acquisition:**PC.**Investigation:**WZ.**Methodology:**WZ.**Project administration:**XW.**Resources:**XW.**Software:**WZ.**Supervision:**PC.**Validation:**PC.**Visualization:**ML.**Writing – original draft:**ML.**Writing – review & editing:**WZ.

## References

- 1. Kneidl A., Hartmann D., & Borrmann A. (2013). A hybrid multi-scale approach for simulation of pedestrian dynamics. Transportation research part C: emerging technologies, 37, 223–237.
- 2. Papadimitriou E., Yannis G., & Golias J. (2009). A critical assessment of pedestrian behaviour models. Transportation research part F: traffic psychology and behaviour, 12(3), 242–255.
- 3.
Helbing D., & Johansson A. (2009). Pedestrian, crowd and evacuation dynamics. Springer New York.
- 4. Duives D. C., Daamen W., & Hoogendoorn S. P. (2013). State-of-the-art crowd motion simulation models. Transportation research part C: emerging technologies, 37, 193–209.
- 5. Bellomo N., Piccoli B., & Tosin A. (2012). Modeling crowd dynamics from a complex system viewpoint. Mathematical models and methods in applied sciences, 22(supp02), 1230004.
- 6. Zeng W., Chen P., Nakamura H., & Iryo-Asano M. (2014). Application of social force model to pedestrian behavior analysis at signalized crosswalk. Transportation research part C: emerging technologies, 40, 143–159.
- 7. Zeng W., Nakamura H., & Chen P. (2014). A modified social force model for pedestrian behavior simulation at signalized crosswalks. Procedia-Social and Behavioral Sciences, 138, 521–530.
- 8. Bellomo N., Bellouquid A., & Knopoff D. (2013). From the microscale to collective crowd dynamics. Multiscale Modeling & Simulation, 11(3), 943–963.
- 9. Degond P., Appert-Rolland C., Moussaid M., Pettré J., & Theraulaz G. (2013). A hierarchy of heuristic-based models of crowd dynamics. Journal of Statistical Physics, 152(6), 1033–1068.
- 10. Wang L., Short M. B., & Bertozzi AL. (2016). Efficient numerical methods for multiscale crowd dynamics with emotional contagion. Mathematical Models and Methods in Applied Sciences, 1–26.
- 11. Burstedde C., Klauck K., Schadschneider A., & Zittartz J. (2001). Simulation of pedestrian dynamics using a two-dimensional cellular automaton. Physica A: Statistical Mechanics and its Applications, 295(3), 507–525.
- 12. Guo R. Y. (2014). New insights into discretization effects in cellular automata models for pedestrian evacuation. Physica A: Statistical Mechanics and its Applications, 400, 1–11.
- 13. Helbing D., & Molnar P. (1995). Social force model for pedestrian dynamics. Physical review E, 51(5), 4282.
- 14. Helbing D., Farkas I., & Vicsek T. (2000). Simulating dynamical features of escape panic. Nature, 407(6803), 487–490. pmid:11028994
- 15. Parisi D. R., Gilman M., & Moldovan H. (2009). A modification of the social force model can reproduce experimental data of pedestrian flows in normal conditions. Physica A: Statistical Mechanics and its Applications, 388(17), 3600–3608.
- 16.
Karamouzas I., & Overmars M. (2010). A velocity-based approach for simulating human collision avoidance. In Intelligent Virtual Agent (pp. 180–186). Springer Berlin Heidelberg.
- 17. Fiorini P., & Shiller Z. (1998). Motion planning in dynamic environments using velocity obstacles. The International Journal of Robotics Research, 17(7), 760–772.
- 18. Robin T., Antonini G., Bierlaire M., & Cruz J. (2009). Specification, estimation and validation of a pedestrian walking behavior model. Transportation Research Part B: Methodological, 43(1), 36–56.
- 19. Guo R. Y., & Huang H. J. (2008). A mobile lattice gas model for simulating pedestrian evacuation. Physica A: Statistical Mechanics and its Applications, 387(2), 580–586.
- 20. Shang H. Y., Huang H. J., & Zhang Y. M. (2015). An extended mobile lattice gas model allowing pedestrian step size variable. Physica A: Statistical Mechanics and its Applications.
- 21. Henderson L. F. (1974). On the fluid mechanics of human crowd motion. Transportation research, 8(6), 509–515.
- 22. Okazaki S. (1979). A study of pedestrian movement in architectural space, Part I: pedestrian movement by the application of magnetic models. In Trans. A.I.J., 283, 111–119.
- 23.
Lian L., Song W., Richard Y. K. K., & Wu C. (2016). Experimental Study of High-Density Pedestrian Flow Field Characteristics at a Crossing. In Traffic and Granular Flow'15 (pp. 57–64). Springer International Publishing.
- 24.
Duives, D. C., Daamen, W., & Hoogendoorn, S. P. (2016). The influence of the interaction characteristics on the movement dynamics of pedestrians. In Proceedings of the 8th International Conference on Pedestrian and Evacuation Dynamics (PED2016). Hefei, China.
- 25. Bellomo N., Clarke D., Gibelli L., Townsend P., & Vreugdenhil B. J. (2016). Human behaviours in evacuation crowd dynamics: from modelling to “big data” toward crisis management. Physics of life reviews, 18, 1–21. pmid:27291090
- 26. Ronchi E., Uriz F. N., Criel X., & Reilly P. (2016). Modelling large-scale evacuation of music festivals. Case Studies in Fire Safety, 5, 11–19.
- 27. Zhang J., Klingsch W., Schadschneider A., & Seyfried A. (2012). Ordering in bidirectional pedestrian flows and its influence on the fundamental diagram. Journal of Statistical Mechanics: Theory and Experiment, 2012(02), P02002.
- 28. Kretz T., Grünebohm A., Kaufman M., Mazur F., & Schreckenberg M. (2006). Experimental study of pedestrian counterflow in a corridor. Journal of Statistical Mechanics: Theory and Experiment, 2006(10), P10001.
- 29. Helbing D., Buznal. , Johansson A., Werner T. (2005) Self-organized pedestrian crowd dynamics: Experiments, simulations, and design solutions. Transportation Science, 39(1), 1–24.
- 30. Zeng W., Chen P., Yu G., & Wang Y. (2017). Specification and calibration of a microscopic model for pedestrian dynamic simulation at signalized intersections: A hybrid approach. Transportation Research Part C: Emerging Technologies, 80, 37–70.
- 31. Isobe M., Adachi T., & Nagatani T. (2004). Experiment and simulation of pedestrian counter flow. Physica A: Statistical Mechanics and its Applications, 336(3), 638–650.
- 32. Teknomo K. (2006). Application of microscopic pedestrian simulation model. Transportation Research Part F: Traffic Psychology and Behaviour, 9(1), 15–27.
- 33. Lam W. H., Lee J. Y., & Cheung C. Y. (2002). A study of the bi-directional pedestrian flow characteristics at Hong Kong signalized crosswalk facilities. Transportation, 29(2), 169–192.
- 34. Ren G., Zhou Z., Wang W., Zhang Y., & Wang W. (2011). Crossing behaviors of pedestrians at signalized intersections: observational study and survey in China. Transportation Research Record: Journal of the Transportation Research Board, (2264), 65–73.
- 35. Yang J., Deng W., Wang J., Li Q., & Wang Z. (2006). Modeling pedestrians’ road crossing behavior in traffic system micro-simulation in China. Transportation Research Part A: Policy and Practice, 40(3), 280–290.
- 36.
Gorrini, A., Vizzari, G., & Bandini, S. (2016). Towards Modelling Pedestrian-Vehicle Interactions: Empirical Study on Urban Unsignalized Intersection. Proceedings of the 8th International Conference on Pedestrian and Evacuation Dynamics (PED2016), Hefei, China.
- 37. Feng S., Ding N., Chen T., & Zhang H. (2013). Simulation of pedestrian flow based on cellular automata: A case of pedestrian crossing street at section in China. Physica A: Statistical Mechanics and its Applications, 392(13), 2847–2859.
- 38. Li S. S., Qian D. L., & Luo Y. (2012). Microscopic dynamic simulation model for pedestrian at signalized intersection. Journal of Central South University,19, 3351–3362.
- 39. Anvari B., Bell M. G., Sivakumar A., & Ochieng W. Y. (2015). Modelling shared space users via rule-based social force model. Transportation Research Part C: Emerging Technologies, 51, 83–103.
- 40. Isenhour M. L., & Löhner R. (2014). Verification of a pedestrian simulation tool using the NIST recommended test cases. Transportation Research Procedia, 2, 237–245.
- 41.
Daamen W., & Hoogendoorn S. P. (2013). Estimating model parameters for bottlenecks in evacuation conditions. In Traffic and Granular Flow'11 (pp. 121–127). Springer Berlin Heidelberg.
- 42.
Daamen W., Campanella M., & Hoogendoorn S. P. (2013). Calibration of Nomad parameters using empirical data. In Traffic and Granular Flow'11 (pp. 109–120). Springer Berlin Heidelberg.
- 43.
Campanella M., Hoogendoorn S., & Daamen W. (2014). Quantitative and qualitative validation procedure for general use of pedestrian models. In Pedestrian and Evacuation Dynamics 2012 (pp. 891–905). Springer International Publishing.
- 44. Seer S., Rudloff C., Matyus T., & Brändle N. (2014). Validating social force based models with comprehensive real world motion data. Transportation Research Procedia, 2, 724–732.
- 45. Daamen W., & Hoogendoorn S. (2012). Calibration of pedestrian simulation model for emergency doors by pedestrian type. Transportation Research Record: Journal of the Transportation Research Board, (2316), 69–75.
- 46. Asano M., Iryo T., Kuwahara M. (2010) Microscopic pedestrian simulation model combined with a tactical model for route choice behaviour. Transportation Research Part C: Emerging Technologies, 18(6), 842–855.
- 47. Ma Y., Wu X., Yu G., Xu Y., & Wang Y. (2016). Pedestrian Detection and Tracking from Low-Resolution Unmanned Aerial Vehicle Thermal Imagery. Sensors, 16(4), 446. pmid:27023564
- 48. Hoogendoorn S., Bovy P. (2004) Pedestrian route-choice and activity scheduling theory and models. Transportation Research Part B: Methodological, 38, 169–190.
- 49.
Helbing D, Molnár P, Schweitzer F. (1998) Computer simulations of pedestrian dynamics and trail formation. In: Evolution of natural structures. Proceedings of the third international symposium of the SFB 230, Stuttgart.
- 50. Ko M., Kim T., & Sohn K. (2013). Calibrating a social-force-based pedestrian walking model based on maximum likelihood estimation. Transportation, 40(1), 91–107.