1 Introduction

Evacuating large crowds of people during a fire is a huge challenge to emergency planners, and ill-conceived evacuation plans have resulted in a great number of fatalities over the years [1]. However, accurately evaluating evacuation plans through real world evacuation exercises is disruptive, hard to organize and does not always give a true picture of what will happen in the real situation. These challenges are further aggravated by not fully knowing how a hazard will evolve or whether a queue along an escape path will become a bottleneck. Such uncertainty requires that evacuation plans are dynamically adapted to the situation at hand, guided by the information presently available.

A non-anticipative, adaptive and decentralized strategy which considers queuing theory for managing evacuation networks has been proposed in previous research [2]. Furthermore, evacuation dynamics for specific groups within a crowd, such as children, people with reduced mobility and individuals with disabilities, have been scrutinized in terms of movement patterns, including walking speed, flow through doors and stairs, as well as density around exits, and panic behavior [37]. Formal crowd models have previously been found useful for off-line escape planning in large and complex buildings as well as industrial sites frequented by a significant number of people [813]. In brief, the focus of previous work has typically been either on crowd behavior or on hazard dynamics, for fully known environments.

However, when a disaster strikes, uncertainties about the nature, extent and evolution of the hazard is the rule rather than the exception. Additionally, crowd- and hazard dynamics will be both intertwined and uncertain, making evacuation planning extremely difficult. To address this challenge, we propose a novel spatio-temporal probabilistic model in the form of a Dynamic Bayesian Network (DBN) [14]. This DBN integrates crowd dynamics with hazard dynamics and explicitly captures the uncertain nature of such dynamics. Thus, our approach provides a novel solution to the challenges listed above, not previously addressed in the literature [2, 15]. Our overall goal is to build an integrated emergency evacuation model comprising hazard and threat maps for on-site path planning during crowd evacuation, when challenged by limited and uncertain information.

The research reported here is conducted as part of the SmartRescue project [16], where we are also currently investigating how to use smartphones for real-time and immediate threat assessment and evacuation support, addressing the needs of both emergency managers and the general public. Smartphones are equipped with ever more advanced sensor technologies, including accelerometer, gyroscope, GPS, microphone, and camera. This has enabled entirely new types of smartphone applications that connect low-level sensor input with high-level events to be developed. The integrated crowd evacuation- and hazard model reported here is fundamental for the smartphone based reasoning engine that we envision for threat assessment and evacuation support.

We take as our case studies the emergency evacuation of passengers from a ship, and evacuation of people from a three-story building, triggered by a major fire. Managing uncertainty in such a scenario is of great importance for decision makers and rescuers. They need to be able to evaluate the impact of the different strategies available so that they can select an evacuation plan that ensures as ideal evacuation as possible. These proof-of-concept case studies are further extended in the last part of the paper where we examine large-scale and real-time decision scenarios.

The paper is organized as follows: Section 2 surveys the literature on crowd- and evacuation modeling, highlighting the novelty of our approach compared to existing evacuation and crowd models. Section 3 presents the ship- and building layouts that exemplify the environments that we address by our approach. We then introduce our novel integrated hazard- and crowd evacuation model in Section 4, including the details of the DBN design for intertwined modeling of hazard- and crowd dynamics, also addressing congestion. In Section 5, we present and discuss simulation results that demonstrate that the DNB model allows us to track and forecast the movement of people until they escape, as the hazard develops from time step to time step. In this section we also address the issue of computational scalability. We conclude the paper in Section 6 by listing areas for further investigation.

2 Previous work

As touched upon in the introduction, a plentitude of crowd modeling approaches have been investigated previously (see e.g. [17]). In brief, these have been widely scrutinized from different fields of study. Social-psychological studies are for instance highly qualitative in their approach [1821], while studies based on physics and mathematics introduce quantitative concepts such as motion, force, and velocity to model crowd attributes, expressed as mathematical models [10, 2228]. Building upon the latter extremes, computer science research provides technology and software for crowd modeling. Furthermore, abstractions that facilitate more practical tasks have been introduced, such as designing evacuation routes and exits, managing disaster risks, and finding the best way to manage crowds [29].

The existing crowd models can be roughly categorized into macroscopic, microscopic and hybrid models. The macroscopic models mostly focus on the entire crowd as the unit of analysis, and tend to observe the crowd as a flow. Microscopic models are concerned with detailed features of each entity in a crowd; this is typical of an agent-based modeling approach (ABM). While physicists aim to include physical concepts such as the velocity of each agent (particle), sociologists and psychologists introduce behavioral notions like collective behavior, panic, anxiety, stress, social attachment, norms, contagious effects, and cognitive processes into each agent. Both approaches have been influential and are used in computational crowd evacuation models. Although many ABMs now include social factors, social-psychological effects are often still not fully taken into account, leaving models unsatisfactory when it comes to real-world relevance. Indeed, some ABMs are considered to lack plausible explanations of social practices, have inadequate validation, or fail to incorporate group interaction and inter-group dynamics. Hence, despite the strong focus on modeling low-level details of crowd behavior in ABMs, certain social-physiological factors are frequently overlooked or consciously ignored, especially if they introduce excessive complexity and thus affect model performance [30].

As opposed to the approaches mentioned above, addressing fully known environments, we focus on how to deal with uncertainties in an unfamiliar environment during the actual emergency evacuation. Basing our work upon Bayesian networks (BNs), the uncertainties that we address include the scale of the hazard, its location, and the movement of people. BNs are widely used practical tools for knowledge representation and reasoning under uncertainty, and have been increasingly adopted for modeling and solving real-world problems affected by uncertainty. In the emergency management domain, BNs have for instance previously been successfully applied for: analysis and decision support in maritime scenarios (including maritime accidents); surveillance; obtaining situational awareness; assessing impact on human fatigue; and risk management. Other important application areas include modeling and simulation of hazard scenarios such as fires, floods, collisions, as well as pirate attacks against offshore platforms. The purpose is to identify optimal decision policies, including alarm and evacuation strategies, based on maximizing expected utility under different hazard scenarios [3137]. This previous research does not apply DBNs and thus does not fully address the dynamic nature of hazards and crowds. Although DBNs recently have been applied to model fire, this approach focuses mainly on the likelihood of fire spreading from room to room, while crowd, risk and evacuation factors are not considered [38]. Indeed, our approach is quite different from previous studies since we focus on tracking both people and hazards on-site, dealing with the uncertainty that arises when one has to rely on noisy and incomplete information. In addition, we forecast crowd behavior and hazard development for the purpose of producing real-time risk maps, evacuation routes, and dynamically identifying optimal movement of passengers as the hazard evolves.

3 Scenario and modeling approach

3.1 Ship and building scenarios

We use an onboard ship fire and fire in a three-story building as application scenarios for our DBN based modeling approach. Fig. 1 shows five different layout configurations for the ship and the three-story building, represented as directed graphs. The ship layout in Fig. 1a has a single exit and consists of compartments, stairways, corridors and an embarkation area. Nodes A, B and C in the graph are the compartments, each with doors connecting them to a corridor. Nodes D 1, D 2 and D 3 represent the corridor, which directly links to the different compartments. E is an embarkation area (muster or assembly area) where in an emergency, all passengers gather before being evacuated and abandoning the ship. Nodes S 1 and S 2 represent two stairways. These connect the corridor to the embarkation area E.

Fig. 1
figure 1

Hypothetical ship layout (a and b) and three-story building layout (c, d and e), represented as directed graphs

The building layout depicted in Fig. 1c is a model of a three-story office building and comprises three sections in each of the two upper floors, and a corridor on the first floor that leads to a central exit. The building sections where most people are located during office hours are sections A 2, B 2, C 2, A 1, B 1, and C 1. Similar to the ship scenario, D 1, D 2 and D 3 represent the corridor area that will bring people from the stairways to the exit E. Note that we do not explicitly model the stairways as specific nodes in this scenario, but instead represent them as edges that connect the floors of the building (marked as dashed edges in the figure).

To further increase the complexity of the scenarios, the additional layouts in Fig. 1 introduce multiple exit points, as seen in Fig.  1b, d and e. In the ship fire scenario (b) people in location S 1 can pass on to E 1(first exit), while people in S 2 will be directed to E 2 (second exit). Likewise, in the building layout, two exits are added so that D 1 and D 3 have access to E 1 and E 2 respectively, while people in D 2 may choose between the two exits. The directed graph edges specify the possible direction of movement for the victims, including the option of remaining in one’s current location, for instance due to congestion in adjacent rooms/stairways, panic or confusion, debilitating health conditions, or simply obliviousness to the hazards. These scenarios are designed to illustrate and clarify the unique aspects of our approach, and in Section 5.5 we examine how these can be extended for large-scale and real-time environments.

3.2 Modeling approach

A novel aspect of our approach is that we integrate crowd with hazard dynamics and model the entire emergency evacuation process using a Dynamic Bayesian Network (DBN) [14]. A DBN integrates concepts from graph theory and probability theory, and being derived from BNs it can capture conditional independencies between a set of discrete random variables, X = (x 1, …,x n ) [39] by means of a directed acyclic graph (DAG) [40]. If an edge points from X 1 to X 2 then X 1 is a parent of X 2, and accordingly X 2 is a child of X 1. Each directed edge in the DAG typically represents a cause-effect relationship. This allows the joint probability distribution of the variables to be decomposed based on the DAG as follows, with pa i being the parents of x i in the DAG:

$$ P\left(x_{1},\ldots,x_{n}\right)=\prod\limits_{i=1}^{n}p\left(x_{i}\,|\,pa_{i}\right) $$
(1)

Equation (1) encodes a traditional BN, which does not consider phenomena that evolve over time. Thus, with respect to hazard and crowd modeling, the variables considered in (1) would represent the state of the current situation. To capture temporal dynamics, including evolvement of hazard and crowd, variables are organized as a sequence of time steps (1 , … , t), Z i : t = (Z 1, … , Z t ) . This organization allows us to forecast both hazard and crowd behavior, P(Z t+n |Z 1:t ), where n > 0 indicates how far into the future the forecasting is projected [14]. A compact definition of a DBN consists of the pair (B 1, B →) where B 1 is a traditional Bayesian network that defines the prior distribution of state variables p(Z 1). B → is a two step temporal BN (2TBN) that defines the transition model P(Z t |Z 1−t ) as denoted in (2):

$$ p\left(Z_{t}| Z_{1-t}\right)=\prod\limits_{i=1}^{n}p\left(Z_{t}^{i}| Pa\left(Z_{t}^{i}\right)\right) $$
(2)

Here, \(Z_{t}^{i}\) is the i-th node at time step t. The random variables \(Pa\left (Z_{t}^{i}\right )\) are the parents of \(Z_{t}^{i}\), which can include variables from a preceding time step. The structure repeats itself, and the process is stationary, so the DBN parameters for the steps t = 2, 3 remain the same. Accordingly, the joint probability distribution for a sequence of length T can be obtained by unrolling the 2TBN.

$$ p\left(Z_{t}| Z_{1-t}\right)=\prod\limits_{t=1}^{T}\prod\limits_{i=1}^{N}p\left(Z_{t}^{i}| Pa\left(Z_{t}^{i}\right)\right) $$
(3)

Note that it is possible to expand a DBN beyond the typical 2TBN. A k th-order Markov process, or a (k+1) TBN, can be formed from a 2TBN ((2) and (3)) by restating the transition model as P(Z t |Z t − 1, Z t − 2, … Z tk ). However, in the rest of this paper we use a 2TBN model (see also Section 4.1 for a further discussion on (k+1) TBNs).

To clarify how the above foundation can be used as a basis for capturing hazard- and crowd dynamics, we will now go through a few selected DBN excerpts. We apply the SMILE engine for inference and the GeNIe modeling environment for visualization [41]

For illustration purposes, Fig. 2a contains the DAG for a subset of the hazard model that we introduce in full detail in the next section. The DAG excerpt represents three random variables, Hazard-E, Hazard-S1, and Hazard-S2, referring to the state of the hazard in the embarkation area and the two stairways, respectively (cf. Fig. 1). The edges in the DAG are temporal of first order and indicate cause-effect relationships. Figure 1b also introduces the actual states the random variables can take, here representing the major phases of fire. In brief, the DAG show that the state of a node is decided by the node’s own state in the previous time step, as well as the state of its neighbors, also in the previous time step. As an example, the state of the hazard in location S1 (stairway 1) at time step t is decided by its state at time step t1, as well as the state of the hazard in location E at time step t1. In other words, a temporal edge with the tag “1” shows the dependency of the state of the child node at time step t on the state of the parent node at time step t1 (a 2TBN model).

Fig. 2
figure 2

Excerpts from a DBN modelling hazards, with icon view (a) and bar chart view (b), including an example of the prior probabilities assigned for Hazard-E in time step t 0(c)

Once the DAG has been formed, we need to assign (un-)conditional probability distributions for each node, in the form of Conditional Probability Tables (CPTs). For a DBN, the assignment should be carried out both for t 0, which becomes the prior probabilities, and for t, which becomes the transition model. As an example, Fig. 2c shows the prior probabilities for Hazard-E. As can be seen, the prior probabilities specify that, initially, the hazard state of location E can either be Dormant, Growing, Developed, Decaying or BurntOut, with equal probability. Figure 3 provides insight into CPT based construction of the transition model. It covers the same node as above (Hazard-E), but now with three parents Hazard-S 1, Hazard-S 2, and Hazard-E, modeling spatio-temporal dynamics from time step t1 to time step t. As can be seen, each column refers to a specific parent state configuration, and contains the conditional probabilities for the given configuration. Note that Hazard-E also is its own parent since it affects its own state from time step to time step.

Fig. 3
figure 3

CPT of node Hazard-E at time step t

In the same manner, for every single node in the DAG, the prior probabilities and the CPTs are defined. For a complex DBN, there can be a significant number of probabilities to specify; however, for the DBN model we introduce in Section 4, the probability distributions for t 0 and t are calculated automatically based on simple templates that are composed using scripting.

After a DBN has been specified, a number of opportunities for inference arise. One can for instance calculate the unconditional (or marginal) probabilities of the node states:

$$ P(B)=\underset{i}{\Sigma}P(B| A_{i})P(A_{i}) $$
(4)

Here, A i , i = 1, … , n represents the ith state of the node, with the formula exemplifying how the conditional probabilities of a DBN can be transformed into unconditional probabilities, needed for decision making. Thus, for the random variable Hazard-E one can obtain the probability of each possible state for time step t, even though these probabilities are not explicitly specified as part of the DBN construction. A main use of BNs and DBNs is to infer state probabilities after evidence has been observed. If for instance a growing fire was observed at location S1 at time step t = 1, one would like to propagate this information throughout the DBN, updating the other probability distributions accordingly, both for the current, previous, and following time steps. At the core of this propagation we find Bayes’ Theorem:

$$ P(A| C)=\frac{P(C|A)P(A)}{P(C)}_{.} $$
(5)

In brief, Bayes’ Theorem allows us to calculate the posterior probability distribution for a random variable, A, in the DBN, based on evidence C. Figures 4 and 5 illustrate this propagation of evidence using the sample DBN from Fig. 2.

Fig. 4
figure 4

The sample DBN model showing Posterior probability distribution when evidence is entered for node “Hazard- S 1

Fig. 5
figure 5

The unrolled network with 10 time steps, after entering evidence for the node “Hazard-S1”

Assume that we have entered evidence Growing fire in time step t = 1 for node HazardS 1. As can be seen in the figure, this evidence propagates from time step to time step (x-axis) through the entire network and the state probabilities (y-axis) are updated for the three random variables involved.

Figure 5 shows how the probability calculations are carried out in more detail. As seen, marginal probability distributions, conditioned on evidence, can be obtained for arbitrary nodes (random variables) in the network through “unrolling” the 2TBN specified in Fig. 2, one time step at a time. The starting point is the prior probabilities specified for time step t = 0, and from there, time steps are added iteratively to the network by applying the transition model. In this way, the dynamics of the state probabilities for each node can be viewed and analyzed in detail from time step to time step. Notice how the fully unrolled DBN encompasses a large number of probabilities, yet it is built from a compact representation.

4 The Crowd Evacuation Model (CEM)

In this section, we introduce the integrated hazard and crowd evacuation DBN model. The Crowd Evacuation Model (CEM) is designed to keep track of the location of people, how people flow between locations, as well as the corresponding hazard status of the locations, from time step to time step. As seen in Fig. 6, the CEM consists of a Hazard Model, a Risk Model, a Behavior Model, a Flow Model and a Crowd Model. Each model encapsulates a DBN and is subject to the Markov condition, i.e. the state of a variable of a DBN at time t i depends on its previous state at time t i − 1. Based upon the modeling approach introduced in the previous section, we provide a comprehensive treatment of CEM, describing each sub-model in detail.

Fig. 6
figure 6

Macro view of DBN model

For illustration purposes, we will use the ship layout from Fig. 1a throughout the section. The other layouts from Fig. 1 will be introduced in the results section that follows, and their corresponding DBNs are constructed in the same manner as exposed presently. Table 1 summarizes the notation we use for describing the model.

Table 1 Notation

4.1 The hazard sub-model

The hazard sub-model serves as a parent node for the risk sub-model. As indicated in Fig. 7, this sub-model contains a variable Hazard_X(t) for each location X, representing the state of the hazard for that location at time step t. In addition, the sub-model captures the dynamics of the hazard. A hazard can be any phenomenon with potential to harm life, health and property. In the present scenario, the sub-model represents a spreading fire.

Fig. 7
figure 7

Overview of the hazard sub model (a), risk sub model, and the behavior sub model (b)

The Hazard Model for our particular scenario consists of nine hazard nodes, each referring to a particular part of the ship layout from Fig. 1a. Note that the edges in Fig. 7a are so-called temporal edges. These edges have a property called ‘order’ (shown as an index) that denotes the length of the temporal process or time-delay, k > 0, that characterize the relationship between parent and child in an unrolled network. A child node can be its own parent, introducing self-loops. The first-order self-loop to/from Hazard_ E, for instance, means that a casual relationship has been established between Hazard_ E t − 1 and the Hazard_ E t .

Similarly, the first-order temporal edge from Hazard_E to Hazard_ S 1 means that Hazard_E also depends on the state of neighbor locations, again in the preceding time step (Hazard_\(S_{1\_t-1}\)). Although it is possible to design models with higher temporal order, we here only consider first order models, as typical in state-of-the-art approaches. Note that a higher temporal order may be more appropriate for symptoms that appear gradually over an extensive period, caused by diseases or psychological problems [17].

We model fire hazards based on physical fire properties, abstracting the progressive stages of a fire in terms of commonly used in fire safety literature [38]: Dormant, Growing, Developed, Decaying, and Burnt-out. These states are visualized as a bar chart for node Hazard_D2 in Fig. 7a. Depending on the nature of the barriers separating the locations, a Developed fire may potentially spread to neighboring locations, e.g. triggering a transition from Dormant to Growing in the neighboring location, or a transition in itself from Growing to Develop. These dynamics are specified as conditional probability distributions, with the probability of each node state at the current time step being conditioned on the state of the node’s temporal and non-temporal parents in the DBN.

4.2 The risk sub-model

As illustrated in Fig. 7b, the Risk Model depends on the Hazard Model. For each location X, the Risk Model contains a variable Risk_Level_X(t) with three states: Low Risk, Medium Risk, and High Risk, as portrayed in the bar chart for the Risk_Level_D2 node. Again, conditional probability distributions are used to model dynamics.

The risk nodes are basically modeled as non-temporal deterministic nodes. Briefly stated, the Risk Model maps thestate of each node in the Hazard Model to an appropriate risk level, to allow a generic representation of risk, independent of the type of hazard being addressed. For illustration purposes, the dormant fire stage is considered to be Low Risk, while a fire in the Growing or Burnout stage introduces Medium Risk. Finally, if the fire is Developed we have High Risk. Accordingly, the Risk Sub Model possesses nine nodes, one for each location, delineating the risk for that location. The pseudo code of the Risk Model is shown below:

figure a

Risk levels, in turn, are translated into a Behavior Model, where optimal response to each possible risk scenario is defined.

4.3 The behavior sub-model

The Behavior Model is simply a single DBN variable, Behavior. Each state of this variable maps to a particular flow graph (global evacuation plan). This variable is designed for accommodating pre-determined group evacuation plans, with each state referring to a particular plan, depicted as a bar chart in Fig. 7b. Also observe that the Behavior node has all of the risk nodes as parents, which provides each joint risk scenario with a distinct evacuation plan.

As seen in the figure, the Behavior node for the ship fire scenario consists of four states: Behavior_1, Behavior_2, Behavior_3 and Behavior_4. For instance, one particular flow graph from Fig. 1a could suggest the escape routes: “ AD 1S 1E”, “ BD 2D 1S 1E”, “ CD 3S 2E”, as well as the alternative path “ CD 3D 2D 1−−S 1E” for location C. Such paths are selected based on pre-computed risk assessments, with the purpose of optimizing overall survival rate. To elaborate, for each hazard scenario, the best plan is calculated through safest path analysis, after taking the risk level in each location into account. Note that we study both the ideal evacuation and typical evacuation of the crowd for each hazard scenario. The procedure to find the best behavior for each threat configuration is as follows:

figure b

The scheme for calculating the best group evacuation plan for each hazard scenario is thus simply based on Dijkstra’s shortest path algorithm, where each node in a particular escape route is associated with a cost, determined by the risk level of that node. Note that we also have investigated how to combine ACO (Ant Colony Optimization) with CEM, to efficiently find optimal paths for large scale problems [50, 51].

4.4 The crowd sub-model

The Crowd Model, illustrated in Fig. 8a, keeps track of the amount of people at each location X at time step t. It also serves as storage for the crowd movement calculations performed by the Flow Model. Currently, we apply a rough counting scheme, that for each location keeps track of whether the location is Empty, contains Some people or contains Many people, using the variable Crowd_X(t). This is illustrated in the figure for Crowd_ D 2 using a bar chart.

Fig. 8
figure 8

The crowd sub-model (a) The link between the behavior and flow sub model (b)

Basically, the CPTs associated with this sub-model encode that both Empty locations, as well as locations containing Some people, can receive Some people from a neighboring location. A location with Many people, on the other hand, must be unloaded before more people can enter. Accordingly, each Crowd node in Fig. 8(a) has the states Empty, Some and Many. Note that this approach can easily be extended to more fine granular counting and flow management, as detailed in a forthcoming paper.

4.5 The flow sub-model

The Flow Sub Model in Fig. 8b manages the flow of incoming and outgoing people along each edge in the layout graph from Fig. 1a. The flow management is based on three mutually supporting variables, associated with each location X. Figure 8b illustrates a detailed view of the incoming and outgoing crowd flow between neighbor rooms A and D1. The pre-selected plan in the Behavior sub-model will govern the direction of people who are leaving a hazardous area. In addition, these Outgoing, Incoming and Decreased node triples are interconnected within each crowd location. The same structure is valid for all other interconnected nodes. To elaborate, the nodes In_X(t) interleaves incoming flows by alternating between neighbor locations, while Out_ X(t) routes the incoming flow into an outgoing flow by selecting an appropriate destination location. This allows for probabilistic modeling of queuing and congestion.

Finally, the variable Decrease_X(t) is used to remember which crowd location should be decreased, after a source-destination flow has been selected. It is used to calculate the resulting number of people in location X , based on its parents In_X(t) and Out_X(t). In other words, our DBN can keep track of the actual number of people at each location by using the DBN as a framework for counting!

The structure in Fig. 8b only reveals a couple of neighbor nodes, i.e. the flow between Crowd_A and Crowd_ D 1. Each neighboring node along each edge in the layout graph in Fig. 1a has a similar structure to that portrayed in Fig. 8b, but the number and the label/states of each node will depend on the neighboring nodes linking directly to the node. In the example in Fig. 8b, A only has D 1 as a neighbor while D 1 has three: A, D 2 and S 1. Hence, for the Crowd_A we have the following flow structure: In_A, Out_A and Decrease_A, while for Crowd_ D 2 we have the flow structure: Out_D 1, In_D 1, Out_D 1, and Decrease_D 1. Since D 1 will be a parent node for In_A and Out_ A,the id of the room will appear as one of the states in the node In_ A,and Out_A. In other words, the possible outcomes for In_A and Out_A will be { D_1, None}

Likewise, as shown in Fig. 8b, the node In_D 1 has four states { A,D 2, S 1, None}. The state None means there is no incoming flow from neighboring nodes. The probability associated with state A illustrates that there is a small chance of an incoming crowd from A to D 1 at the beginning of thesimulations. The states D 2 and S 1 have probability zero, which means that no one will arrive along those paths initially.

The flow model is built as follows:

figure c

The above DBN structure allows us to model flows of incoming and outgoing people for each location. Furthermore, we can model congestion, flow efficiency, and crowd confusion, simply by specifying appropriate CPTs. Here, flow efficiency reflects how quickly the evacuation process is implemented, and how quickly people are reacting. In our model, we use reaction probability to measure efficiency, denoted as Eff in the following. This is the probability that people actually move at each time step, instead of waiting. The effect of confusion manifests itself when someone moves. Confusion measures ability to select the optimal evacuation path, instead of a sub-optimal path, as governed by local factors such as smoke, panic, and so on. We use Cf to denote the probability of selecting the path to follow randomly due to confusion, as opposed to selecting the optimal path.

To elaborate, flow efficiency measures how quickly a crowd moves, while confusion captures to what degree a crowd is able to make optimal path selections. In related work, the efficiency of an evacuation is typically measured in terms of “evacuation time”, involving the time it takes for a person to traverse each egress component [44, 45]. Evacuation time is typically formulated in terms of efficiency, ideal evacuation time, and pre-movement time (time needed for a person to interpret the situation after the hazard manifests itself, prior to escape action):

$$ t_{t} = t_{pm} + \zeta t_{m.} $$
(6)

Here, t t is the total evacuation time, t p m is the pre-movement time, t m is ideal evacuation time for an escape route, and ζ represents evacuation efficiency. Obviously, t p m varies from building to building and from hazard scenario to hazard scenario, depending on factors such as layout complexity and ability to interpret evacuation instructions. Furthermore, ideal travel time is governed by intricate details such as how instance corridors and stairways affect movement speed differently. The actual evacuation time is, of course, seldom ideal, because people may react slowly, take a wrong turn, pursue a suboptimal route, or become slowed down by congestion. The density of people along an escape route, velocity, and flow rate, are among the determinants of evacuation efficiency. Hence, there is a need to explicitly model evacuation efficiency ζ. For building evacuation, efficiency ζ is typically above 1.5. Indeed, an even higher value of ζ may be needed for a building with two escape routes, for instance when one of them is blocked, introducing further confusion. Alternative approaches to model evacuation efficiency exist [46], however, all of these deterministic models are limited by their inability to explicitly address the uncertainty characteristic for real evacuations. To address this weakness, we have therefore modeled efficiency probabilistically. In brief, our efficiency parameter is marginalized from a number of intricate factors, which translates into the probability of being able to act. Thus, efficiency probability 1.0 represents the ability to carry out evacuation without delays, while efficiency probability 0.0 means complete inability to act.

Similarly, the presence of confusion due to stress, anxiety, unfamiliarity of the environment, reduced visibility, and so on, can also hinder evacuation [17]. Such factors can impair people’s decision-making ability, and are captured as a generic “confusion” parameter in CEM – the probability of not making the ideal decision. This parameter thus allows us to take confusion into account by marginalizing out details from more detailed psychological models. Accordingly, we follow the example of other computational models (e.g. [23]) and capture confusion as a numeric parameter, ranging from 0.0 to 1.0. In brief, 1.0 represents total confusion, manifested as random decisions, while 0.0 means that decisions always are optimal.

5 Simulations, results and discussion

In this section, we evaluate the CEM DBN for numerous scenarios and examine how various degrees of confusion and efficiency affect evacuation performance. Based on simulations, we obtain insight into criteria for successful evacuation in terms of plan execution speed and ability to execute plans accurately. We then proceed with evaluating the ship fire scenarios from Fig. 1a and b, and observe how different parts of the DBN react to specific fire scenarios, particularly the likelihood of the hazard spreading to other locations, and how the crowd evacuation process occurs. In addition, we study the building scenario in Fig. 1c, focusing on evacuation through a single exit point. We also investigate model behavior in two-exit building scenarios, as illustrated in Fig. 1d and e.

5.1 Simulation setup

The purpose of our DBN is calculation of posterior probabilities for monitoring, diagnosing and forecasting, with an emphasis on crowd- and hazard conditions. To configure simulation scenarios, we introduce fire status for certain location, at a specific point in time, as evidence in the DBN (e.g., growing fire at location A at time point t 1). Based on this evidence, information about the state of fire and crowd propagates throughout the DBN, and thereby cause the posterior probabilities of other events to iteratively be recalculated. Note that in the SmartRescue project [16] evidence concerning fire and crowd is obtained from mobile phone sensors in real-time, capturing the current state of hazards and crowd. The sensor models that are required to interpret sensor readings are provided as extensions to the DBN we propose here.

We have run several simulations based on CEM, taking advantage of the SMILE C ++ library to implement our procedures for automatic layout based DBN construction, described in Section 4. The CEM DBN we generate from the layout in Fig. 1a encompasses 45 chance and 10 deterministic nodes, rolled out as a temporal network consisting of 50 time steps. This means that we have 2,750 nodes linked by 6,865 edges. Likewise, each time step for the building layout consists of 50 chance nodes and 11 deterministic nodes, linked by 156 edges, which produces 4,575 nodes linked by 11,608 edges in an unrolled network with 75 time steps. Overall, the former model deals with 4,836,828 parameters in the form of conditional probability tables, while the later should handle 18,921,349 parameters, across all nodes in the networks. The same building layout will create 6,100 nodes and 15,508 edges, involving 25,233,524 parameters, with 100 time steps. Thus, the posterior probability computation of every single node can be expensive when considering a whole sequence of time steps in one setting. On the other hand, for real-time tracking one only needs to process one time step at a time, merely considering the previous time step when producing the next one. Furthermore, a sliding window based approach allows forecasting of the immediate future. Despite the above indicated complexity, recall that the entire DBN is still constructed from a small number of simple templates.

To handle the above-described complexity, we have applied four different inference algorithms for approximate inference in DBNs: Adaptive Importance Sampling (AIS) [42], Estimated Posterior Importance Sampling (EPIS) [43], Backward Sampling, and Likelihood Sampling. Figure 9 depicts how each sampling scheme provides slightly different estimates of a particular posterior distribution. Apart from the somewhat noisy results obtained from Likelihood sampling, the different inference schemes provide similar output. The more noisy nature of Likelihood sampling can be explained by less goal-directed sampling, with more samples being “discarded”.

Fig. 9
figure 9

Posterior probability of empty location D 1, obtained through different inference schemes

In terms of execution speed, however, it turns out that EPIS sampling updates the posterior distributions faster than AIS and Backward Sampling for the CEM DBNs, and overall, the inference results obtained from EPIS sampling were less noisy. Therefore, we selected EPIS sampling as the main vehicle for further study of our proposed DBN. Note that in this paper we focus on forecasting. For real-time tracking, more advanced variants of the latter algorithms can effectively be applied, for instance algorithms based on resampling, such as particle filtering.

5.2 Efficiency and confusion in evacuation

With the introduction of confusion and efficiency in CEM, we can now study how such factors influence evacuation success. For instance, in accordance with the interim guidelines for evacuation analyses for new and existing passenger ships [47], an evacuation should be completed in less than 60 minutes, captured as 50 time steps in our model. In our DBN framework, this criterion can be assessed by monitoring the probability of each location being Empty as one approaches t = 50; and conversely, the probability of Many people occupying each location is approaching zero. By varying the probability values both for the efficiency Eff and confusion Cf across the available spectrum, we can analyze the impact of these parameters on evacuation. This allows us to identify parameter value transitions, where evacuation neither is too difficult, nor too easy, but instead lies in the range that generates interesting and challenging situations. We undertake this task presently.

5.2.1 Varying the confusion parameter

The plots in Fig. 10 show the behavior of crowds in room D 1, when responding to a hazard in room A at t 1, under different confusion values. The upper plot captures the probability of the location being Empty. The middle plot represents the probability of Some people being present, while the lower plot shows the probability of Many people being present. We are here interested in studying how the confusion parameter, Cf, affects the probability of room D 1 being vacant in approximately 50 time steps. Clearly, confusion has a large impact on the ability to successfully evacuate. As can be seen, Cf values of 0.1 and 0.2, respectively leads to 13 and 27 percent of people still left behind at t 50.

Fig. 10
figure 10

The simulation results of varying Cf from 0.01 to 1

Since we seek to model challenging evacuation scenarios, we will in the following use a confusion parameter that allows successful evacuation most of the time, and proceed with a Cf value of 0.05 – i.e. a wrong turn is taken 5 percent of the time on average.

5.2.2 Varying the efficiency parameter

Similarly, the plots in Fig. 11 depict the results for various efficiency parameter values, Eff. Again, we study response to a hazard in room A,manifesting itself at time step t 1. Furthermore, the goal is full evacuation of room D 1, as an indicator for successful evacuation. As can be seen, a high efficiency value means that D 1 is quickly filled up due to the high volume of people arriving from different locations, followed by a quick emptying of the location. For the smaller efficiency values, on the other hand, D 1 does not empty in time.

Fig. 11
figure 11

The simulation results of varying efficiency parameters from 0.01 to 1.0 values, on the other hand, D 1 does not empty in time

Again, to focus our simulations on the most challenging settings, we are looking for efficiency values that allow successful evacuation, but with a small margin. In Fig. 11, we examine Eff values of 0.2, 0.3, 0.4 and 0.5. In brief, applying Eff values of 0.4 and 0.5 results in almost perfect evacuation, with more or less the whole crowd being evacuated successfully at t 50. An Eff value of 0.3, on the other hand, should provide a sufficiently challenging evacuation scenario for evaluation purposes.

Note that evacuation success is more strongly affected by the efficiency parameter than by the confusion parameter for the targeted scenario. Even if we double the confusion probability from 0.05 to 0.1, the probability of timely escape is still more than 0.8. In other words, as long as one is able to act quickly, making a wrong turn can be remedied by retracing. Of course, larger degrees of confusion would have more adverse effects, in particular for more complex and large building layouts. Based on the above reasoning, we proceed with applying an Eff value of 0.3 and a Cf value of 0.05 in the remaining experiments.

5.3 Experiment I: Ship fire

We start with studying a fire scenario for the ship layout depicted in Fig. 1a. To challenge the CEM model, we assume that a fire has started concurrently at locations S 2 and A at time step t 1. This means that the shortest escape route from location B and C will be hazardous, and people should be rerouted through staircase S 1. We roll out a 50 time steps CEM to forecast and analyze hazard dynamics, as well as the behavior of people reacting to the complex fire scenario. The obtained results are presented in Figs. 12 and 13.

Fig. 12
figure 12

Inferred probabilistic hazard dynamics for a particular hazard scenario

Fig. 13
figure 13

Crowd dynamics with fire starting in location A and S 2

Figure 12 illustrates the development of the hazard probability distribution for Hazard_ X(t) ={ Dormant, Growing, Developed, Decaying, Burnout} over time, for the locations A and B. In brief, the plots summarize the probability (y-axis) associated with each hazard state for each of the locations, time step by time step (x-axis). Note how the development of the fire reflects our initial evidence, where we can observe when the fire from location A is likely to spread to neighbors, such as location B in time step 8, or to decay as seen in time step 27. To conclude, our DBN provides us with a global probabilistic threat picture, allowing us to assess the current hazard situation, forecast further development, and relating cause and effect, despite potentially erroneous, noisy, and/or incomplete information.

In addition to reasoning about hazards, we can also track and forecast crowd behavior using our DBN. The goal of an evacuation is to transfer people from unsafe to safe areas. Figure 13a, b and c show the simulation results of people moving along the path AD 1S 1. At t 0we have Many people in each of the compartments A,B, and C, while corridors and stairways are Empty. As can be seen from Fig. 13a, it is not before after time step 36 that the probability that room A is completely vacated starts approaching 1.0. Furthermore, Fig. 13b and c show that the number of people in D 1 and S 1 increases initially, as people starts arriving from locations A,B, and C. In general, under the simulated conditions, where most people follow the optimal plan without panicking, people are able to proceed to the exit area. Therefore, from time step 36 it is likely that most people either have evacuated, or succumbed to the hazard.

5.4 Experiment II: Building fire

In this scenario, we consider the three-floor building layout in Fig. 1c, d and e, studying scenarios with one and two exits. The main goal of the third scenario is to test how evacuation completion time is affected when the crowd must pass through a single entry point to the exit area, as well as when multiple non-overlapping paths leads to an exit.

5.4.1 Building layout with one exit

Here, we assume that a fire has started simultaneously in locations C 2 on the third floor and in location D 1 on the first floor, with the fires starting to grow at time step t 1. The obtained results are presented in Figs. 14 and 15, focusing on crowd dynamics and timely evacuation (fire dynamics are similar to the ship fire case).

Fig. 14
figure 14

Crowd dynamics for building 1(c) - fire starts in C 2 and D 1 simultaneously

Fig. 15
figure 15

Simulations of crowd evacuation in D 2 with t = 75 and t = 100

Figure 14a, b and c show simulation results for people moving along the path C 2C 1D 3- D 2. At t 0 we have Many people in each of the building sections (A 2, B 2, C 2, A 1, B 1, C 1), while corridors are Empty. As can be seen, bottlenecks appear in the second and first floor. either C 1, D 3, nor D 2 becomes completely emptied. It is even worse in the nodes that directly link to the exit, i.e. D 2, where we have a probability of 0.26 that Some people are still present at the final time step. This situation can be summarized as follows Table 2):

Table 2 Probabilities of D 2 = Empty, Some and Many at t 10, t 50 compare to Ideal (Exp t 50)

These results trigger a question: How long does it take before all people have been successfully evacuated? In Fig. 15, we expand the number of time steps to 75 (upper plot) and 100 (lower plot) in our DBN, focusing on the bottleneck node D2. We notice that it requires 100 time steps to be able to complete the evacuation, which would be undesirably high in a real emergency situation.

This implies that efficiency will be an important factor in crowd management for timely evacuation, as we have also seen from the experiments conducted in the first simulations. It would thus be interesting to see how increased efficiency can lead to more successful evacuation.

We thus study the effect of slightly increased Eff values, namely efficiency 0.4 and 0.5. As seen in Figs. 16 and 17, the increased efficiency leads to almost certain successful evacuation.

Fig. 16
figure 16

Simulations of crowd evacuation from building 1(c) in D 2 with E f f = 0.4

Fig. 17
figure 17

Crowd dynamics in C 1 for building 1(d) and (e); each with E f f value of 0.4

5.4.2 Building layout with two exits

We now proceed to investigate the two-exit building layout from Figs. 1d and 1e. With the same hazard configuration as used in the previous subsection, D 2 is no longer on the critical path to the exits, and thus no longer a potentially crowded node. Bottlenecks can instead appear in either C 1 or D 3 due to the hazard in location D1. Therefore we now look closer at C 1. As can be seen in Fig. 18, the additional exit did not improve evacuation. The reason is that the fire starting in D 1 makes it hazardous to head for exit E 1. In other words, the location of the hazard has turned the two-exit layout into a one-exit problem.

Fig. 18
figure 18

(upper) Comparing Crowd Dynamics in C 1 = Empty based on building layouts 1(c), 1(d) and 1(e); (lower) Highlights efficiency effects for time slices t 0t 20 in building 1(d)

Furthermore, increased efficiency also leads to increased congestion, as also seen in the figure.

The lower plot in Fig. 18 further highlights the dynamics of people entering and leaving C 1 in building 1(d). Here we observe how increased Eff leads to increased congestion.

5.4.3 Correlation analysis of crowd dynamics

To cast further light on the CEM crowd dynamics, we here analyse correlation between DBN node states. We use the building layout in Fig. 1d for this investigation. In particular, we look at the hazard status of location C 1 as well as the crow inflows from neighbors of location C 1 using the Pearson correlation coefficient.

The results are presented as correlation matrices in Fig. 19. Here red color means a strong positive correlation, and shades of red (yellow and orange) indicate degree of moderate positive correlation. Furthermore, solid blue means a strong negative correlation, while lighter shades of blue indicates degree of moderate negative correlation. White colored cells means insignificant correlation (significance level alpha =0.05)

Fig. 19
figure 19

a Correlation matrix for crowd state and hazard state in location C 1 nodes. b Correlation matrix for crowd state of location C 1 and Inflow_ C 1 from neighboring locations

A number of findings can be gathered from the correlation matrices. First of all, a developed and a decaying fire correlates negatively with people being present, while a burnt out location is strongly correlated with the location also being empty. Furthermore, we observe that a crowded location blocks inflow from neighboring locations, while inflow from neighboring locations correlates with presence of people.

5.5 Scalability considerations

It is well known that the conditional probability tables (CPTs) associated with each node in a discrete Bayesian network CPT grows exponentially with the number of parents. Although some of the CEM nodes possess as many as parents five parents, we support network configuration through automatic construction of CPTs through template-based construction.

Furthermore, it is possible to learn the CPTs from training data. One promising approach that we have adopted is generating training data for fire dynamics using the Fire Dynamics Simulator (FDS) [48]. The simulator focuses on smoke and heat transportation during fire, based on computational fluid dynamics. In all brevity, FDS can produce output such as heat release rate, visibility and obscuration, layer-based temperature measurements, thermocouples-based temperature measurements, heat fluxes, thermal radiation, and numerous other statistical outputs. This allows us to automatically generate extensive amounts of training data for parameter learning in the Bayesian network.

When it comes to scalable inference, in addition to the sampling based approaches we employ in this paper, we are also investigating template based decomposition of Bayesian networks, with approximate propagation of virtual evidence, represented as likelihood ratios [49]. Finally, we have previously investigated how to combine ACO (Ant Colony Optimization) with CEM, to efficiently find optimal paths for large scale problems [50, 51]. When integrated with the Behavior Model of the DBN, the DBN supports dynamically adjusting escape plans that take into account present uncertainty.

6 Conclusions and further work

In this paper we have proposed a spatio-temporal probabilistic model of hazard and crowd dynamics in disasters, with the intent of supporting real-time evacuation planning by means of situation tracking and forecasting.

Risk levels, in turn, are translated into a Behavior Model, with optimal response to each possible risk scenario. Dynamic Bayesian Networks are used for modeling and inference, with a focus on forecasting flow of people and hazard development. The resulting Crowd Evacuation Model (CEM) allows us to keep track of, and predict, the location of people and the hazard status, from time step to time step, dealing with incomplete, erroneous, and noisy information, as well as the intertwined relationship between crowd and hazard dynamics.

We are currently developing generic location templates and approximate inference schemes that allow large-scale models to run on smartphones. These generic templates are calibrated using realistic fire data from a fire dynamics simulator. Furthermore, we build explicit models for confusion and efficiency, breaking these down into multiple interacting factors. We also intend to investigate how a collection of smartphones can form a distributed sensing and computation platform. This involves distributed schemes for tracking, forecasting and planning; allowing the CEM schemes to run seamlessly in the smartphone network.