Keywords

Fig. 1.
figure 1

Part (a), (b), and (c) are some of the large gathering events in big cities (https://www.nyc.gov/site/cecm/gallery/photo-gallery.page). Part (d) shows the number of city events in New York City, with an obvious growing trend from 2008 to 2015 (https://data.cityofnewyork.us/City-Government/NYC-Permitted-Event-Information/tvpp-9vvx). Part (e) reports a number of people who fail victims to crowd stampedes over the years (https://en.wikipedia.org/wiki/List_of_human_stampedes_and_crushes). As we can observe from the statistical data, the increase in large gathering events in cities comes with an unwanted side-effect (i.e., growth in the number of stampedes victims).

1 Introduction

Seoul, a city popular for its diversity and nightlife, should have been filled with happiness and laughter for the Halloween celebration on October 29, 2022. However, it instead witnessed a terrible stampede accident at Itaewon, taking the lives of at least 156 people and causing more than 152 injuredFootnote 1. Just a day later, another crowd crush accident took place in Kinshasa, Democratic Republic of the Congo, where 11 people were killed when attending a music concertFootnote 2. While mourning for the dead, we should also be alerted by these consecutive tragedies. Over the years, the rapid development of society and economy has brought a significant increase to the number of large gathering activities, which can potentially lead to emergencies, especially the risk of the crowd stampedes [1,2,3], as shown in Fig. 1. Therefore, a question can be naturally thrown to technical researchers: Can we estimate the influence of an incoming city event on human mobility given a certain context? The study of this problem serves as an essential part for smart city development, and if solved properly, it could provide event organizers (e.g., government) with additional guidance [4, 5], making them more prepared for what is about to happen. For example, a corresponding number of police officers can be sent to maintain order according to the estimated influence of the event. An appropriate time and location of the event can also be carefully selected to prevent excessive impact on normal mobility of people (e.g., city maintenance events during rush hours at busy cross-roads usually have great impacts on travelers).

There is already a myriad of work trying to incorporate city events into human mobility studies [6,7,8,9,10]. However, these researches only implicitly capture the data correlation between the events and human mobility, and can not generate the counterfactual outcome which deviates from the factual distribution. In this paper, we propose to estimate the causal effect (e.g., Individual Treatment Effect [11, 12]) of city events on mobility with the help of counterfactual prediction [13, 14], and to the best of our knowledge, no one has made such attempt in this direction. Traditionally, the ideal solution to obtain causal effect is by conducting Randomized Controlled Trials (RCTs) [15], which randomly divide samples into treated group and control group based on whether or not the treatments are given, and then the causal effect of treatment can be estimated via the outcome differences over the two groups. However, in reality RCTs are not always practical to conduct due to time and money overhead and ethical reasons [16], and a new line of machine-learning based methods [17,18,19] have been proposed to directly estimate causal effect from large amount of observation data. Since it is nearly impossible to put city events into experimental settings, we follow the new line of work to only utilize observation data for estimation. Nevertheless, most counterfactual prediction works focus on the setting without unobserved confounders [20], which is impractical in real-world circumstances. To provide a more meaningful and solid counterfactual analysis, in this paper we argue that a key challenge of estimating causal effects of city events from observation data is how to eliminate the unobserved confounding bias (e.g., in our case, the people’s willingness to go outdoors) that both affect the treatments (e.g., whether the city event would be held or not) and the outcomes (e.g., how many people will come). For example, if people are unlikely to travel to a certain district because of weather condition or safety issues (e.g., several shooting accidents just happened in this region), the government might also avoid holding gathering events (e.g., farmer market) in this area. Even if it does, the number of participants will not be large. Here we can see that the people’s willingness to go out is a confounder, and if not handled properly, we might incorrectly draw a statistical conclusion that the farmer market is not attractive to people. Moreover, the unobserved confounder in our case can be time-varying (e.g., people’s safety awareness can significantly increase after a gun shot accident and thus they will be less willing to go to a certain district), and if not well addressed, such case can bring huge bias into the causal estimation [21]. Fortunately, an alternative way to circumvent this problem is to adopt a weaker form of the unconfoundedness assumption [22] (i.e., we can observe all the confounders directly), where proxy variables can be used to reform the unobserved confounders [11, 23].

To this end, our paper utilizes multi-sources of data to study our problem. We selected web search results of some safety-related keywords (e.g., stampedes, gunshot) in Google, the crime data, and weather data in New York City as proxy variables to capture people’s willingness to go out at a certain district (i.e., the unobserved confounder). Then, we build a simple neural network-based framework to learn data representations and help with counterfactual analysis. Finally, we estimate the ITE of city events using human mobility and event data in New York City. The main contributions of our work are summarized as follows:

  1. 1)

    We are the first to address the important problem of estimating individual treatment effect of city events on human mobility using counterfactual prediction. This study can utilize the power of machine learning technology to assist better decision making in smart city management.

  2. 2)

    We develop a neural network-based framework with multi-sources of city data to learn better data representations and help counterfactual analysis.

  3. 3)

    We assess the causal effect of different categories of events and illustrate them from both spatial and temporal aspects to give a comprehensive understanding of their causal effects.

The remainder of this paper is structured as follows: In Sect. 2, we provide a detailed description and analysis of the data. Section 3 introduces the basic notations and formulations. The model framework is introduced in 4. Experimental results and causal analysis are presented in Sect. 5. Section 6 summarizes the related works of our study and Sect. 7 concludes the paper.

Table 1. Examples of the selected events and their categories.

2 Data Description and Analysis

In this section, we introduce the multi-sources data we use to assess the causal impact of events on human mobility. Some preliminary data analyses are also presented to show their potential capability of capturing the (unobserved) confounders.

2.1 Treatment - Urban Event

There’s always something interesting going on in New York City, such as, New York concerts, Broadway musicals and performances, as well as New York’s famous operas, sporting events, museums and galleries exhibitions, which provide us abundant events to research. We here collect the record of events from the Office of Citywide Event Coordination and Management (CECM)Footnote 3, which contains general information on approved event applications. In this paper, we select the time period 2015/01/01-2015/06/30 as the research time range and manually categorize the activity types into three groups: Entertainment, Sale &Market, and Special Event. Several examples and event descriptions are shown in Table 1.

2.2 Outcome - Human Mobility

We here utilize the taxi data to represent the actual human mobility. The data is collected from the first half of 2015 and provided by New York City’s official website NYC’s Taxi CommissionFootnote 4. Each taxi trip data in the dataset includes the taxi ID, the time stamp of the taxi pickup, the time stamp of the taxi drop off, the latitude and longitude of the pickup location, the latitude and longitude of the drop off location, the duration of the trip, and the travel time. distance, and the number of passengers. It should be noted that this article only uses records where the interval between the pick-up timestamp and drop-off timestamp is greater than or equal to 1 min. In addition, if the longitude and latitude of the drop-off location and the pick-up location are too close, we also assume that they belong to the same urban area and such records will not be considered in our experiments.

2.3 Confounder - People’s Willingness to Go Out

The people’s willingness to go outdoors is a time-varying confounder in our study, which can potentially affect the decision of holding city events and the resulted human mobility. To avoid yielding biased estimation of the causal effect, we have to learn the representation of the confounders and integrate them into training to eliminate the confounding bias [18, 21]. Although the confounder here is hard to be quantified, we can still use the proxy variables to capture the confounder under a weaker form of unconfoundedness assumption [22]. In this paper, we choose three proxy variables (i.e. gun shooting related keywords on Google, crime data in NYC, and weather data in NYC) to learn the representation of confounders. Note that the data sources we choose here are subject to data availability and further sources of data can be added if suitable.

Google Trend. Google trendsFootnote 5 is a completely free analysis tool based on Google search data. It analyzes billions of Google search engine search data every day and tells users the trend of a certain keyword or topic in various periods. The correlation between Google trends regarding to the gun shooting and the shooting incidents that occur in New York are shown in Fig. 2. The frequency of appearance in the Google search engine and its associated statistics can well establish the people’s willingness to go outdoors.

Fig. 2.
figure 2

As depicted, the Google trends regarding the gun shooting and the shooting incidents happening in NYC are shown together.

NYC Crime. The Crime data were collected from the NYC OpenData portal, the New York City Open Dataset websiteFootnote 6. This paper obtained the crime records from January 1, 2015 to June 30, 2015, each record contains the following attributes: crime category, latitude, longitude, and crime time. Similar to previous research, this paper divides New York City into 77 disjoint geographic regions based on New York City’s police precincts because of their well-defined, historically recognized, and long-term stability. Several cases of distribution comparison between crowd flow and crimes are depicted in Fig. 4. We can observe that the nature of people always cling to avoid danger.

NYC Weather. There is a bunch of work [24,25,26,27], quantitatively measuring the impact of weathers on many aspects of transportation. Intuitively, people tend to stay home when extreme weathers happen. Thus, in this paper, the NYC weather is collected from websiteFootnote 7, including temperature, cloud cover, wind speed, etc., to reflect the people’s willingness to go outdoors.

Fig. 3.
figure 3

Illustrating the causal diagram of city’s events and human mobility.

3 Preliminaries

In this section, we will briefly introduce the definition and assumption in causal inference.

Individual treatment effect (ITE) estimation aims to examine whether a treatment \(\textit{T}\) affects the outcome \(Y^{(i)}\) of a specific unit i. Let \(\textbf{x} \in \mathcal {R}^d\) denote the pre-treatment covariates of unit i, where d is the number of covariates. \(\textit{T}_i\) denotes the treatment on unit i. In the binary treatment case, unit i will be assigned to the control group if \(\textit{T}_i = 0\), or to the treated group if \(\textit{T}_i = 1\). We follow the potential outcome framework proposed by [28, 29]. If the treatment \(\textit{T}_i\) has not been applied to unit i, \(Y^{(i)}_0\) is called the potential outcome of treatment \(\textit{T}_i = 0\) and \(Y^{(i)}_1\) the potential outcome of treatment \(\textit{T}_i = 1\). On the other hand, if the unit i has already received a treatment \(\textit{T}_i\), then \(Y_{\textit{T}_{i}}\) is the factual outcome, and \(Y_{1-\textit{T}_{i}}\) is the counterfactual outcome. In observational study, only the factual outcomes are available, while the counterfactual outcomes can never been observed. The individual treatment effect on unit i is defined as the difference between the potential treated and control outcomes:

$$\begin{aligned} {\textbf {ITE}}_i = Y^{(i)}_1 - Y^{(i)}_1. \end{aligned}$$
(1)

The challenge to estimate \({\textbf {ITE}}_i\) lies on how to estimate the missing counterfactual outcome. Existing counterfactual estimation methods usually make the following important assumptions.

Assumption 1:

(SUTVA). The potential outcomes for any unit do not vary with the treatment assigned to other units, and, for each unit, there are no different forms or versions of each treatment level, which lead to different potential outcomes [30].

Assumption 2:

(Consistency). The potential outcome of treatment t equals to the observed outcome if the actual treatment received is t.

Assumption 3:

(Ignorability). Given pretreatment covariates X, the outcome variables \(Y_0\) and \(Y_1\) is independent of treatment assignment, i.e., (\(Y_0\), \(Y_1\)) \(\perp \!\!\! \perp \) T|X.

Ignorability assumption makes the ITE estimation identifiable. In this paper, we make the assumption more plausible because we notice that the pretreatment covariates include the variables that affect both the treatment assignment and the outcome (i.e., confounders).

Assumption 4:

(Positivity). For any set of covariates x, the probability to receive treatment 0 or 1 is positive (i.e., 0 < \(P(T = t|X = x)\) < 1, \(\forall \) t and x).

This assumption is also named as population overlapping [31]. If for some values of X, the treatment assignment is deterministic (i.e., \(P(T = t|X = x)\) = 0 or 1), we would lack the observations of one treatment group, such that the counterfactual outcome is unlikely to be estimated. Therefore, positivity assumption guarantees that the ITE can be estimated.

Fig. 4.
figure 4

Distributions comparisons between crowd flow and crime on different days are shown above. We can see that people consciously avoid encountering with that places with high rates of crime.

4 Methodology

With the aforementioned sources of data, in this section we aim to construct our causal framework and estimate the causal effect of city events on human mobility. Specifically, we first define our causal graph and capture the unobserved time-varying confounders from a set of observation data. Then a neural-network-based architecture is utilized to conduct counterfactual analysis which finally leads to the ITE estimation. The details are described as follows.

4.1 Causal Graph

The goal of this study is to understand the causal effect of city events on human mobility, using data on taxi pickups and drop-offs in NYC as an example. We propose a causal graph, as shown in Fig. 3, to represent the relationships between the different variables. Node E represents a list of city events, which have time ranges and locations and may influence human mobility. Node Y is the observed human mobility outcome, and the link \(E \rightarrow Y\) represents the effect of events on human mobility. Node Z represents people’s participation willingness, which is a confounder for both E and Y. People’s participation willingness affects whether an event is held and the number of participants in an event. The link \(Z \rightarrow E\) represents the effect of people’s participation willingness on holding events, and the link \(Z \rightarrow Y\) represents the effect of people’s participation willingness on human mobility. Nodes SW, and C represent features of Google search, weather, and crime, respectively. These variables are used as proxy variables to capture people’s willingness to go outdoors, as they cannot be directly accessed. The links \(S \rightarrow Z, W \rightarrow Z\), and \(C \rightarrow Z\) represent the effect of these proxy variables on people’s participation willingness (Fig. 5).

Fig. 5.
figure 5

Obtaining the causal effect via counterfactual analysis. \(E_t\) denotes the event list at t timestamp, and G is the features generator.

4.2 Learning the Representations of Time-Varying Confounders

We try to capture the time-varying confounders (e.g., people’s participation willingness) through proxy variables. As shown in Fig. 3 (b), we assume the Google search of safety-aware keywords, weather conditions and crime rate can reflect people’s participation willingness. Let n denotes the number of regions in NYC, and t denotes a certain time interval. We have \(Z^{t}=\{z^{t}_{i}\}^{n}_{i=1}\), representing the unobserved confounders of people in different regions at time interval t. Similarly, we can define \(S^{t}=\{s^{t}_{i}\}^{n}_{i=1}\), \(W^{t}=\{w^{t}_{i}\}^{n}_{i=1}\), \(C^{t}=\{c^{t}_{i}\}^{n}_{i=1}\) to represent the Google search results, weather condition and crime rate respectively. Specifically, \(s^{t}, c^{t} \in R^{n}\) and their values are standardized to the interval of [0, 1]. Meanwhile, we let \(w^{t}\in R^{n\times d}\), and d is the length of one-hot encoding which we use to represent weather condition. Inspired by the universal approximation theorem [32], we use a multi-layer perceptron with ReLU activation [33] as function \(f(\cdot )\) to derive the unobserved confounders as follows:

$$\begin{aligned} z^t=f(s^{t}||w^t||c^t), \end{aligned}$$
(2)

where || denotes the concatenate operator. However, as previously mentioned, the confounders are time-varying and have self-correlated temporal influences (e.g., people’s participation willingness will not significantly increase just one day after a severe human stampede). Therefore, we adopt the idea of recurrent neural network [34] and propose the final formulation for \(z^t\) as:

$$\begin{aligned} z^t&= RNN(\mathcal {H}^{t}, f(s^{t}||w^t||c^t), \end{aligned}$$
(3)

where \(\mathcal {H}^{t}\) is the hidden unit in the RNNs which captures the historical information.

4.3 Estimating ITE via Counterfactual Analysis

Counterfactual analysis asks: how will the outcome change if it’s given an different treatment? In our case, we use E (events) to present the treatment. If E has a causal effect on Y, then a change in E will lead to a change in Y, keeping other variables as constants. The causal effect is equivalent to the magnitude of the change in Y caused by the intervention of E. Based on the values of the treatment variable E (E=1 and E=0), the outcome variable Y has two potential outcomes, \(\hat{Y}(1)\) and \(\hat{Y}(0)\), indicating the result with treatment or not. We propose a shared bottom architecture to handles the common variables, keeping them the same for auxiliary models, and the job of auxiliary models are to configure different parameters to simulate the situation of whether the treatment is given. In our paper, we use a simple two layers GCN [35] as the shared bottom model, and two MLPs for the auxiliary models. Specifically, let \(X^t=\{x_i^t\}_{i=0}^{n}\) denotes the historical human mobility, the mathematical operation of the shared bottom model is shown as follows:

$$\begin{aligned} L^{t+1}=\hat{A}\cdot ReLU(\hat{A}\cdot (X^t||Z^t)\cdot W_1)\cdot W_0, \end{aligned}$$
(4)

where \(\hat{A}\) is the normalized adjacent matrix of the city graph, and \(W_1, W_0\) are the parameters of GCN. After obtaining the latent variable \(L^{t+1}\), we use two MLPs (\(f_0(\cdot ), f_1(\cdot )\)) to get the two potential outcomes:

$$\begin{aligned} &\hat{Y}(0)= f_0(L^{t+1})\\ &\hat{Y}(1)= f_1(L^{t+1}). \end{aligned}$$

Here \(\hat{Y}(0)\) contains human mobility results with no city events and \(\hat{Y}(1)\) contains the results with city events. The ITE can then be induced by the difference between the predicted potential outcomes: \(ITE=| \hat{Y}(1)-\hat{Y}(0)|\). Finally, to supervise and train our model, we use the ground truth human mobility Y as supervise signals and formulate the MSE loss as \(L_{mse}=\frac{1}{n} \sum _{t=1}^T |\hat{Y}^t-Y^t|\). Moreover, since the imbalanced confounders over different regions in the city will bring additional bias to the causal effect estimation [18], we also employ a distribution balancing constraint \(L_{cons}\) which is the Wasserstein-1 distance of the representation distributions. Overall, the training loss of our model is formulated as:

$$\begin{aligned} L = L_{mse}+ \lambda L_{cons}, \end{aligned}$$
(5)

where \(\lambda \) is a balance factor. After the model training, we can estimate the ITE of different city events using the differences between the two different potential outcomes.

Fig. 6.
figure 6

Causal effect estimation of different event types on the workday.

5 Analyzing Estimated Treatment Effects

5.1 Entertainment

The category of entertainment, popular festival, block party/event, and parade, is shown in the top of Fig. 6 and Fig. 7. Comparing with the ITE values of other categories, entertainment tends to cause human gather. In terms of popular festival, the ITE values maintain in a high status overall day, regardless to workday and weekend. For example, the annual NYC Multicultural FestivalFootnote 8 was held on May 30, 2015, the largest showcase of different cultures of the world in one place and at one time. In terms of a block party, it is a gathering where many members of a community come together and usually involves closing an entire city block to vehicular traffic or just one street. Many times, celebrations take place in the form of music, games, dancing and food such as popcorn machines and barbecues. The peak of workday ITE is shown in the evening, due to the daily commuting. We can observe that the effect of block party significantly smaller than festivals. The last category: parade, is an activity in which a particular festival or event is celebrated by way of a mass procession and falls within the category of celebrations or festivals, it is very widespread in New York City. For instance, June 14, 2015, is the “National Puerto Rican Day Parade"Footnote 9 in the United States. On Fifth Avenue in Manhattan, New York, 80,000 people participated, and 2 million people watched the grand parade along the way. The parade continued along Fifth Avenue from 44th Street to 79th Street. For nearly 6 h, this is also one of the largest parades of the year in New York.

Fig. 7.
figure 7

Causal effect estimation of different event types on the weekend.

Fig. 8.
figure 8

Spatial ITE distribution in Manhattan with the case study.

5.2 Sale and Market

Many supermarkets often hold special promotions during the day to attract people. As we can see in the middle of Fig. 6 and Fig. 7, a majority of people are inclined to go to the farmers markets to buy fresh products. Unlikely, the sidewalk sales, an outdoor sales event that retailers hold to get rid of end-of-season merchandise, more hold in an informal way. we can speculate from Fig. 6 that it will be greatly favored by those people who meet it causally. For instance, the Old Cathedral Outdoor Market can be found on a quiet street in Nolita, that quaint neighborhood north of Little Italy, against the backdrop of a brick wall on Prince Street.

Fig. 9.
figure 9

The risk distribution calculated by ITE and precinct area, and traffic collision in (a), and rank of risk in (b).

Table 2. Performance comparison of MAE on NYC taxi Dataset on workday and weekend.
Table 3. Estimated treatment effects of human mobility.

5.3 Special Event

The causal effect of special events can be found at the bottom in Fig. 6 and Fig. 7. In fact, New York City is often considered the most filmed city in the world. Relive unforgettable film and television moments by visiting these iconic film locations. There are many authentic New York attractions featured in the famous Christmas movie Home Alone 2, such as the Empire Restaurant, Battery Park, Gapstow Bridge and Bethesda Terrace, as well as the Wolman Ice Rink in Central Park and, of course, Rockefeller Center. Moreover, Kelly’s apartment in “Sex and the City" (66 Perry Street) attracts a lot of tourists every year. Nevertheless, the director usually locks the street or blocks to avoid a huge crowd. Thus, we can see the causal effect on filing/photography tends to be negative. From Fig. 6 and Fig. 7, we can speculate that people living in NYC have a great enthusiasm for sports since ITE values show positive results in the evening of the workday and in the general time of the weekend. For the last attribution, without exception, people naturally sidestep the construction site (Table 3).

5.4 Spatial Distribution of ITE

For a clear understanding of the effect of ITE, here we illustrate the spatial distribution of ITE in Manhattan depicted in Fig. 8, since it contains the most holding events compared to others. We list three famous events, Feast of San Gennaro, East 67th Street Market, and Broad City, for the popular festival, farmer markets, and filming/photography, respectively, to better explain. We can notice that there is much crowd flow aggregation in several small blocks divided by the police precinct when the activities happen, which potentially increases the risk of emergencies. And, it is worth noting that people own the inertia to hold the events in the same place, especially for the festival and parade, which is challenging for public management. For the analysis of the implicit risk of aggregation of the crowd, we use the equation: \(risk=\frac{ITE}{area}\) and show the result in Fig. 9, where area is the area of the precinct. Intuitively, the risk of emergencies can be defined as how many events contribute to the density of the crowd. From Fig. 9, we can conclude that precincts 7, 9, and 2, have a relatively large risk than others since a majority of events prefer to hold in these places, such as popular festivals, parades, and outdoor sports. We also show the NYC traffic collision data collected from NYC open dataFootnote 10. The side confirming our generated causal effect is reasonable.

5.5 Experimental Setups

Our experiments are implemented with PyTorch 1.6.0 and Python 3.6, and trained with eight RTX2080Ti GPUs. The platform we run on is Ubuntu 16.04 OS. We train our model using Adam optimizer with an initial learning rate of 0.001. Dropout with 0.5 retaining rates is applied to the outputs of the graph convolution layer.

5.6 Baseline Methods

We evaluate our curriculum strategy with the following method:

  • LR: Least square Regression.

  • HSIC-NNM [36]: Nearest neighbor matching based Hilbert-Schmidt Independence Criterion based on nearest neighbor matching by learning subspaces that are predictive of the outcome variable for both the treatment group and the control group.

  • PSM [37]: Propensity score, the conditional probability of assignment to a particular treatment given a vector of observed covariates that is consistent with logistic regression.

  • Causal Forest [38]: Tree and forest-based method for estimating heterogeneous treatment effects that extend Breiman’s widely used random forest algorithm.

  • BNN [39]: Balancing neural network for counterfactual inference which brings together ideas from domain adaptation and representation learning.

  • TARNet [18]: Treatment-Agnostic Representation Network that captures nonlinear relationships underlying features to fit the treated and controlled outcome.

  • CFR-MMD [18]: counterfactual regression with MMD metric that attempts to find balanced representations by minimizing the MMD metric between the treated and controlled individuals.

  • CFR-WASS [18]: counterfactual regression with the Wasserstein metric that attempts to find balanced representations by minimizing the Wasserstein distance between the treated and controlled individuals

5.7 Result Analysis Comparing with Causal Baselines

To further investigate the capability of our framework, we conduct extensive experiments to compare the causal baselines, estimating human mobility over workday and weekend. Table 2 compares the performance of different methods in predicting the treatment assignment (whether the events are held at specific places) and outcomes (the numbers of pick up and drop off at these places). We also performed the ablation study by removing the variable of Google trends, crime, weather, and adjacent matrix, respectively, indicating that variable can well represent the cofounder [18]. We can see that our method can significantly outperform state-of-the-art methods.

5.8 Estimating Causal Effects on Synthetic Data

Generating synthetic data to evaluate the credibility of causal estimation is a common strategy [40, 41]. To simplify, we here calculate the mean flow from 2015/01/01 to 2015/06/31 to eliminate the effect of events and assume it as the baseline, which presents it as the normal flow. Then, we applied the Gaussian distribution \(\mathcal {N}(\mu ,\sigma )\), where \(\mu \) and \(\sigma \) denote the mean and variance, respectively. it’s hard to obtain data that the actual number of participants. Therefore, we use the estimated result from Fig. 6 and Fig. 7 as the \(\mu \) and define the values of \(\sigma \). The estimation on synthetic data has shown in Table 4. We can see that the estimating error is still quite large, which can be blamed on two parts. 1) the data generating process may be inconsistent with the real world; 2) the causal estimation is unsupervised learning, which is challenging to learn precise prediction.

Table 4. Estimated treatment effects of human mobility in synthetic data.

6 Related Work

6.1 Emergency Analysis

In the fields of urban planning, large-scale event management, building design, fire safety procedures, fire rescue and other fields, personnel safety issues in congested environments have received high attention. Safety capacity control is an effective measure to prevent excessive crowd gathering, avoid crowded and trampled and other vicious events, and is the key to ensuring urban public safety. For public places such as squares, parks, commercial blocks, leisure and entertainment spaces, and tourist attractions, there is a greater risk of crowd congestion. Therefore, it is of great significance to fundamentally grasp the temporal and spatial distribution characteristics of crowd gatherings, formulate safety capacity control standards that are more in line with the management needs of open public places, and effectively prevent and control personnel congestion. From the perspective of environmental factors, [42] studied the factors that affect the safety of crowds, and believed that in a crowded state, a small number of people had an accident. If the information in the crowd is asymmetric, the crisis will quickly spread to the surrounding crowd, and then the order will be out of control. This causes panic and confusion. [43] pointed out that the design defects of venues or public places may lead to hidden dangers to the safety of the crowds gathering in the area and aggravate the difficulty of crowd management. [44] proposed a real-time crowd density estimation method based on Markov random field (MRF), and introduced the application steps of the method in detail. [45] selected 13 subway stations in Beijing, conducted an empirical analysis from the feasibility and applicability of establishing a crowded stampede risk model, and applied the crowd aggregation risk research and judgment to practice.

6.2 Urban Flow Prediction

With the acceleration of the urbanization process, people’s demand for travel is increasing, and traffic congestion is becoming more and more serious, which restricts the development of China’s cities. At present, it is urgent to establish an intelligent transportation system to help people rationally plan traffic routes and alleviate traffic congestion. The core of the intelligent transportation system is to accurately predict future traffic flow conditions, so as to assist the tasks in the system. Urban traffic flow prediction is an important research problem in the field of spatiotemporal data mining, especially in the context of the existing big data era. [46] summarizes the latest progress in spatiotemporal data mining, and summarizes recent work in terms of research questions and corresponding methods. Spatiotemporal data is usually affected by other external environmental semantic information, such as weather, vacation, and surrounding environment. [47] proposed the ADAIN model to integrate air quality monitoring data and road network data.

6.3 Causal Inference

The goal of causal inference [48] is to discover the causal relationship behind variables (things). [49] divides causality into three levels, the first level is “ssociation", the second level is “intervention", and the third level is “counterfactual reasoning". He believes that the current research is only at the first level, which is “weak artificial intelligence". To achieve “strong artificial intelligence", intervention and counterfactual reasoning are needed, that is, causal inference. At present, the academic community generally believes that the ability of models to learn causal relationships is a key part of the road to strong artificial intelligence [50]. In the history of scientific research, causal learning has been applied in countless important fields, including education [51], medicine [52], economics [53], meteorology [54], and environmental health [55]. In machine learning, causal inference has had many applications, and some problems of learning causal relationships can be attributed to supervised learning problems. Once the data is labeled with causality, the problem of learning causality can be transformed into a prediction problem. The main difficulty here is obtaining labels for the causal direction. For some datasets, causality was confirmed to exist in the dataset [56].

6.4 Discussion

In addressing the confounding effects introduced by individuals’ willingness to participate, our research extends beyond mere correlation to explore the causal relationship between social events and human mobility. We employ a counterfactual-based method to mitigate the interference of cofounding variables. A causal diagram is constructed to facilitate the understanding of these causal influences. Our analysis considers the impact of urban activities on mobility patterns during both workdays and weekends, revealing unique patterns associated with various activities (e.g., outdoor sports, community events) across different days. These insights have numerous implications for researchers and the mobility-oriented community and can be applied in a multitude of contexts.

Our causal framework bears significant relevance to the field of ubiquitous computing. As per our prior data analysis, the positive correlations between crime and mobility distribution intuitively align with expectations, although they are confounded by variables that concurrently influence both the propensity to conduct activities and human mobility. The causal analysis we’ve developed can alleviate these confounding effects in correlation analysis through counterfactual stratification. With advancements in ubiquitous computing and thanks to the NYC government, we’ve been able to gather data from a variety of sources, including wearable devices and mobile phones. Considering privacy and ethical concerns, we refrained from using user trajectory information, focusing instead on pickup and drop-off locations. The causal effects of various events we’ve identified may indirectly benefit downstream applications, such as traffic management and emergency prevention. By understanding mobility patterns during different events, adequate resources can be allocated in advance to prevent tragedies such as those that occurred in Itaewon, Seoul, South Korea, and the New Year’s Eve Stampede at Chen Yi Square in Shanghai.

Our causal analysis uncovers the susceptibility of human mobility patterns to various social events. For example, in Manhattan, our estimations highlight that event locations and preferred venues tend to concentrate, particularly for festivals and parades, posing a significant challenge to public management. The distribution of traffic collisions is also depicted to corroborate our hypothesis, aligning with risk distribution patterns. Our findings suggest that the government should consider offering diverse activity venues to alleviate crowd pressure in Lower and Midtown Manhattan. On a personal level, individuals should exercise caution when participating in crowded events. We further validate our proposed model using synthetic data, which provides a ground truth for the average treatment effect.

7 Conclusion

In this paper, we quantify the causal effect of urban events on human mobility. We collect GPS data from the NYC taxi from January 1, 2015, to June 30, 2015. The corresponding events also are obtained from the Office of Citywide Event Coordination and Management, serve as the treatment from a causal aspect. We also consider the people’s participation willingness as the cofounder and use crime, google trends, and weather as the proxy variable, which have been demonstrated by data analysis to evaluate the relationship. Three kinds of events categories are extracted from the data, including entertainment, sales &market, and special event. We propose a framework based on the counterfactual method to estimate the causal effect of urban events on human mobility by removing the bias brought by confounding effects. Our results provide new insight into understanding the role of urban events in influencing human mobility. Popular festivals and parade have significant estimated effects on human mobility. In the meanwhile, they also tend to hold in a specific region, which implicitly increases the risk of the crowd. We also qualitatively evaluate it by visualizing the traffic collision distribution that mainly concrete in Lower and Midtown Manhattan. We also calculate the risk of the precinct in Manhattan to provide quantitative values to the government. In terms of this, more event venues should be provided by the government to allow citizens diverse choices of holding places, which can maximize and reduce the burden of public law and order.