[1]Department of Computer Science, San Jose State University

Effective and efficient malware detection is at the forefront of research
into building secure digital systems. As with many other fields, malware detection research has seen
a dramatic increase in the application of machine learning algorithms. One machine learning
technique that has been used widely in the field of pattern matching in general—and
malware detection in particular—is hidden Markov models (HMMs).
HMM training is based on a hill climb,
and hence we can often improve a model
by training multiple times with different initial values.
In this research, we compare boosted HMMs (using AdaBoost)
to HMMs trained with multiple random restarts,
in the context of malware detection. These techniques
are applied to a variety of challenging malware datasets.
We find that random restarts perform surprisingly well
in comparison to boosting. Only in the most difficult
“cold start” cases (where training data is severely limited)
does boosting appear to offer sufficient improvement to justify
its higher computational cost in the scoring phase.

§ INTRODUCTION

As of 2017, about 54% of households worldwide had access to the Internet [21].
In terms of raw numbers, the count of Internet users has increased from around 1 billion in 2005
to almost 3.6 billion in 2017 [45]. This trend of digitalization is sure
to continue over the coming years, and soon virtually the entire world will be connected to the Internet.

The proliferation of computers and the widespread
use of the Internet have resulted in the digitalization of many services.
Business applications are obvious, but highly digitized services also
include essentials such as the power grid, dams, traffic lights,
and so on. The Internet of Things (IoT)
promises to connect nearly every aspect of life
to the Internet—as of 2018, there
are about 23 billion IoT connected devices [44].
This reliance on digitalization and automation brings with it a set of challenges,
and chief among these challenges is digital security.

Today, bad actors can exploit our reliance on technology for financial gain, and
there are credible predictions of cyber-warfare being
a leading mode of attack in future conflicts [35].
Malicious software, or malware, is the driving force behind a vast array of digital security issues.

According to [29],
one in three computers worldwide is affected
by malware. While the cost of malware is notoriously difficult to quantify, estimates are
that financial losses due to cyber crime will reach a staggering $6 trillion annually by
the year 2021 [1]. Not surprisingly,
spending on cyber defenses is also expected to increase—it is
estimated that such expenditures will exceed $1 trillion in 2021 [26].

A wide variety of different types of malware affect computing systems.
Such malware includes adware, spyware, Trojans, viruses, worms,
ransomware, and many others [16].

Antivirus software, firewalls, and intrusion detection systems are used in attempts
to keep systems secure. Antivirus software generally relies primarily on signature detection
(i.e., pattern matching) to detect malware. However, there are many advanced forms of malware
that can evade signature-based detection [5].

Machine learning techniques can be used to improve on signature-based detection [4].
Hidden Markov models (HMMs) are one popular machine learning technique that has
been successfully applied to the malware detection
problem [2, 4, 33, 43],
as well as a wide variety of other information security
problems [3, 10, 14, 19, 27, 28, 30, 34, 38, 40, 41].
In this research, we consider the effectiveness of
malware detection based on HMMs with multiple random restarts. We compare this
random restarts approach to combining HMMs using the well-known
AdaBoost algorithm [42]. Interestingly,
it appears that boosted HMMs have not previously received much attention in the
information security domain [13].

We consider a variety of experiments to compare multiple random restarts
to boosted HMMs. Our experiments include the so-called “cold start” problem,
where limited training data is available. We believe that all of our experiments provide
realistic and challenging test cases for comparing the techniques under consideration.

The remainder of this paper is organized as follows. In Section <ref>,
we provide relevant background information,
including brief introductions to hidden Markov models and AdaBoost.

Section <ref> describes our
experimental setup and results. In this section, we also
provide some discussion and analysis of our results.
Finally, in Section <ref>, we present our conclusion and mention
possible future work.

§ BACKGROUND

Machine learning can be viewed as a form of statistical discrimination where a “machine” or algorithm
does the hard work, rather than a human analyst [43].
Complex problems such as character recognition and voice identification can be effectively
solved using various machine learning techniques [11, 24].
In the field of information security, machine learning has become a fundamental tool in many areas
of research, including malware detection and analysis, and intrusion
detection [4, 13, 20].

Next, we briefly introduce hidden Markov models and AdaBoost. These are both
popular machine learning techniques that have found widespread application to problems
in information security.

§.§ Hidden Markov Model

In a Markov process of order one, the current state depends only on
the previous state, and the state transition probabilities are based on
fixed, discrete probability distributions.
As the name suggests, in a hidden Markov model, we cannot
directly observe the state sequence, but we do have access to
a series of observations that are related to the hidden states
via discrete probability distributions.
A generic view of an HMM is given in Figure <ref>,
with the relevant notation defined in Table <ref>.

HMM notation
Notation     Description
$T$     Length of the observation sequence

$N$     Number of states in the model

$M$     Number of observation symbols

$Q$     Distinct states of the Markov process, $q_0,q_1,\ldots,q_{N-1}$

$V$     Possible observations, assumed to be $0,1,\ldots,M-1$

$A$     State transition probabilities

$B$     Observation probability matrix

$\pi$     Initial state distribution

$\O$     Observation sequence, $\O_0,\O_1,\ldots,\O_{T-1}$

Using the notation in Table <ref>,
the state transition matrix $A$ is of size $N\times N$,
the observation probability matrix $B$ is $N\times M$,
and the initial distribution matrix $\pi$ is $1\times N$.
These matrices are all row stochastic, and they define an HMM;
thus, we denote an HMM as $\lambda=(A,B,\pi)$.

The HMM training process is a hill climb, and we typically initialize the
elements of $A$, $B$, and $\pi$ to approximately uniform, that is,
$a_{i,j}\approx 1/N$, $b_{i,j}\approx 1/M$ and $\pi_{1,j}\approx 1/N$,
with the row stochastic requirement enforced.
Since HMM training is a hill climb, we might obtain better
results by training multiple models with different initial values,
and selecting the best of the resulting models. Such an
“HMM with random restarts” approach has been used,
for example, in the analysis of classic
substitution ciphers [9, 46].
However, as far as the authors are aware, such an
approach has not been explicitly applied in the field of
malware detection.

Previous research employing hidden Markov models includes
a wide array of pattern matching problems. For example,
HMMs have been used to distinguish handwritten letters
with high accuracy [24].
Voice recognition is another area where HMMs
are a reliable and strong performer [22].
And, as previously noted, HMMs are often
used in malware research.

In this paper, we consider the malware detection problem and analyze
the effectiveness of generating 1000 HMMs with random
restarts. We compare this random restarts approach to the
average case, where a single HMM is trained.
We also consider the case where the 1000
HMMs are combined using AdaBoost.

Next, we briefly introduce the key ideas behind the AdaBoost algorithm.
While AdaBoost is often used with decision trees, the technique
will work with any type of classifiers—in this paper,
the boosted classifiers are based on HMMs.

§.§ AdaBoost

Boosting is the process of combining multiple (weak) classifiers to obtain a stronger classifier.
Any classifier that performs better than a coin flip can be used, and if a sufficient number of
such classifiers are available, adaptive boosting, or AdaBoost, can generate an arbitrarily strong
classifier [42]. There are other boosting techniques, including extreme gradient
boosting (XGBoost), but AdaBoost is certainly the best known boosting technique.

At each iteration, AdaBoost selects the
“best” classifier from those available (i.e., unused), where
“best” is defined as the classifier that most improves on the overall accuracy
of the new, combined classifier. That is, AdaBoost greedily
selects a classifier that does the most to improve on the current
iteration of the constructed classifier. In AdaBoost the selected classifiers are
combined as a weighted linear combination, where an optimal weight is
calculated at each iteration, with all previously computed weights fixed.
While AdaBoost has many desirable properties, one inherent problem is
that errors in the training data tend to grow, due to the iterative
nature of the algorithm.

Although AdaBoost is a greedy algorithm, it is worth noting that it is not a hill climb.
Hence, at any given iteration, it is possible that the resulting classifier will be worse
than at the previous iteration. Figure <ref> shows the accuracy of
AdaBoost as a function of the iteration number in three different cases.
In each case, the same set of $n=100$ labeled samples was used,
with the number of (extremely weak) classifiers being $L=250$,
$L=500$, and $L=1000$ for the three different cases, which appear as
the red, green, and blue graphs in Figure <ref>, respectively.
The dips in the accuracy, can be fairly substantial,
and if we do not have a sufficient number of classifiers available,
the results will suffer, as can be seen by the $L=250$ case in Figure <ref>.
The tutorial [42] discusses
these and related issues in more detail.

There have been many successful applications of boosting algorithms.
One such example uses AdaBoost to improve the selection of
features in a vision based application [17].
Security-related applications of AdaBoost can be found in [13, 20],
where several classifiers based on Gaussian mixture models are combined
into a stronger classifier for network intrusion detection.

§.§ Evaluation Criteria

We use accuracy as an evaluation metric for some of the experimental
results that we present in Section <ref>.
For an experiment on a labeled dataset,

\mbox{accuracy} = \dfrac{\mbox{TP} + \mbox{TN}}{\mbox{TP} + \mbox{TN} + \mbox{FP} + \mbox{FN}}

\begin{align*}
\mbox{TP} =& \mbox{true positives}, \mbox{TN} = \mbox{true negatives} \\
\mbox{FP} =& \mbox{false positives}, \mbox{FN} = \mbox{false negatives}
\end{align*}

Accuracy is an intuitive measure, as it is simply
the ratio of correct classifications to the total number of classifications.

We employ receiver operating characteristic (ROC) curve analysis in
all of our experiments. An
ROC curve is obtained from a scatterplot by graphing the true positive rate (TPR)
versus the false positive rate (FPR) as the threshold varies through the range of values.
These rates are computed as

\mbox{TPR} = \frac{\mbox{TP}}{\mbox{TP} + \mbox{FN}}
\mbox{\ \  and\ \ }
\mbox{FPR} = \frac{\mbox{FP}}{\mbox{FP} + \mbox{TN}}

The area under the ROC curve (AUC) ranges from 0 to 1, with 1 indicating ideal separation, that is,
a threshold exists for which no misclassifications occur. An AUC of 0.5 indicates that the underlying
binary classifier is no better than flipping a coin. Also, note that an AUC of $x < 0.5$ will yield
an AUC of $1-x > 0.5$ if we simply reverse the sense of the binary classifier.
The AUC can be interpreted as the probability that a randomly selected positive instance
scores higher than a randomly selected negative instance [12].

§ EXPERIMENTS AND RESULTS

In this section, we give detailed experimental results comparing HMMs
with multiple random restarts to boosted HMMs. First, we discuss the
basic parameters of the experiments; then, we present three sets of

§.§ Dataset and Features

All of the experiments here are based on malware samples
from the Malicia dataset [25],
along with a representative collection of benign samples.
The benign samples consist of Windows system 32 executables
collected from a fresh install,
while the malicious families are the following.

Cridex is a Trojan that creates a backdoor and collects sensitive
information, such as details related to online banking. The resulting
information can then be transmitted to a third party [15].

Harebot is a backdoor that can yield remote access to an infected system.
Due to its large number of features, Harebot is also
sometimes considered to be a rootkit [18].

Security Shield is a spyware Trojan that claims to be anti-virus software
and reports fake virus detection results to the user. Security Shield attempts to
coerce the user into purchasing software [36].

Zbot is a Trojan horse that compromises a system
by downloading configuration files or updates. Zbot, which is also known as Zeus,
is stealthy malware that attempts to hide in the file system [47].

ZeroAccess is a Trojan horse that makes use of an advanced rootkit to hide its
presence. ZeroAccess can create a new (hidden) file system,
install a backdoor,
and download additional malware, among other features [48].

Table <ref> lists the number of samples from
each malware family considered, as well as the number of
benign samples. Note that the number of benign samples is larger than the
number of malware samples for three of the five malware families under consideration.
All of our subsequent experiments and analysis are conducted on a per-family basis.

Family     Type     Samples
Cridex     Trojan     74

Harebot     Backdoor     53

Security Shield     Spyware     58

Zbot     Trojan     2316

ZeroAccess     Trojan     1305
Benign        —     107

Good detection results can be obtained for some of the larger families (e.g., ZeroAccess)
in the Malicia dataset, but the smaller families (e.g., Cridex and Harebot) have been shown to be
challenging [6, 7, 31, 32].
In addition, HMMs have generally been found to be competitive with
many other proposed malware detection
techniques [8, 23, 37, 39].
Our initial experimental results, which appear below in Section <ref>,
are consistent with this previous work.
However, the main contribution of this paper is to be found in the relative differences
between boosting and random restarts in the most challenging test cases,
which are discussed in Sections <ref> and <ref>.

The feature used in all of our experiments is the mnemonic opcode sequence.
Following previous work, for each family, we use the top 30 most common opcodes,
and group all remaining
opcodes together as “other” [37]. Note that this
will generally give us a different set of opcodes for each family, but the overlap
between families is significant. For a typical set of
experiments, the distinct top 30 opcodes and number of families that
each appears in is given in Figure <ref>.
In this case, we see that 22 of the top 30 opcodes
are common to all five malware families.

Executables are disassembled and mnemonic opcodes are
extracted. Then the top 30 opcodes are determines, and
any opcodes outside of the top 30 are replaced with “other.”
The percentage of opcodes in each family
that are found among the top 30 are given in Table <ref>.
We see that in each case, the vast majority of opcodes lie within
the top 30.

Top opcodes frequency
2*Family     1cTop 30 opcodes

Cridex     95

Harebot     94

Security Shield     96

Zbot     94

ZeroAccess     96

For all of the experiments reported below, we use 5-fold cross validation.
Cross validation serves to smooth any bias in the data, and also provides
us with the maximum possible number of independent test cases [43].

Again, all HMMs are trained on extracted opcode sequences. To score a given
sample against a specific HMM, we extract the opcode sequence from the sample
under analysis, and score the resulting sequence against the model,
then normalize the score by the length of the
opcode sequence. This gives us a log-likelihood per opcode (LLPO) score.
Since an HMM score is length dependent, the LLPO score enables us to
directly compare samples with differing numbers of opcodes.

§.§ Initial Experiments

For our initial set of experiments, we trained models on each of the malware
families listed in Table <ref>
and computed the AUC statistic.
In each case, we obtained results based on HMMs with 1000 random restarts, and
also applied AdaBoost to classifiers based on these same 1000 HMM models.
The results for all of these experiments are summarized in the form of a bar graph
in Figure <ref>, where the “average HMM” is the
average model over the 1000 HMMs. Thus, if we trained a single HMM,
we would expect to obtain the results given by the average HMM case.

From Figure <ref> we see multiple random restarts generally yields
a significantly stronger model, and hence would, typically, likely be well worth the additional
(one time) work during the training phase. However, in most cases,
boosting offered minimal improvement over random restarts.
Specifically, boosting had little effect on the results for
Harebot, Zbot, and ZeroAccess. On the other hand,
for Cridex and Security Shield, boosting does
provide some measurable improvement. Perhaps not surprisingly,
it appears that the cases where boosting has something to offer
are those where the non-boosted models are the weakest.

It is also worth noting that boosting can significantly increase the work factor at
the scoring phase, since multiple HMMs are used in the
boosted classifier. This additional work depends on the number of HMM classifiers
used, and this can vary, as we select the optimal boosted classifiers
(i.e., the intermediate boosted model that
achieves the best results). For random restarts, we simply select the best model,
and hence the scoring phase is no more costly than a single HMM.
This points to an inherent advantage of the random restart case, and
hence we would generally only select the boosted model
in cases where the improvement is significant. As noted above,
only Cridex and Security Shield offer any improvement
due to boosting, and the improvement in both cases is modest.
Therefore, we would argue that random restarts is the better choice
in all cases considered in this section.

In subsequent experiments we compare boosting
and random restarts in more challenging classification problems.
Specifically, we consider the situation where the malware code is morphed,
for the purpose of making detection more difficult. Then we consider the so-called
cold start problem, where the training data is limited.

§.§ Morphing Experiments

For our next set of experiments, we simulate code morphing, that is,
we simulate the case where the malware
writer modifies the code in an attempt to make detection more difficult.
Recall that we are considering detection based on differences in statistical properties
of malware and benign opcode sequences. Therefore, we simulate the code morphing
process by inserting opcode sequences extracted from benign
samples into malware samples. This should have the desired effect of
making the malware samples statistically more similar to the benign samples,
and hence make them far more difficult to distinguish from benign.

We consider three morphing cases. First, we insert benign code equivalent to 10% of
the code, then we apply 50% morphing and, finally, we use 100% morphing. Note that,
for example, in the 100% morphing case, the size of the opcode sequence doubles.
Our experimental results for these three cases
are summarized in Figure <ref>.

As with the previous experiments, the differences between the average HMM
and the best of the random restarts model is generally significant.
On the other hand, the differences between the random restarts and the boosted model are not
large in most cases, but there are some cases where the differences are significant.
For example, Cridex at 10% morphing and ZeroAccess at 50% morphing
both show substantial improvement for the boosted models, as compared to
random restarts. Interestingly, there does not seem to be a clear trend
as to when boosting is likely to offer more than a marginal improvement.
Again, we would likely choose random restarts in all of these cases, as
the improvement provided by boosting is insufficient to justify the
additional work required when scoring via boosted models.

§.§ Cold Start Problem

In machine learning, the cold start problem deals with the case where the training data is severely
limited. This is of practical concern when attempting to detect malware, as initially we might only have
a small number of samples available for training. In such cases, it would be important to know
how much data is needed before reliable models can be generated. And, the
cold start problem is particularly relevant to the research here, as we are considering
methods to improve our classification results by training a large number of models.
Intuitively, these techniques are likely to be most needed in marginal cases,
and the cold start problem provides just such a case.

For our cold start experiments,
we varied the training data size from 5 to 25 samples, in increments of 5. For the
families with a large number of samples available
(Zbot and ZeroAccess), we tested models on 200 malware samples in each case,
so that the malware and benign sets are more in balance. For the remaining families
(Cridex, Harebot, and Security Shield), which have few samples,
we used all of the non-training sample for testing.
Recall that we have 107 samples in our benign set.

The results of our cold start experiments are summarized
in Figures <ref> and <ref>,
in terms of AUC and accuracy, respectively.

Note that each bar graph in both of these figures
includes results for the typical HMM case (the red bar), as well as the result for
the case where we select the best model from the random restarts (the green bar),
and the case where we apply AdaBoost to the models (blue bar).
All of these results are based on 1000 models, each generated
with a random initialization for the HMM training.

The general trends for the AUC and accuracy results are similar, so
we discuss only the accuracy graphs in Figure <ref>;
similar comments hold for the the AUC graphs in Figure <ref>
For Cridex, Harebot, and Security Shield, we see a generally upward trend
in Figures <ref> (a), (b), and (c), respectively, as the number
of training samples increases. For the ZeroAccess family in
Figure <ref> (e), we see little change, indicating
that 5 samples is apparently sufficient to obtain essentially optimal results.
The Zbot family in Figure <ref> (d) is somewhat
anomalous—and somewhat surprising—as we see a downward trend in the accuracy
with an increase the number of training samples.
The Zbot results in Figure <ref> (d) seem to indicate
that for this particular family, the models generated are unstable,
in the sense that the models depend heavily on the specific samples selected
for training.

With respect to the three approaches considered in this section
(i.e., typical hidden Markov model, multiple random
restarts, and boosted HMMs), the results in Figure <ref>
show a significant advantage for multiple random restarts over the average
HMM in almost every case. The advantage of boosting over multiple
random restarts is certainly less pronounced, but is sginficant
in some cases—and this advantage is generally greatest
for the cases where classification is the most challenging. These
results indicate that  boosting is likely to only be worthwhile
in extremely challenging cases. Taking into account the additional work
required for scoring using a boosted model only serves to further
emphasize this point.

§ CONCLUSION AND FUTURE WORK

With the increasing threat of malware, it is critically important to have the most efficient
and effective malware detection techniques possible. In this paper, we have explored
improved classifier methods based on hidden Markov models,
using both random restarts and boosting. We found that training multiple HMMs with
different initial values will generally yield significant improvement over
generating a single HMM. Multiple random restarts adds work in the training
phase, but the scoring phase is no more costly, since we use only a single HMM.
Since training is one-time work, in many cases it would be reasonable to
train a large number of models using random restarts.

For our boosting experiments, we used AdaBoost, which is
straightforward and inexpensive in the training phase. The improvement offered by boosting over
multiple random restarts was, in general, surprisingly small, but in some of the most challenging cases,
boosting did offer a significant improvement. However, boosted classifiers
are significantly more costly in the scoring phase, as a large number of
models are typically used in the final boosted classifier. Furthermore,
boosting is not particularly robust, in the sense
that errors in the training data tend to grow when training the
boosted classifier [42].
Consequently, we would likely only use boosting in situations
where the improvement is significant, as compared to the non-boosted case.

For future work, it would be worthwhile to consider boosting for malware detection,
based on machine learning models other than HMMs. It would also be interesting to
consider data contamination attacks, which would tend to have a larger negative impact on
boosted models than on non-boosted models. Under these and other scenarios, it would
be valuable, albeit challenging, to determine conditions under which
boosting is likely to yield a classifier that is sufficiently strong to justify
the additional cost and risk.

[1]
Accenture: Cost of cyber crime study.

[2]
C. Annachhatre, T. H. Austin, and M. Stamp.
Hidden Markov models for malware classification.
Journal of Computer Virology and Hacking Techniques,
11(2):59–73, 2015.

[3]
D. Ariu, R. Tronci, and G. Giacinto.
HMMPayl: An intrusion detection system based on hidden Markov
Computers & Security, 30(4):221–241, June 2011.

[4]
T. H. Austin, E. Filiol, S. Josse, and M. Stamp.
Exploring hidden Markov models for virus analysis: A semantic
In Proceedings of the 2013 46th Hawaii International Conference
on System Sciences, HICSS '13, pages 5039–5048. IEEE Computer Society,

[5]
J. Aycock.
Computer Viruses and Malware.
Advances in Information Security. Springer, 2006.

[6]
N. Bagga.
Measuring the effectiveness of generic malware models.
Master's Project, Department of Computer Science, San Jose State
University, 2017.

[7]
N. Bagga, F. D. Troia, and M. Stamp.
On the effectiveness of generic malware models.
In Proceedings of the 2018 International Workshop on Behavioral
Analysis for System Security, BASS 2018, 2018.

[8]
D. Baysa, R. M. Low, and M. Stamp.
Structural entropy and metamorphic malware.
Journal of Computer Virology and Hacking Techniques,
9(4):179–192, 2013.

[9]
T. Berg-Kirkpatrick and D. Klein.
Decipherment with a million random restarts.
In Proceedings of the Conference on Empirical Methods in Natural
Language Processing, pages 874–878, 2013.

[10]
M. Bertacchini and P. Fierens.
A survey on masquerader detection approaches.
In Proceedings of V Congreso Iberoamericano de Seguridad
Informática, Universidad de la República de Uruguay, pages 46–60,

[11]
H. Bourlard, Y. Kamp, and C. Wellekens.
Speaker dependent connected speech recognition via phonetic Markov
In IEEE International Conference on Acoustics, Speech, and
Signal Processing, ICASSP '85, pages 1213–1216, 1985.

[12]
A. P. Bradley.
The use of the area under the ROC curve in the evaluation of
machine learning algorithms.
Pattern Recognition, 30(7):1145–1159, 1997.

[13]
Y.-S. Chen and Y.-M. Chen.
Combining incremental hidden Markov model and AdaBoost
algorithm for anomaly intrusion detection.
In Proceedings of the ACM SIGKDD Workshop on CyberSecurity and
Intelligence Informatics, CSI-KDD '09, pages 3–9. ACM, 2009.

[14]
S.-B. Cho and H.-J. Park.
Efficient anomaly detection by modeling privilege flows using hidden
Markov model.
Computers & Security, 22(1):45–55, Jan. 2003.

[15]
Cridex malware.
<https://www.computerhope.com/jargon/c/cridex-malware.htm>, 2017.

[16]
N. DuPaul.
Common malware types: Cybersecurity 101.

[17]
H. Grabner and H. Bischof.
On-line boosting and vision.
In 2006 IEEE Computer Society Conference on Computer Vision and
Pattern Recognition, CVPR'06, pages 260–267, 2006.

[18]

[19]
J. Hu, X. Yu, D. Qiu, and H.-H. Chen.
A simple and efficient hidden Markov model scheme for host-based
anomaly intrusion detection.
IEEE Network: The Magazine of Global Internetworking,
23(1):42–47, Jan. 2009.

[20]
W. Hu, J. Gao, Y. Wang, O. Wu, and S. Maybank.
Online AdaBoost-based parameterized methods for dynamic
distributed network intrusion detection.
IEEE Transactions on Cybernetics, 44(1):66–82, 2014.

[21]
International Telecommunications Union (ICT) facts and figures 2017.

[22]
S. S. Jarng.
HMM voice recognition algorithm coding.
In 2011 International Conference on Information Science and
Applications, pages 1–7, 2011.

[23]
A. Kalbhor, T. H. Austin, E. Filiol, S. Josse, and M. Stamp.
Dueling hidden Markov models for virus analysis.
Journal of Computer Virology and Hacking Techniques,
11(2):103–118, 2015.

[24]
A. Kundu, Y. He, and P. Bahl.
Recognition of handwritten word: First and second order hidden
Markov model based approach.
In Proceedings of Computer Society Conference on Computer Vision
and Pattern Recognition, CVPR '88, pages 457–462, 1988.

[25]
Malicia Project.
<http://malicia-project.com/>, 2015.

[26]
S. Morgan.
Top 5 cybersecurity facts, figures and statistics for 2018.

[27]
T. Okamoto and Y. Ishida.
Framework of an immunity-based anomaly detection system for user
In International Conference on Knowledge-Based and Intelligent
Information and Engineering Systems, pages 821–829. Springer, 2007.

[28]
T. Okamoto and Y. Ishida.
Towards an immunity-based anomaly detection system for network
International Journal of Knowledge-Based and Intelligent
Engineering Systems, 15(4):215–225, Oct. 2011.

[29]
Panda Security: Cyber crime insights.

[30]
R. Posadas, C. Mex-Perera, R. Monroy, and J. Nolazco-Flores.
Hybrid method for detecting masqueraders using session folding and
hidden Markov models.
In Proceedings of the 5th Mexican International Conference on
Artificial Intelligence, MICAI'06, pages 622–631, Berlin, Heidelberg, 2006.

[31]
D. Rajeswaran.
Function call graph score for malware detection.
Master's Project, Department of Computer Science, San Jose State
University, 2015.

[32]
D. Rajeswaran, F. D. Troia, T. H. Austin, and M. Stamp.
Function call graphs versus machine learning for malware detection.
In S. Parkinson, A. Crampton, and R. Hill, editors, Guide to
Vulnerability Analysis for Computer Networks and Systems — An Artificial
Intelligence Approach, chapter 11. Springer, 2018.

[33]
D. Rajeswaran, F. D. Troia, T. H. Austin, and M. Stamp.
A survey of machine learning algorithms and their application in
information security.
In S. Parkinson, A. Crampton, and R. Hill, editors, Guide to
Vulnerability Analysis for Computer Networks and Systems — An Artificial
Intelligence Approach, chapter 2. Springer, 2018.

[34]
H. Rana and M. Stamp.
Hunting for pirated software using metamorphic analysis.
Information Security Journal: A Global Perspective,
23(3):68–85, 2014.

[35]
Rand Corporation: Cyber warfare.

[36]

[37]
G. Shanmugam, R. M. Low, and M. Stamp.
Simple substitution distance and metamorphic detection.
Journal of Computer Virology and Hacking Techniques,
9(3):159–170, 2013.

[38]
M. Simova, M. Stamp, and C. Pollett.
Stealthy ciphertext.
In H. R. Arabnia and R. Joshua, editors, Proceedings of The 2005
International Conference on Internet Computing, ICOMP 2005, pages 380–388.
CSREA Press, 2005.

[39]
T. Singh, F. D. Troia, C. A. Visaggio, T. H. Austin, and M. Stamp.
Support vector machines and malware detection.
Journal of Computer Virology and Hacking Techniques,
12(4):203–212, 2016.

[40]
A. Sperotto, R. Sadre, P.-T. de Boer, and A. Pras.
Hidden Markov model modeling of SSH brute-force attacks.
In C. Bartolini and L. P. Gaspary, editors, Proceedings of 20th
IFIP/IEEE International Workshop on Distributed Systems: Operations and
Management (DSOM 2009), volume 5841 of Lecture Notes in Computer
Science, pages 164–176. Springer, Berlin, 2007.

[41]
A. Srivastava, A. Kundu, S. Sural, and A. Majumdar.
Credit card fraud detection using hidden Markov model.
IEEE Transactions on Dependable and Secure Computing,
5(1):37–48, Jan. 2008.

[42]
M. Stamp.
Boost your knowledge of AdaBoost.
<https://www.cs.sjsu.edu/ stamp/ML/files/ada.pdf>, 2017.

[43]
M. Stamp.
Introduction to Machine Learning with Applications in
Information Security.
Chapman and Hall/CRC, 2017.

[44]
Statista: Internet of things — number of connected devices worldwide.

[45]
Statista: Internet users stats — number of internet users.

[46]
R. Vobbilisetty, F. D. Troia, R. M. Low, C. A. Visaggio, and M. Stamp.
Classic cryptanalysis using hidden Markov models.
Cryptologia, 41(1):1–28, 2017.

[47]

[48]


* Abadi et al. (2016) Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng.  Tensorflow: A system for large-scale machine learning.  In _12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16)_ , pages 265–283, Savannah, GA, November 2016. USENIX Association.  ISBN 978-1-931971-33-1.  URL https://www.usenix.org/conference/osdi16/technical-sessions/presentation/abadi.
  * Atiya and Parlos (2000) Amir F Atiya and Alexander G Parlos.  New results on recurrent network training: unifying the algorithms and accelerating convergence.  _IEEE transactions on neural networks_ , 11(3):697–709, 2000.
  * Bengio et al. (1994) Yoshua Bengio, Patrice Simard, and Paolo Frasconi.  Learning long-term dependencies with gradient descent is difficult.  _IEEE transactions on neural networks_ , 5(2):157–166, 1994.
  * Bengio et al. (2003) Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Jauvin.  A neural probabilistic language model.  _Journal of machine learning research_ , 3(Feb):1137–1155, 2003.
  * Bertsekas (1999) Dimitri P Bertsekas.  _Nonlinear programming_.  Athena Scientific Belmont, MA, 2 edition, 1999.
  * Bishop (1995) Christopher M. Bishop.  _Neural Networks for Pattern Recognition_.  Oxford University Press, 1995.
  * Bottou (2010) Léon Bottou.  Large-scale machine learning with stochastic gradient descent.  In _Proceedings of COMPSTAT’2010_ , pages 177–186. Springer, 2010\.
  * Brookes (2011) M. Brookes.  The matrix reference manual, 2011.  URL http://www.ee.ic.ac.uk/hp/staff/dmb/matrix/intro.html.
  * Carreira-Perpinan and Wang (2012) Miguel Carreira-Perpinan and Weiran Wang.  Distributed optimization of deeply nested systems.  _arXiv_ , pages arXiv–1212, 2012.
  * Carreira-Perpinan and Wang (2014) Miguel Carreira-Perpinan and Weiran Wang.  Distributed optimization of deeply nested systems.  In _Artificial Intelligence and Statistics_ , pages 10–19, 2014.
  * Dinh et al. (2017) Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio.  Sharp minima can generalize for deep nets.  In _International Conference on Machine Learning_ , pages 1019–1028. PMLR, 2017.
  * Enrique Castillo and Alonso-Betanzos (2006) Oscar Fontenla-Romero Enrique Castillo, Bertha Guijarro-Berdias and Amparo Alonso-Betanzos.  A very fast learning method for neural networks based on sensitivity analysis.  _Journal of Machine Learning Research (JMLR)_ , 7:1159–1182, July 2006.  URL jmlr.csail.mit.edu/papers/volume7/castillo06a/castillo06a.pdf.
  * Fairbank et al. (2014a) M. Fairbank, D. Prokhorov, and E. Alonso.  Clipping in neurocontrol by adaptive dynamic programming.  _IEEE Transactions on Neural Networks and Learning Systems_ , 25(10):1909–1920, Oct 2014a.  doi: 10.1109/TNNLS.2014.2297991.
  * Fairbank et al. (2014b) Michael Fairbank, Shuhui Li, Xingang Fu, Eduardo Alonso, and Donald Wunsch.  An adaptive recurrent neural-network controller using a stabilization matrix and predictive inputs to solve a tracking problem under disturbances.  _Neural Networks_ , 49(0):74 – 86, 2014b.  ISSN 0893-6080.  doi: http://dx.doi.org/10.1016/j.neunet.2013.09.010.  URL http://www.sciencedirect.com/science/article/pii/S0893608013002438.
  * Frerix et al. (2017) Thomas Frerix, Thomas Möllenhoff, Michael Moeller, and Daniel Cremers.  Proximal backpropagation.  _arXiv preprint arXiv:1706.04638_ , 2017.
  * Glorot and Bengio (2010) Xavier Glorot and Yoshua Bengio.  Understanding the difficulty of training deep feedforward neural networks.  In _Proceedings of the thirteenth international conference on artificial intelligence and statistics_ , pages 249–256, 2010.
  * Glorot et al. (2011) Xavier Glorot, Antoine Bordes, and Yoshua Bengio.  Deep sparse rectifier neural networks.  In _Proceedings of the fourteenth international conference on artificial intelligence and statistics_ , pages 315–323, 2011.
  * Golub and Van Loan (2013) G. H. Golub and C. F. Van Loan.  _Matrix Computations_.  Johns Hopkins University Press, Baltimore, Maryland, fourth edition, 2013\.
  * Goodfellow et al. (2016) Ian Goodfellow, Yoshua Bengio, and Aaron Courville.  _Deep Learning_.  MIT Press, 2016.  http://www.deeplearningbook.org.
  * Graves et al. (2014) Alex Graves, Greg Wayne, and Ivo Danihelka.  Neural turing machines.  _arXiv preprint arXiv:1410.5401_ , 2014.
  * Graves et al. (2016) Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska-Barwińska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, et al.  Hybrid computing using a neural network with dynamic external memory.  _Nature_ , 538(7626):471, 2016.
  * He et al. (2015) Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun.  Delving deep into rectifiers: Surpassing human-level performance on imagenet classification.  In _Proceedings of the IEEE international conference on computer vision_ , pages 1026–1034, 2015.
  * Hochreiter and Schmidhuber (1997a) S. Hochreiter and J. Schmidhuber.  Long short-term memory.  _Neural computation_ , 9(8):1735–1780, 1997a.
  * Hochreiter and Schmidhuber (1997b) Sepp Hochreiter and Jürgen Schmidhuber.  Flat minima.  _Neural Computation_ , 9(1):1–42, 1997b.
  * Ioffe and Szegedy (2015) Sergey Ioffe and Christian Szegedy.  Batch normalization: Accelerating deep network training by reducing internal covariate shift.  _arXiv preprint arXiv:1502.03167_ , 2015.
  * Karpathy and Fei-Fei (2015) Andrej Karpathy and Li Fei-Fei.  Deep visual-semantic alignments for generating image descriptions.  In _Proceedings of the IEEE conference on computer vision and pattern recognition_ , pages 3128–3137, 2015.
  * Kingma and Ba (2014) Diederik P Kingma and Jimmy Ba.  Adam: A method for stochastic optimization.  _arXiv preprint arXiv:1412.6980_ , 2014.
  * Krizhevsky et al. (2009) Alex Krizhevsky, Geoffrey Hinton, et al.  Learning multiple layers of features from tiny images.  Technical report, Citeseer, 2009.
  * LeCun et al. (1998) Yann LeCun, Léon Bottou, Yoshua Bengio, Patrick Haffner, et al.  Gradient-based learning applied to document recognition.  _Proceedings of the IEEE_ , 86(11):2278–2324, 1998.
  * LeCun et al. (2010) Yann LeCun, Corinna Cortes, and CJ Burges.  Mnist handwritten digit database.  _AT &T Labs [Online]. Available: http://yann. lecun. com/exdb/mnist_, 2:18, 2010.
  * Lee et al. (2015a) Chen-Yu Lee, Saining Xie, Patrick Gallagher, Zhengyou Zhang, and Zhuowen Tu.  Deeply-supervised nets.  In _Artificial intelligence and statistics_ , pages 562–570, 2015a.
  * Lee et al. (2015b) Dong-Hyun Lee, Saizheng Zhang, Asja Fischer, and Yoshua Bengio.  Difference target propagation.  In _Joint european conference on machine learning and knowledge discovery in databases_ , pages 498–515. Springer, 2015b.
  * Maas et al. (2013) Andrew L Maas, Awni Y Hannun, and Andrew Y Ng.  Rectifier nonlinearities improve neural network acoustic models.  In _Proc. icml_ , volume 30, page 3, 2013.
  * Masters and Luschi (2018) Dominic Masters and Carlo Luschi.  Revisiting small batch training for deep neural networks.  _arXiv preprint arXiv:1804.07612_ , 2018.
  * Mikolov et al. (2013) Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig.  Linguistic regularities in continuous space word representations.  In _Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies_ , pages 746–751, 2013.
  * Mnih et al. (2015) Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al.  Human-level control through deep reinforcement learning.  _Nature_ , 518(7540):529, 2015.
  * Møller (1993) Martin Fodslette Møller.  A scaled conjugate gradient algorithm for fast supervised learning.  _Neural networks_ , 6(4):525–533, 1993.
  * Nakkiran et al. (2020) Preetum Nakkiran, Behnam Neyshabur, and Hanie Sedghi.  The deep bootstrap framework: Good online learners are good offline generalizers.  _arXiv preprint arXiv:2010.08127_ , 2020.
  * Petersen and Pedersen (2012) Kaare Brandt Petersen and Michael Syskind Pedersen.  The matrix cookbook, nov 2012.  _URL http://www2. imm. dtu. dk/pubdb/p. php_ , 3274, 2012.
  * Phan and Hagan (2013) Manh Cong Phan and Martin T Hagan.  Error surface of recurrent neural networks.  _IEEE transactions on neural networks and learning systems_ , 24(11):1709–1721, 2013.
  * Rall (1981) L. B. Rall.  Automatic differentiation: Techniques and applications.  _Lecture Notes in Computer Science_ , 120, 1981.
  * Riedmiller and Braun (1993) Martin Riedmiller and Heinrich Braun.  A direct adaptive method for faster backpropagation learning: The RPROP algorithm.  In _Proc. of the IEEE Intl. Conf. on Neural Networks_ , pages 586–591, San Francisco, CA, 1993.
  * Rohwer (1990) Richard Rohwer.  The “moving targets” training algorithm.  In _Advances in neural information processing systems_ , pages 558–565, 1990.
  * Rumelhart et al. (1986) David E Rumelhart, Geoffrey E Hintont, and Ronald J Williams.  Learning representations by back-propagating errors.  _Nature_ , 323(6088):533–536, 1986.
  * Samothrakis et al. (2016) Spyridon Samothrakis, Tom Vodopivec, Maria Fasli, and Michael Fairbank.  Match memory recurrent networks.  In _2016 International Joint Conference on Neural Networks (IJCNN)_ , pages 1339–1346. IEEE, 2016.
  * Santurkar et al. (2018) Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry.  How does batch normalization help optimization?  In _Advances in Neural Information Processing Systems_ , pages 2483–2493, 2018.
  * Silver et al. (2017) David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al.  Mastering the game of go without human knowledge.  _nature_ , 550(7676):354–359, 2017.
  * Skorokhodov and Burtsev (2019) Ivan Skorokhodov and Mikhail Burtsev.  Loss landscape sightseeing with multi-point optimization, 2019.
  * Srivastava et al. (2014) Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov.  Dropout: a simple way to prevent neural networks from overfitting.  _The journal of machine learning research_ , 15(1):1929–1958, 2014.
  * Sutskever et al. (2014) I Sutskever, O Vinyals, and QV Le.  Sequence to sequence learning with neural networks.  _Advances in NIPS_ , 2014.
  * Taylor et al. (2016) Gavin Taylor, Ryan Burmeister, Zheng Xu, Bharat Singh, Ankit Patel, and Tom Goldstein.  Training neural networks without gradients: A scalable admm approach.  In _International conference on machine learning_ , pages 2722–2731, 2016.
  * Tieleman and Hinton (2012) Tijmen Tieleman and Geoffrey Hinton.  Lecture 6.5-rmsprop, coursera: Neural networks for machine learning.  _University of Toronto, Technical Report_ , 2012.
  * Werbos (1974) Paul J. Werbos.  _Beyond Regression: New Tools for Prediction and Analysis in the Behavioral Sciences_.  PhD thesis, Harvard University, 1974.
  * Werbos (1990) Paul J. Werbos.  Backpropagation through time: What it does and how to do it.  In _Proceedings of the IEEE_ , volume 78, No. 10, pages 1550–1560, 1990.
  * Werbos (2005) Paul J. Werbos.  Backwards differentiation in AD and neural nets: Past links and new opportunities.  In H. M. Bücker, G. Corliss, P. Hovland, U. Naumann, and B. Norris, editors, _Automatic Differentiation: Applications, Theory, and Implementations_ , Lecture Notes in Computational Science and Engineering, pages 15–34. Springer, 2005.
  * Xiao et al. (2017) Han Xiao, Kashif Rasul, and Roland Vollgraf.  Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms.  _arXiv preprint arXiv:1708.07747_ , 2017.
  * Xie et al. (2017) Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He.  Aggregated residual transformations for deep neural networks.  In _Proceedings of the IEEE conference on computer vision and pattern recognition_ , pages 1492–1500, 2017.
  * Zhang et al. (2016) Ziming Zhang, Yuting Chen, and Venkatesh Saligrama.  Efficient training of very deep neural networks for supervised hashing.  In _Proceedings of the IEEE conference on computer vision and pattern recognition_ , pages 1487–1495, 2016.


# Preventing Congestion in Crowd Dynamics Caused by Reversing Flow

Giuseppe G. Amaro  GAe Engineering S.r.l., Via Assietta 17, 10128 Turin,
Italy. Emiliano Cristiani  Istituto per le Applicazioni del Calcolo “M.
Picone”, Consiglio Nazionale delle Ricerche, Via dei Taurini, 19 – 00185 Rome,
Italy<EMAIL_ADDRESS>(corresponding author) Marta Menci  Istituto per
le Applicazioni del Calcolo “M. Picone”, Consiglio Nazionale delle Ricerche,
Rome, Italy<EMAIL_ADDRESS>
###### Abstract

In this paper we devise a microscopic (agent-based) mathematical model for
reproducing crowd behaviour in a specific scenario: a number of pedestrians,
consisting of numerous social groups, flow along a corridor until a gate
located at the end of the corridor closes. People are not informed about the
closure of the gate and perceive the blockage observing dynamically the local
crowd conditions. Once people become aware of the new conditions, they stop
and then decide either to stay, waiting for reopening, or to go back and leave
the corridor for ever. People going back hit against newly incoming people who
are not yet aware of the blockage or have already decided to stay. This
creates a dangerous counter-flow which can easily lead to accidents. We run
several numerical simulations varying parameters which control the crowd
behaviour, in order to understand the factors which have the greatest impact
on the dynamics. We conclude with some useful suggestions directed to the
organizers of mass events.

###### keywords:

Crowd modelling, crowd control, social force model, counter-flow, social
groups

76A30

##  1 Introduction

This paper proposes a microscopic (agent-based) model for describing the
dynamics of pedestrians in a very special situation characterized by a moving
crowd whose members gradually reverse their direction of motion, thus
colliding with the newly incoming people still moving in the original
direction. This situation creates a nonstandard self-regulating counter-flow
with a rather complex dynamics, which can be investigated by suitably tuning
the parameters of the model. The final goal is to predict (and prevent) the
formation of dangerous congestion in real mass events.

_Relevant literature._ Modelling the behavior of people in a crowd is a
difficult task, since it requires to identify the most important behavioral
rules which greatly vary from person to person. For that reason, the study of
crowds can be regarded as a multidisciplinary area, which have attracted since
many years the interest of mathematicians, physicists, engineers, and
psychologists.

Crowd modelling has a long-standing tradition, starting from the pioneering
papers by Hirai and Tarui [1], Okazaki [2], and Henderson [3] in the ’70s.
Since then, all types of models were proposed, spanning from microscale to
macroscale, including multiscale ones, both differential and nondifferential
(e.g., cellular automata). Models can be first-order (i.e. velocity based) or
second-order (i.e. acceleration based), with local or nonlocal interactions,
with metric or topological interactions, with or without contact-avoidance
features. The presence of social groups can also be taken into account. A
number of review papers [4, 5, 6, 7, 8, 9, 10, 11], and books [12, 13, 14, 15]
are now available, we refer the interested reader to these references for an
introduction to the field. It is also useful to mention that models for
pedestrians often stem from those developed in the context of vehicular
traffic [16, 13]. Moreover, there is a strict connection between pedestrian
modeling and control theory, including mean-field games, see, e.g., [17, 18,
12] and reference therein.

In this paper we deal specifically with the _counter-flow_ dynamics: such a
dynamics occur when two groups of pedestrians move in opposite directions,
therefore each group has to find a way to pass through the other. The
importance of accurate modeling and simulation of counter-flow dynamics is
supported by evidence from crowds disaster analysis [19]. Over the last years,
the major accidents often occurred for overcrowding and counter-flow phenomena
taking place inside the area of the events, or in the proximity of the
entrances and exit points. For all these reasons, the literature on counter-
flow is quite reach; see, among others, [20, 21, 22] in the context of
microscopic differential models, [23] for a multiscale differential models,
and [24, 25] in the context of cellular automata. Moreover, it is now well
established that counter-flow dynamics lead to the so-called _lane formation_
: in order to avoid collision, pedestrians arrange in alternate lanes
($\leftrightarrows$) having the same walking direction. The behavior displayed
by numerical simulations is in good agreement with observations of real people
in both artificial and natural environments [26, 27, 28, 29].

Finally, let us discuss the impact of the _social groups_ on the dynamics of
crowds: despite most of the models assume that each pedestrian moves in a
crowd on its own, real crowds are typically formed by small subgroups, such as
friends or families. The impact of social groups on crowd dynamics has been
explored since the ’70s in a number of papers [30, 31, 32, 33], resulting in
the fact that the presence of groups is not negligible at all. In particular,
in the context of bi-directional counter-flow dynamics, theoretical and
experimental observations suggest that the presence of groups slows down the
formation of lanes, which are more fragmented [34, 35].

_Paper contribution._ In this paper, we consider a specific scenario related
to the counter-flow dynamics: a crowd (with social groups) in a corridor,
initially moving in one direction towards an open gate, at some moment is no
longer able to proceed because of the closure of the gate. After that, people
have to decide whether to stop & wait for a possible re-opening, or to move
back. This is the case, e.g., of a inflow of people towards an area dedicated
to a mass event, which is interrupted by the organizers when the area capacity
has been reached.

From the modelling point of view, the main novelty is that the decision to
stay or to move back is taken _dynamically_ by each group, on the basis of the
behaviour of the surrounding groups. More precisely, we assume that the
decision is taken whenever _the group leader is no longer able to move forward
for a certain time_. This can happen either because it has reached the gate or
it has reached the other people queuing in front of the gate, or it is hit by
the people going back and blocking the way. The overall dynamics is also
complicated by the fact that people who decide to stay do not want to be
overtaken by the other people approaching the gate, since they do not want to
lose their priority in the queue. On the other hand, staying people want to
facilitate the passage of reversing people, because the latest are leaving
free space for the former.

From the mathematical point of view, we propose a microscopic differential
model inspired by the well-known Helbing’s Social Force Model [20], based on a
large system of ODEs. We introduce several variants with respect to the
original model: the two most important of them are that a) we consider a
first-order (velocity-based) model and b) we consider topological
interactions, taking into account the first neighbour only. The last choice
greatly speed up the numerical code.

The final goal of this research, which is especially dedicated to
practitioners who are involved in the organization of real mass events, is the
prevention of critical situations which could arise in the reversing-flow
scenario under consideration. Moreover, since digital twins are commonly used
to support the safety plan development, highlighting critical aspects that
need to be solved before and during the event (cf. [36]), we also propose a
crowd control strategy based on the optimal placing of signals/stewards,
aiming at informing people in due time about the gate status (open or close).

_Paper organization._ The paper is organized as follows. In Section 2 we
present the model for the crowd dynamics. In Section 3 we present our case
study: we describe the geometry and the mechanism undergoing the behavioural
choices of pedestrians. In Section 4 we discuss the results obtained from
numerical simulations. We end the paper with some conclusions and future
perspectives.

##  2 The model

###  2.1 General principles

All force models share the same structure of the Newtonian dynamics, namely

$\left\\{\begin{array}[]{l}\dot{\textbf{X}}_{k}(t)=\textbf{V}_{k}(t)\\\\[5.69054pt]
\dot{\textbf{V}}_{k}(t)=\textbf{F}_{k}(t,\textbf{X},\textbf{V})\end{array},\qquad
k=1,\ldots,N\right.$ (2.1)

where $N$ is the total number of agents,
$\textbf{X}_{k}(t),\textbf{V}_{k}(t)\in\mathbb{R}^{2}$, denote the position
and velocity of agent $k$ at time $t$, respectively, and
$\textbf{X}=\left(\textbf{X}_{1},\ldots,\textbf{X}_{N}\right)$,
$\textbf{V}=\left(\textbf{V}_{1},\ldots,\textbf{V}_{N}\right)$. The function
$\mathbf{F}_{k}$, the so-called _social force_ , models the total force
exerted on agent $k$, and gathers all the physical, psychological and
behavioral aspects of pedestrian dynamics. The social force is not a real
force, but rather an empirical mathematical tool which translates in formulas
all these aspects. In its minimal form, it takes into account the following
three contributions:

  * i)

An individual desired velocity term: the velocity that a single pedestrian
would keep if it was alone in the domain.

  * ii)

A repulsion term: pedestrians tend to maintain a certain distance with respect
to other members of the crowd, obstacles and walls present in the environment,
in order to avoid collisions.

  * iii)

An attraction term: pedestrians who are not moving on their own tends to stay
close to the members of their social group (friends, family members).

Social force models can be enhanced adding random fluctuations due to
unpredictable behavioral variations or further small-scale interactions. In
this regards, it can be useful to note that the (generally undesired)
numerical instabilities often play the same role.

_First-order models._ In pedestrian dynamics, much more than in vehicular
dynamics, accelerations are almost instantaneous (at least if compared with a
reference typical time scale) and then inertia-based effects are negligible.
Therefore, first-order models of the form

$\dot{\textbf{X}}_{k}(t)=\textbf{V}_{k}(t,\textbf{X}),\qquad k=1,\ldots,N$
(2.2)

are also suitable, see, e.g., [23]. We think that such a models are easier to
calibrate and are computationally less expensive, for these reasons in this
paper we will adopt a model of this kind. This means that all the aspects of
the dynamics which were encapsulated in the force F are now inserted directly
in the velocity vector V.

_Social groups._ In order to account for the presence of social groups in the
crowd, such as families or friends, we assume that each pedestrian is part of
a group. Each group has at least two members, we do not consider the presence
of lonely people. Moreover, each group has a leader, which never changes in
the time frame of the simulation. The leader of the group takes decisions
about the common target of the whole group. Groups tend to stay together, but
they can temporarily break up and then reunite. The leader does not
necessarily walk in front of the group because all group members know the
destination (decided by the leader) and are able to reach it independently.

_Groups status._ We assume that at any given time, each group (identified with
its leader) has a unique _status_ which corresponds to its target and, more in
general, to its behaviour. The four possible statutes will be detailed later
on in Sect. 3.2.

_Topological interactions._ We consider topological, rather than metric,
interactions, meaning that each agent $k$ interacts with a fixed number of
agents at the same time, regardless of their distance from the agent $k$. More
precisely, we assume that each leader interacts with the first neighbour
outside its social group only, while followers (i.e. not leaders) interact
with the first neighbour inside their social group, the first neighbour
outside, and their leader. As it happens in molecular dynamics, the fact that
a particle interacts with a few other particles at a time does not mean that
the interactions are limited to them. The first neighbour changes continuously
and after few time iterations all the agents reasonably close to each agent
have interacted with it. While standard social force model assumes
contemporary interactions with neighbours within a certain threshold distance,
we prefer to consider fewer interactions at a time, recovering the same
results, in average, over a longer, but still short, time period. This choice
stabilizes the dynamics and it is convenient from the computational point of
view.

###  2.2 Mathematical details

As we said, we consider a first-order social force model with social groups
and topological interactions. Agents have no dimension and we do not consider
contact-avoidance features.

Let us start with the dynamics of _group leaders_. We set

$\textbf{V}_{k}(\textbf{X};\mathcal{S})=\textbf{V}^{d}(\mathcal{S}_{k})+\textbf{V}^{R}(\textbf{X}_{k},\textbf{X}_{k^{**}};\mathcal{S}_{k},\mathcal{S}_{k^{**}})+\textbf{V}^{o}(\textbf{X}_{k})$
(2.3)

where $\textbf{V}^{d}$ is the desired velocity, which only depends on the
status $\mathcal{S}_{k}$ of the group the agent $k$ belongs to;
$\textbf{V}^{R}$ accounts for the repulsion from strangers, and depends on the
positions $\textbf{X}_{k}$ of the agent $k$ itself, the position
$\textbf{X}_{k^{**}}$ of the agent $k^{**}$, defined as the nearest neighbour
of $k$ _outside_ its social group, and the statuses of the two agents;
$\textbf{V}^{o}$ is the repulsion from obstacles. Clearly we have
$\mathcal{S}:=(\mathcal{S}_{1},\ldots,\mathcal{S}_{N})$.

The dynamics of _followers_ is instead

$\textbf{V}_{k}(\textbf{X};\mathcal{S})=\textbf{V}^{d}(\mathcal{S}_{k})+\textbf{V}^{r}(\textbf{X}_{k},\textbf{X}_{k^{*}})+\textbf{V}^{R}(\textbf{X}_{k},\textbf{X}_{k^{**}};\mathcal{S}_{k},\mathcal{S}_{k^{**}})+\textbf{V}^{a}(\textbf{X}_{k},\textbf{X}_{k^{L}})+\textbf{V}^{o}(\textbf{X}_{k})$
(2.4)

where $\textbf{V}^{r}$ accounts for the repulsion from group members, and
depends on the positions $\textbf{X}_{k}$ of the agent $k$ itself, the
position $\textbf{X}_{k^{*}}$ of the agent $k^{*}$, defined as the nearest
neighbour of $k$ _inside_ its social group; $\textbf{V}^{a}$ accounts for the
attraction towards the group’s leader, whose index is denoted by $k^{L}$.

Note that group leaders are not attracted by group mates, the cohesion of the
group being totally left to followers. Moreover, leaders are not repulsed by
group mates. This avoids artifacts in the dynamics and self-propulsion of the
group.

The reason why we distinguish internal and external repulsion is that
pedestrians tend to stay close to group mates, while keeping a larger distance
from the strangers.

The repulsion is defined in order to be inversely proportional to the distance
between the agents,

$\textbf{V}^{r}=-C^{r}\frac{\textbf{X}_{k^{*}}-\textbf{X}_{k}}{\left\|\textbf{X}_{k^{*}}-\textbf{X}_{k}\right\|^{2}},\qquad\textbf{V}^{R}=-C^{R}(\mathcal{S}_{k},\mathcal{S}_{k^{**}})\frac{\textbf{X}_{k^{**}}-\textbf{X}_{k}}{\left\|\textbf{X}_{k^{**}}-\textbf{X}_{k}\right\|^{2}},$
(2.5)

where the parameter $C^{r}>0$ is constant, whereas
$C^{R}(\mathcal{S}_{k},\mathcal{S}_{k^{**}})>0$ depends on the behavioral
statuses of the two interacting agents, see Sect. 3.2. To avoid numerical
issues in the case two agents get temporarily too close to each other, a
threshold is imposed to the value $1/\|\cdot\|^{2}$.

The attraction follower-leader, instead, is proportional to the distance
between the two agents

$\textbf{V}^{a}=C^{a}(\textbf{X}_{k^{L}}-\textbf{X}_{k}),$ (2.6)

where the parameter $C^{a}>0$ is constant.

##  3 Description of the case study

###  3.1 Geometry

We model the access road to the area of a mass event as a two-dimensional
corridor of length $L$ and height $H$. People initially move along the
corridor from left to right and enter the area of the event through a gate,
placed at the end of the corridor, see Fig. 1. At a certain time ($t=0$ in the
simulation) the gate closes for safety reasons so that people are forced to
change target (staying or going back). In the following numerical simulations
we focus on the behavior of the crowd after the gate closure, which involves a
risk of high densities. In particular, we measure the pedestrian density along
the corridor by means of four square regions of side $R$, equally spaced along
the corridor. Regions are numbered from left to right, see Fig. 1.

Figure 1: Geometry of the simulated domain. The gate is placed on the far
right. Pedestrian density evolution is monitored within the four square
regions placed along the corridor.

###  3.2 Behavior

In order to complete the description of the model we need to specify how the
groups take decisions. In particular, how and when they decide to move towards
the gate, stop or go back.

We select 4 statuses $\mathcal{S}_{k}\in\\{1,2,3,4\\}$ at the group level
(i.e. all components of a group share the same status, decided by the group
leader), defined as follows:

  * •

$\mathcal{S}_{k}=1$: move rightward towards the gate;

  * •

$\mathcal{S}_{k}=2$: doubt phase, decision in progress;

  * •

$\mathcal{S}_{k}=3$: decision taken, go back moving leftward;

  * •

$\mathcal{S}_{k}=4$: decision taken, queuing in the corridor.

The group status affects the desired velocity and the interactions with the
others.

Status’ changes happen necessarily in this order: $1\rightarrow
2\rightarrow\\{3,4\\}$, and once the group is in status 3 or 4 it will not
change further.

The change 1 $\rightarrow$ 2 occurs if

$t>\delta t\quad\text{ and }\quad X^{1}_{k}(t)-X^{1}_{k}(t-\delta
t)\leq\overline{\delta\ell},$ (3.7)

where $\delta t$, $\overline{\delta\ell}>0$ are two additional parameters and
$X^{1}_{k}$ is the horizontal component of the position of the agent $k$. This
means that the group leader was not able to move forward for more than
$\overline{\delta\ell}$ in a period of time of length $\delta t$. In practice,
$\delta t$ represents a degree of willingness to get to the gate.

The status 2 has a fixed duration, set to $D$. After $D$ time units, the
change 2 $\rightarrow$ $\\{3,4\\}$ occurs randomly in such a way that, in
average, $p$% of groups fall in status 3 and $(1-p)$% in status 4.

##  4 Numerical tests

###  4.1 Parameters

Let us begin with setting the values of the parameters. Parameters are
primarily chosen in order to get realistic (observed) behaviour in situations
of equilibrium. In particular we match observed crowds in the initial phase,
where all people are in status 1 and are normally walking rightward, and in
the final phase, when only people with status 4 are present and waiting. In
these two phases the forces which rule the interpersonal distances are in
equilibrium, and the relative positions of persons do not vary (apart for
small negligible oscillations).

In the numerical tests we discuss the effect of five parameters, namely $N$,
$\delta t$, $p$, $D$, $H$. We also investigate the effect of the desired
velocity of pedestrians with status 4.

Equation (2) is numerically solved by means of the explicit Euler scheme, with
time step $\Delta t$.

_Fixed parameters._ $\Delta t=0.01$ s, $\overline{\delta\ell}=1.5$ m, $L=130$
m, $R=10$ m, $\textbf{V}^{d}(1)=(1,0)$ m/s, $\textbf{V}^{d}(2)=(0,0)$ m/s,
$\textbf{V}^{d}(3)=(-1.2,0)$ m/s. The 16 possible values of $C^{R}$ are
summarized in the following matrix, where the entry $ij$ is the force exerted
by and agent in status $j$ over an agent in status $i$,

$\left[\begin{array}[]{cccc}2.0&2.5&1.0&2.5\\\ 2.0&2.0&2.0&2.0\\\
0.75&0.75&0.75&0.75\\\ 2.0&2.0&0.75&4.5\end{array}\right]$

Some comments on the repulsion forces are in order:

  1. 1.

People in status 3 (coming back) are repelled from all the others with little
intensity. In fact, they accept to be close to other people, even to
strangers, because the contact is supposed to be of short duration.

  2. 2.

People in status 4 (staying) are strongly repelled by people of the same
status because they want to reach a large comfort distance.

  3. 3.

People in status 4 (staying) are also repelled by people in status 1 (moving
rightward) because they want to keep their priority in the queue and keep the
newly coming people behind them. In other words, they do not leave room for
others to move rightward. Conversely, they are little repelled by people in
status 3 (coming back) because waiting people take advantage from the
departure of them. People going back leave free space and allow waiting people
to get even closer to the gate. All these features have an important
consequence: staying people are compressed towards the gate and the closer
they are to the gate, the more compressed they are.

_Variable parameters._ $N$ = 400 or 800 or 1200, $\delta t$ = 7 or 20 s, $p$ =
25 or 75, $D$ = 10 or 40 s, $\textbf{V}^{d}(4)$=$(0.5,0)$ or (0,0) m/s, $H$ =
7 or 10 or 13 m.

In all simulations the initial density of pedestrians is 0.8 p/m2 (the larger
$N$ the larger the area occupied). The initial positions are randomly chosen.
The number of members of the groups is uniformly random in the set
$\\{2,3,4,5,6\\}$.

###  4.2 Numerical results

Fig. 2 shows some screenshots of a reference simulation with 1200 agents:

(a)
(b)
(c)
(d)
(e)

Figure 2: Five screenshots of a simulation with $N=1200$ pedestrians, with
$\delta t$ = 7 s, $p$=25, $D=10$ s, $\textbf{V}^{d}(4)$=$(0.5,0)$ m/s, $H$ =
10 m. Status 1 is blue, status 2 is magenta, status 3 is red, and status 4 is
black. Circled agents are the leaders of their groups.

(a) at the beginning all agents are walking rightward. As we said before,
initial density, repulsion forces and desired velocity are compatible with
each other, in the sense that people can move forward at constant velocity,
nobody slows down due to excessive proximity to the neighbor and no queue is
formed. As soon as the first pedestrians reach the closed gate the situation
changes: people in proximity of the gate stop and people behind start slowing
down. (b) A queue begins to form and gradually still people take decision
about the new status to get. At this point all four statuses are present at
the same time and the dynamics becomes quite complex. Some people in status 1
(moving rightward, blue) are able to overcome people in status 4 (staying,
black) before changing status themselves. (c) Lanes are formed as in more
standard counter flow dynamics (cf. Sect. 1), although they are quite
perturbed by the presence of the social groups. Social groups sometimes
disperse for a while but then reunite. (d) Gradually people in status 3
(coming back, red) succeed in passing through the staying crowd and leave the
corridor. While they move leftward, people in status 4 (staying, black) can
move a bit backward to let them free space. (e) Finally, only people in status
4 (staying, black) are present in the corridor. They reach an equilibrium
characterized by a noncostant density, due to the natural tendency to stay
close to the gate.

Fig. 3 shows instead the evolution of the density in the four regions of
interests, varying $N$.

(a) $N_{p}=400$ (b) $N_{p}=800$ (c) $N_{p}=1200$

Figure 3: Evolution in the four regions of interest, for $N_{p}=400,800,1200$
and other parameters as in Fig. 2.

The comparison of the plots brings to light some facts:

  1. 1.

The most crowded region is the fourth one, the region closest to the gate.

  2. 2.

In all cases it is well visible a peak of the density in regions 3-2-1 which
decreases and shifts forward in time as the region moves away from the gate
(see, e.g., Fig. 3(c)). This moving peak is due to the reversing people
encountering the newly arriving people.

  3. 3.

As $N$ increases, average densities increase in all regions but less than one
could expect. We think that the reason for this stability is that _the crowd
is able to self-regulate_ : the more people in the corridor, the earlier (i.e.
before in both space and time) people get to make a decision about what to do,
and, if they decide to leave, they do so before remaining trapped by the
others. We observe a sort of a compensation phenomenon that consists in the
fact that the more people there are, the sooner they leave, overall leading to
small differences in the density evolution.

Now we consider the numerical setting of Fig. 3(c) as _reference case_ for
investigating the role of the variable parameters of the model. The results
are shown in Fig. 4.

(a) $H=7$ m (b) $H=13$ m (c) $D=40$ s

(d) $\delta t=20$ s (e) $p=75$ (f) $\textbf{V}^{d}(4)=(0,0)$

Figure 4: Same simulation as in Fig. 3(c) with (a) $H$ decreased from 10 to 7
m, (b) $H$ increased from 10 to 13 m, (c) $D$ increased from 10 to 40 s, (d)
$\delta t$ increased from 7 to 20 s, (e) $p$ increased from 25 to 75, (f)
$\textbf{V}^{d}(4)$ decreased from $(0.5,0)$ to $(0,0)$ m/s.

Figs. 4(a,b) show the result obtained modifying the height $H$ of the
corridor. In both cases we maintain the initial density of people as 0.8 p/m2.
As expected, we observe the largest average densities in the case of the
smallest corridor. The difference is remarkable in the regions farthest from
the gate.

Fig. 4(c) shows the results obtained for an increased value of the doubt
phase, namely $D=40$ s. We do not observe a relevant increase of the maximum
values of the densities, but the peaks are more delayed.

Fig. 4(d) shows the results obtained for an increased value of the time needed
to decide either to enter the doubt phase or to keep going to the gate, namely
$\delta t=20$ s. People are now more resistant to the idea of renouncing going
to the gate and therefore necessarily spend more time in the corridor. Here
the peak of density in region 4 is much greater than before and reaches the
dangerous level of 5 p/m2 [19]. This is mainly due to the longer time spent
there by people in statuses 1–4 all together. Overall, the parameter $\delta
t$ is the most effective in increasing the density.

Fig. 4(e) shows the effect of increasing $p$ from 25 to 75. In this case 75%
people decide to leave the corridor and only 25% to stay. We see that at the
beginning the densities in all regions are larger than those in the reference
solution, because more people are trying to go back and form a big group which
move very slowly. Conversely, at final time all regions are almost empty and
have similar density.

Fig. 4(f) shows the effect of vanishing the desired velocity of people with
status 4. Although those people are just waiting in the corridor, a rightward
constant desired velocity is needed to reproduce the will to stay close to the
gate and not to be overcome by newly incoming people in status 1. If
$\textbf{V}^{d}(4)=(0,0)$ the dynamics change completely: people in status 1
continuously take the place of waiting people, and waiting people move back.
At final time, the result is an almost constant density all along the
corridor.

###  4.3 Congestion control via Control & Information Points

As final tests, we try to lower the congestion in the four regions adding some
Control & Information Points (CIPs) along the corridor. The idea is that
people walking in the corridor are informed about the closure of the gate by
some signals or stewards. In this way, people can enter the doubt phase much
before (both in space and time) than they do without any knowledge of the
status of gate. More precisely, we assume that anyone in status 1 moves
immediately to status 2 as soon as it crosses a CIP. The question arises when
and where it is most convenient to locate CIPs. Starting from the setting
shown in Fig. 4(d), which is the most critical among the investigated ones, we
have run a brute-force optimization procedure to test the effect of the
presence of a single CIP; we have found that the best option is positioning
the CIP in region 3, 20 s after the gate closed. The result is shown in Fig.
5(a).

(a) Single CIP in region 3 (b) Two CIPs in regions 3 and 1

Figure 5: Density evolution in the four regions of interest. 20 s after the
gate closed, pedestrians are informed by (a) one CIP located in region 3, (b)
two CIPs, simultaneously activated, located in regions 3 and 1.

The effect of the CIP is clear since the maximal density decreases from
$\sim$5 to $\sim$3 p/m2, and the density evolution of region 3 becomes very
similar to that of region 4.

Fig. 5(b) shows the result after adding a second CIP in region 1, again 20 s
after the gate closed. Maximal densities are not further decreased but
densities are less fluctuating in all regions. This can be an advantage in
terms of pedestrian safety.

##  5 Conclusions and future perspectives

We have conducted a numerical investigation in a particular situation
characterized by a complex self-interaction of a crowd in a corridor. Although
the model has a large number of parameters, we have seen that it is quite
sensitive only to some of them. In particular, the parameter $N$ does not
affect very much the maximal densities, as if the crowd was able to self-
regulate. This ability comes from the dynamical way people change status, the
decision being depending on the crowd itself. The parameter $\delta t$,
instead, affects the maximal density near the gate more than the size $N$ of
the crowd itself. This conveys the idea that large crowds are not an issue
_per se_ , but high densities actually arise whenever people keep moving
towards a blocked crowd. This creates a compression which is then very hard to
resolve.

Finally, numerical simulations suggest that it is possible to prevent the
formation of congestion by informing people along the corridor about the
status of the gate. Even one information point is able to drastically reduce
the maximal density since it prevents the encounter between the first people
who have reached the closed gate and those who are arriving.

In the next future we will further investigate the role of the geometry of the
domain in crowd dynamics, in particular testing different shapes of the
corridor. We will also evaluate the impact of the visibility of the signals
which inform people about the status of the gate.

Even more important, we will validate the results of the simulations comparing
them with the real dynamics of people observed during mass events by means of
video cameras.

Overall, we are strongly convinced that the adoption of predictive tools for
congestion formation and technologies/automatisms for informing the crowd
should be a further subject of study in event planning and crowd safety
management.

## Funding

This work was carried out within the research project “SMARTOUR: Intelligent
Platform for Tourism” (No. SCN_00166) funded by the Ministry of University and
Research with the Regional Development Fund of European Union (PON Research
and Competitiveness 2007–2013).

E.C. would also like to thank the Italian Ministry of Instruction, University
and Research (MIUR) to support this research with funds coming from PRIN
Project 2017 (No. 2017KKJP4X entitled “Innovative numerical methods for
evolutionary partial differential equations and applications”).

E.C. and M.M. are members of the INdAM Research group GNCS.

## Authors’ contribution

G.A. proposed the research topic, suggested the case study, provided some real
data for calibration, interpreted the results, and proofread the paper. E.C.
and M.M. developed the model, wrote the numerical code, performed numerical
tests, interpreted the results, and wrote the paper.

## References

  * [1] K. Hirai and K. Tarui, A simulation of the behavior of a crowd in panic, in Proceedings of the 1975 International Conference on Cybernetics and Society, pp. 409–411, 1975.
  * [2] S. Okazaki, A study of pedestrian movement in architectural space, part 1: pedestrian movement by the application of magnetic model, Trans. of A.I.J., vol. 283, pp. 111–119, 1979.
  * [3] L. F. Henderson, On the fluid mechanics of human crowd motion, Transpn. Res., vol. 8, pp. 509–515, 1974.
  * [4] R. Aghamohammadi and J. A. Laval, Dynamic traffic assignment using the macroscopic fundamental diagram: A review of vehicular and pedestrian flow models, Transportation Res. B, vol. 137, pp. 99–118, 2020.
  * [5] N. Bellomo and C. Dogbé, On the modeling of traffic and crowds: A survey of models, speculations, and perspectives, SIAM Rev., vol. 53, no. 3, pp. 409–463, 2011.
  * [6] H. Dong, M. Zhou, Q. Wang, X. Yang, and F.-Y. Wang, State-of-the-art pedestrian and evacuation dynamics, IEEE Transactions on Intelligent Transportation Systems, vol. 21, no. 5, pp. 1849–1866, 2020.
  * [7] D. C. Duives, W. Daamen, and S. P. Hoogendoorn, State-of-the-art crowd motion simulation models, Transportation Res. C, vol. 37, pp. 193–209, 2013.
  * [8] R. Eftimie, Multi-dimensional transport equations, in Hyperbolic and Kinetic Models for Self-organised Biological Aggregations, pp. 153–193, Springer, 2018.
  * [9] M. Haghani, Optimising crowd evacuations: mathematical, architectural and behavioural approaches, Safety Science, vol. 128, 104745, 2020.
  * [10] F. Martinez-Gil, M. Lozano, I. García-Fernández, and F. Fernández, Modeling, evaluation, and scale on artificial pedestrians: A literature review, ACM Comput. Surv., vol. 50, no. 5, pp. 72/1–35, 2017.
  * [11] E. Papadimitriou, G. Yannis, and J. Golias, A critical assessment of pedestrian behaviour models, Transportation Res. F, vol. 12, no. 3, pp. 242–255, 2009.
  * [12] E. Cristiani, B. Piccoli, and A. Tosin, Multiscale Modeling of Pedestrian Dynamics.  Modeling, Simulation & Applications, Springer, 2014.
  * [13] M. D. Rosini, Macroscopic Models for Vehicular Flows and Crowd Dynamics: Theory and Applications.  Springer, 2013.
  * [14] P. Kachroo, S. J. Al-nasur, S. A. Wadoo, and A. Shende, Pedestrian dynamics. Feedback control of crowd evacuation.  Understanding Complex Systems, Berlin Heidelberg: Springer-Verlag, 2008\.
  * [15] B. Maury and S. Faure, Crowds in Equations. An Introduction to the Microscopic Modeling of Crowds.  World Scientific, 2019.
  * [16] D. Helbing, Traffic and related self-driven many-particle systems, Rev. Mod. Phys., vol. 73, pp. 1067–1141, 2001.
  * [17] G. Albi, E. Cristiani, L. Pareschi, and D. Peri, Mathematical models and methods for crowd dynamics control, in Crowd Dynamics, Volume 2: Theory, Models, and Applications (L. Gibelli, ed.), Modeling and Simulation in Science, Engineering and Technology, pp. 159–197, Springer Nature Switzerland, 2020.
  * [18] E. Cristiani, A. De Santo, and M. Menci, A generalized mean-field game model for the dynamics of pedestrians with limited predictive abilities, submitted to Communications in Mathematical Sciences, under revision, 2021.
  * [19] D. Helbing and P. Mukerji, Crowd disasters as systemic failures: analysis of the Love Parade disaster, EPJ Data Science, vol. 1, 7, 2012.
  * [20] D. Helbing and P. Molnár, Social force model for pedestrian dynamics, Physical Review E, vol. 51, no. 5, p. 4282, 1995.
  * [21] S. Hoogendoorn and P. H. L. Bovy, Simulation of pedestrian flows by optimal control and differential games, Optimal Control Applications and Methods, vol. 24, no. 3, pp. 153–172, 2003.
  * [22] S. Heliövaara, T. Korhonen, S. Hostikka, and H. Ehtamo, Counterflow model for agent-based simulation of crowd dynamics, Building and Environment, vol. 48, pp. 89–100, 2012.
  * [23] E. Cristiani, B. Piccoli, and A. Tosin, Multiscale modeling of granular flows with application to crowd dynamics, Multiscale Model. Simul., vol. 9, no. 1, pp. 155–182, 2011.
  * [24] W. Weng, T. Chen, H. Yuan, and W. Fan, Cellular automaton simulation of pedestrian counter flow with different walk velocities, Physical Review E, vol. 74, no. 3, 036102, 2006.
  * [25] S. Nowak and A. Schadschneider, Quantitative analysis of pedestrian counterflow in a cellular automaton model, Physical Review E, vol. 85, no. 6, 066128, 2012.
  * [26] T. Kretz, A. Grünebohm, M. Kaufman, F. Mazur, and M. Schreckenberg, Experimental study of pedestrian counterflow in a corridor, Journal of Statistical Mechanics: Theory and Experiment, P10001, 2006\.
  * [27] S. P. Hoogendoorn, W. Daamen, and P. H. L. Bovy, Extracting Microscopic Pedestrian Characteristics from Video Data – Results from experimental research into pedestrian walking behavior, in Transportation Research Board 82nd Annual Meeting, 2003.
  * [28] D. Helbing, P. Molnár, I. J. Farkas, and K. Bolay, Self-organizing pedestrian movement, Environment and Planning B: Planning and Design, vol. 28, no. 3, pp. 361–383, 2001.
  * [29] H. Murakami, C. Feliciani, Y. Nishiyama, and K. Nishinari, Mutual anticipation can contribute to self-organization in human crowds, Science Advances, vol. 7, no. 12, eabe7758, 2021.
  * [30] A. F. Aveni, The not-so-lonely crowd: Friendship groups in collective behavior, Sociometry, vol. 40, no. 1, pp. 96–99, 1977.
  * [31] M. Moussaïd, N. Perozo, S. Garnier, D. Helbing, and G. Theraulaz, The walking behaviour of pedestrian social groups and its impact on crowd dynamics, PloS One, vol. 5, no. 4, e10047, 2010.
  * [32] C. Von Krüchten and A. Schadschneider, Empirical study on social groups in pedestrian evacuation dynamics, Physica A: Statistical Mechanics and its Applications, vol. 475, pp. 129–141, 2017.
  * [33] H. Singh, R. Arter, L. Dodd, P. Langston, E. Lester, and J. Drury, Modelling subgroup behaviour in crowd dynamics DEM simulation, Applied Mathematical Modelling, vol. 33, no. 12, pp. 4408–4423, 2009.
  * [34] F. Zanlungo, L. Crociani, Z. Yücel, and T. Kanda, The effect of social groups on the dynamics of bi-directional pedestrian flow: a numerical study, in Traffic and Granular Flow 2019, pp. 307–313, Springer, 2020.
  * [35] L. Crociani, A. Gorrini, C. Feliciani, G. Vizzari, K. Nishinari, and S. Bandini, Micro and macro pedestrian dynamics in counterflow: The impact of social group, in International Conference on Traffic and Granular Flow, pp. 151–158, 2017.
  * [36] R. Scozzari, M. Fronterrè, and G. G. Amaro, Modeling crowd movement in large scale events, the case of Storico Carnevale di Ivrea, in Proceedings of Fire and Evacuation Modeling Technical Conference (FEMTC), 2018\.