scieee AI-readable full text Open interactive document viewer

Keeping pace with criminals: An extended study of designing patrol allocation against adaptive opportunistic criminals

Zhang, Chao,Gholami, Shahrzad,Kar, Debarun,Sinha, Arunesh,Jain, Manish,Goyal, Ripple,Tambe, Milind

Abstract

EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.

Full text

Zhang, Chao et al. Article Keeping pace with criminals: An extended study of designing patrol allocation against adaptive opportunistic criminals Games Provided in Cooperation with: MDPI – Multidisciplinary Digital Publishing Institute, Basel Suggested Citation: Zhang, Chao et al. (2016) : Keeping pace with criminals: An extended study of designing patrol allocation against adaptive opportunistic criminals, Games, ISSN 2073-4336, MDPI, Basel, Vol. 7, Iss. 3, pp. 1-27, https://doi.org/10.3390/g7030015 This Version is available at: https://hdl.handle.net/10419/167977 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. http://creativecommons.org/licenses/by/4.0/ games Article Keeping Pace with Criminals: An Extended Study of Designing Patrol Allocation against Adaptive Opportunistic Criminals Chao Zhang 1,*, Shahrzad Gholami 1, Debarun Kar 1, Arunesh Sinha 1, Manish Jain 2, Ripple Goyal 2and Milind Tambe 1 1Department of Computer Science, University of Southern California, Los Angeles, CA 90089, USA; [email protected] (S.G.); [email protected] (D.K.); [email protected] (A.S.); [email protected] (M.T.) 2 Armorway. Inc., Los Angeles, CA 90291, USA; [email protected] (M.J.); [email protected] (R.G.) *Correspondence: [email protected]; Tel.: +1-213-880-8925 Academic Editors: Karl Tuyls and Simon Parsons Received: 13 March 2016; Accepted: 19 June 2016; Published: 27 June 2016 Abstract: Game theoretic approaches have recently been used to model the deterrence effect of patrol officers’ assignments on opportunistic crimes in urban areas. One major challenge in this domain is modeling the behavior of opportunistic criminals. Compared to strategic attackers (such as terrorists) who execute a well-laid out plan, opportunistic criminals are less strategic in planning attacks and more flexible in executing well-laid plans based on their knowledge of patrol officers’ assignments. In this paper, we aim to design an optimal police patrolling strategy against opportunistic criminals in urban areas. Our approach is comprised by two major parts: learning a model of the opportunistic criminal (and how he or she responds to patrols) and then planning optimal patrols against this learned model. The planning part, by using information about how criminals responds to patrols, takes into account the strategic game interaction between the police and criminals. In more detail, first, we propose two categories of models for modeling opportunistic crimes. The first category of models learns the relationship between defender strategy and crime distribution as a Markov chain. The second category of models represents the interaction of criminals and patrol officers as a Dynamic Bayesian Network (DBN) with the number of criminals as the unobserved hidden states. To this end, we: (i) apply standard algorithms, such as Expectation Maximization (EM), to learn the parameters of the DBN; (ii) modify the DBN representation that allows for a compact representation of the model, resulting in better learning accuracy and the increased speed of learning of the EM algorithm when used for the modified DBN. These modifications exploit the structure of the problem and use independence assumptions to factorize the large joint probability distributions. Next, we propose an iterative learning and planning mechanism that periodically updates the adversary model. We demonstrate the efficiency of our learning algorithms by applying them to a real dataset of criminal activity obtained from the police department of the University of Southern California (USC) situated in Los Angeles, CA, USA. We project a significant reduction in crime rate using our planning strategy as compared to the actual strategy deployed by the police department. We also demonstrate the improvement in crime prevention in simulation when we use our iterative planning and learning mechanism when compared to just learning once and planning. Finally, we introduce a web-based software for recommending patrol strategies, which is currently deployed at USC. In the near future, our learning and planning algorithm is planned to be integrated with this software. This work was done in collaboration with the police department of USC. Keywords: security games; optimization; game theory Games 2016,7, 15; doi:10.3390/g7030015 www.mdpi.com/journal/games Games 2016,7, 15 2 of 27 1. Introduction Urban crime plagues every city across the world. A notable characteristic of urban crime, distinct from organized terrorist attacks, is that most urban crimes are opportunistic in nature, i.e., criminals do not plan their attacks in detail; rather, they seek opportunities for committing crime and are agile in their execution of the crime [ 1 , 2 ]. In order to deter such crimes, police officers conduct patrols in an attempt to prevent crime. However, by observing the actual presence of patrol units, criminals can adapt their strategy by seeking crime opportunity in less effectively-patrolled locations. The problem of where and how much to patrol is, therefore, important. Previously, two broad approaches have been used to attempt to solve this problem. The first approach is to manually determine patrol schedules through use of human planners. This approach is used in various police departments, including the University of Southern California (USC). However, it has been demonstrated in other related scenarios, such as the protection of airport terminals [ 3 ] and ships in ports [ 4 ], that manually planning patrols is not only time consuming, but is also highly ineffective. The second approach is to use automated planners to plan patrols against urban crime. This approach has either focused on modeling the criminal explicitly [ 1 , 2 ] (rational, bounded rational, limited surveillance, etc.) in a game model or learning the adversary behavior using machine learning [ 5 ]. However, the proposed mathematical models of criminal behavior have not been validated with real data. Furthermore, prior machine learning approaches have only focused on the adversary actions, ignoring their adaptation to the defenders’ actions [5]. Hence, in this paper, we tackle the problem of generating patrol strategies against opportunistic criminals. We propose the following novel approach: aim to progressively learn criminal behavior using real data. We do so by using two approaches to model the interaction between the criminal and patrol officers: the Markov chain model (MCM) and the Dynamic Bayesian Network (DBN) model (DBNM). More specifically, MCM directly relates crime to observed data, such as past crime and patrols. This model category follows concepts from prior literature; e.g., capturing crime phenomena, such as “crime predicts crime”. DBNM represents the interaction between the criminal and patrol officers as a Dynamic Bayesian Network (DBN) with the number of criminals as the unknown (or latent) state. As far as we know, we are the first to use a DBN model that considers the temporal interaction between defender and adversary in the learning phase. Given a DBN model, we can use the well-known Expectation Maximization (EM) algorithm to learn unknown parameters in the DBN from given learning data. However, using EM with the basic DBN model has two drawbacks: (1) the number of unknown parameters scales exponentially with the number of patrol areas and, in our case, is much larger than the available data itself; this results in over-fitting; (2) EM cannot scale up due to the exponential growth of runtime in the number of patrol areas. We demonstrate these two drawbacks both theoretically and empirically. Therefore, we propose a sequence of modifications of the initial DBN model resulting in a compact representation of the model. This leads to better learning accuracy and increased speed of learning of the EM algorithm when used for the compact model. This sequence of modifications involves marginalizing states in the DBN using approximation techniques from the Boyen–Koller algorithm [ 6 ] and exploiting the structure of this problem. In the compact model, the parameters scale polynomially with the number of patrol areas, and EM applied to this compact model runs in polynomial time. Our next contributions are two planning algorithms that enable computing the optimal officers’ strategy. First, we present a dynamic programming-based algorithm that computes the optimal plan in our planning and updating process. While the dynamic programming approach is optimal, it may be slow. Hence, we also present a fast, but sub-optimal greedy algorithm to solve the planning problem. Further, the criminal’s behavior would change as he or she observes and reacts to the deployment of a new strategy. Hence, the optimal strategy with respect to the learned behavior may not be effective for a long time, as the adversary behavior may change. Thus, we propose to frequently update our adversary model as we obtain new training data from a new deployment of defender strategy. Games 2016,7, 15 3 of 27 By repeating the planning and updating process, we recommend a more effective officer strategy that benefits from adaptation. Next, as part of our collaboration with the police department of USC, we obtained criminal activity and patrol data covering a range of three years. This collaboration not only helped us validate our learning approach, but it also provided insights about the sequence of modifications that could be made for Markov chain models, as well as the basic DBN model. In fact, we project a significant reduction in crime rate using our approach as opposed to the current patrolling approach (see Section 6). More broadly, by introducing a novel framework to reason about urban crimes along with efficient learning and planning algorithms, we open the door to a new set of research challenges. Finally, we build a web-based software that is a patrol schedule recommendation system. In addition, our system collects and analyzes crime reports and resource (security camera, emergency supplies, etc.) data, presenting them in various user-friendly forms. The software is currently deployed for use by the USC police department around their Los Angeles, CA, campus. In future, there are plans to incorporate our learning and planning approach with this software. 2. Related Work We categorize the related work into five overarching areas. First, recent research has made inroads in applying machine learning and data mining in the domain of criminology to analyze crime patterns and support police in making decisions. A general framework for crime data mining is introduced in [ 5 ]. In [ 7 ], data mining is used to model crime detection problems and cluster crime patterns; in [ 8 ], data mining approaches are applied in criminal career analysis; in [ 9 ], the authors apply machine learning techniques to soft forensic evidence and build decision support systems for police. However, this area of research considers only crime data and does not model the interaction between patrol officers and criminals. The second line of work we compare with is Pursuit-Evasion Games (PEG). PEG models a pursuer(s) attempting to capture an evader, often where their movement is based on a graph [ 10 ]. However, in common settings of pursuit evasion games, an evader’s goal is to avoid capture, not to seek opportunities to commit crimes, while a pursuer’s goal is to capture the evader, not to deter the criminal. Thus, common PEG settings are different from those associated with our work. The third area of work we compare with is Stackelberg Security Games (SSG) [ 11 ], which model the interaction between defender and attacker as a game, then recommend patrol strategies for defenders against attackers. SSG has been successfully applied in security domains to generate randomized patrol strategies, e.g., to protect flights [ 11 ], for counter-terrorism and fare evasion checks on trains [ 12 ]. While the early work on SSG assumed a perfectly rational attacker, recent work has focused on attackers with bounded rationality and learning the parameters of the bounded rationality model using machine learning methods, such as maximum-likelihood estimation. An example of this approach is the PAWSmodel [ 13 ]. PAWS addresses the problem of learning poacher behavior within a game-theoretic interaction between defenders and poachers. Recent research has also made progress in designing patrol strategies against adversaries in graph settings [ 14 ]. In [ 15 ], patrol strategies against various types of adversaries are designed. However, including various extensions, security games include an explicit model of the adversary, such as bounded rationality models and limited observation models. In general, in security games, a lack of sufficient data makes learning models of defender adversary interactions challenging. Distinct from these approaches, we do not model the adversary’s decision making explicitly; rather, we learn the adversary interaction with the defender using real-world data. In our case, these are how the adversary moves from one patrol area to another and his or her probability of committing a crime given some patrol officers’ presence. A fourth thread of recent research combines machine learning with game theory. In [ 16 ], the defender’s optimal strategy is generated in an SSG by learning the payoffs of potential attackers from their best responses to defender’s deployments. An inherent problem with such an approach Games 2016,7, 15 4 of 27 is that the defender strategy is geared towards learning the adversary payoff and not exploiting the improved knowledge of the adversary payoff as the game progresses. The last area of work we compare with is on modeling opportunistic criminals. In [ 1 ], burglars’ movement is modeled as a random walk, and in [ 2 ], a more general model of opportunistic criminals was proposed with algorithms for the optimal strategy against such criminals. Again, these papers include explicit models of the criminals and lack real-world data to learn the interactions. 3. Motivating Example 3.1. Domain Description The motivating example for this study is the problem of controlling crime on a university campus. Our case study is about the American University, USC. USC has a Department of Public Safety (DPS) that conducts regular patrols, similar to police patrols in urban settings. As part of our collaboration with USC’s DPS, we have access to the crime report as well as patrol schedule on campus for three years (2011 to 2013). USC is a large enough university that we can claim that our methods are applicable to other campuses similar in size, for example malls. USC’s campus map is divided into five patrol areas, which is shown in Figure 1. DPS patrols in three shifts per day. Crime data are exclusively local, i.e., no crime happens across two patrol areas or patrol shifts. At the beginning of each patrol shift, DPS assigns each available patrol officer to a patrol area, and the officer patrols this area in this shift. At the same time, the criminal is seeking for crime opportunities by deciding which target they want to visit. Discussions with DPS reveal that criminals act opportunistically, i.e., crime is not planned in detail, but occurs when an opportunity arises and there is insufficient presence of DPS officers. B A C E D Figure 1. Campus map. There are two reports that DPS shared with us. The first is about criminal activity that includes the details of each reported crime during the last three years, including the type of crime and the location and time information about the crime. We show a snapshot of these data in Figure 2a. In this paper, we do not distinguish between the different types of crime, and hence, we consider only the number of crimes in each patrol area during each shift. Therefore, we summarize the three-year crime report into 365 × 3 × 3 = 3285 crime data points, one for each of the eight-hour patrol shift. Each crime data point contains five crime numbers, one for each patrol area. The second dataset contains the DPS patrol allocation schedule. Every officer is allocated to patrolling within one patrol area. We show a snapshot of these data in Figure 2b. We assume that all patrol officers are homogeneous, i.e., each officer has the same effect on criminals’ behavior. As a result, when generating a summary of officer patrol allocation data, we record only the number of officers allocated to each patrol area in each shift. Table 1shows a sample of the summarized crime data, where the row corresponds to a shift, the columns correspond to a patrol area and the numbers in each cell are the number of crimes. Table 2 shows a sample of the summarized officer patrol allocation data, where rows correspond to shifts, Games 2016,7, 15 5 of 27 columns correspond to patrol areas and the numbers within a cell represent the number of patrol officers present. For example, from Table 2, we know that in Shift 1, the number of officers in area A is two, while the number of officers in areas B , C , D and E is one; while from Table 1, we know that in Shift 1, there was one crime each in areas A and B and two crimes each in C , D and E . However, we do not know the number of criminals in any patrol area in any patrol shift. We call the patrol areas the targets and each patrol shift a time step. Table 1. Crime data for 3 shifts. Shift A B C D E 1 1 1 2 2 2 2 1 1 1 2 1 3 2 1 1 3 1 Table 2. Patrol data for 3 shifts. Shift A B C D E 1 2 1 1 1 1 2 1 1 2 2 2 3 2 1 1 3 1 (a) Sample crime report (b) Small patrol schedule for one shift Figure 2. Sample data for (a) crime and (b) patrol respectively. 3.2. Problem Statement Given data such as the real-world data from USC, our goal is to build a general learning and planning framework that can be used to design optimal defender patrol allocations in any comparable urban crime setting. In the first cut, we model the learning problem as a Markov chain. Next, we use a DBN to model criminals’ behavior and also present a compact form of DBN that leads to improved prediction. The DBN approach yields better results than the Markov chain approach. Finally, we present methods to find the optimal defender plan for the learned model with the frequent update of the criminal model. 4. Learning Model As stated earlier, we propose two approaches to learn the interaction between criminals and defenders: MCM and DBNM, which we explain in detail in the next two sub-sections. Both approaches are Markov process, but the first approach MCM learns the crime distribution using only observed data, while DBNM uses the number of criminals as an unobserved (hidden or latent) state. As a consequence, the learning algorithm for MCM uses simple maximum likelihood estimation, while DBNM uses the expectation maximization. Games 2016,7, 15 6 of 27 4.1. Markov Chain Models (MCM) The models presented can be divided into three sub-categories: (1) crime as a function of crime history; (2) crime as a function of defender allocation; and (3) crime as a function of crime history and defender allocation jointly. One motivation for this classification is to figure out the correlation between previous-time crime and previous or current-time defenders in the targets and to find out if the presence of patrol officers affects the pattern of crime or not. We discuss these modeling approaches in the following sub-sections. 4.1.1. Crime Predicts Crime In the first model shown in Figure 3a, we investigate the prediction of crime based on the crime distribution at the previous time step at the same target. This correlation is suggested based on the “crime predicts crime” ideas introduced in the criminology literature [ 17 ]. The desired correlation can be defined with the following mathematical function for all targets n:Yn,t+1=f(Yn,t). (a) M1 (b) M2 (c) M3 (d) M4 (e) M5 (f) M6 (g) M7 (h) M8 (i) M9 Figure 3. Markov chain model (MCM) structures. To define and formalize the correlation and a pattern for crime prediction from history, we define a transition matrix, A , that represents how crime occurrences change from one time step to the next one and apply maximum likelihood estimation to obtain it. In particular, A(Yn,t,Yn,t−1) = P(Yn,t|Yn,t−1). For this model, the probability for a sequence of events, i.e., Yn , which refers to number of crimes over a sequence of time steps, can be calculated as follows: P(Yn;A) = P(Yn,t, ..., Yn,0;A) = ∏ 1≤t≤T P(Yn,t|Yn,t−1;A) = ∏ 1≤t≤T A(Yn,t,Yn,t−1)(1) In the above equations, n indicates the target number, and A is the parameter to be estimated. The log likelihood for the above model for target ican be written as the following: l(A) = log P(Yn;A) = |SY| ∑ i=1 |SY| ∑ j=1 T ∑ t=1 1{Yn,t=Si∧Yn,t−1=Sj}log Aij (2) where Si and Sj indicate different values that Y can take and SY indicates the total possible number of values that Y can take; one is the indicator function. As previously mentioned, in our case, we made a binary assumption for variables, so they can take values of zero and one. The optimization problem for maximizing the log-likelihood is: max Al(A)subject to |SY| ∑ i=1 Ai,j=1 for j=1...|SY|,Aij ≥0 for i,j=1...|SY|(3) The above optimization can be solved in closed form using the method of Lagrangian multipliers to obtain: ˆ Aij =∑T t=11{Yt=Si∧Yt−1=Sj} ∑T t=11{Yt−1=Sj}(4) Games 2016,7, 15 7 of 27 For each target, we find a similar transition matrix. For all other models in this section, the same procedure for deriving the transition matrix is used. The model shown in Figure 3b includes the number of crimes at all other targets. This approach can be described with the following mathematical function: Yn,t+1=f(Y1:n,t). 4.1.2. Defender Allocation Predicts Crime In the second approach, we study the prediction of the crime based on the defender allocation. Four cases are studied: in Figure 3c, Yn,t+1=f(Dn,t+1) , which means the effect of the defender at the same target and time step is considered; in Figure 3d, Yn,t+1=f(Dn,t) , which means the defender allocation at the previous step is considered; in Figure 3e, Yn,t+1=f(Dn,t , Dn,t+1) , which means the defender allocation in both the current and previous time step is considered; in Figure 3f, Yn,t+1=f(D1:n,t , Dn,t+1) , meaning the defender allocation at all other targets from the previous time step and the defender allocation from the current time is considered. The same procedure as the previous subsection is used to find the transition matrix for the above models. 4.1.3. Crime and Defender Allocation Predicts Crime In this sub-section, we study the effect of crime and defender distribution jointly and investigate whether this combination improves the prediction. In Figure 3g, Yn,t+1=f(Dn,t+1 , Yn,t) , which means that the distribution of the crime at the previous step and the defender allocation at the current step is considered; in Figure 3h, Yn,t+1=f(Dn,t , Yn,t) ; this has a similar structure as the previous one, except that it considers the defender allocation at the previous time step; in Figure 3i, Yn,t+1=f(Dn,t , Dn,t+1 , Yn,t) , that is the crime at that specific target is considered in addition to the defender allocation at the previous and current step. 4.2. Dynamic Bayesian Network Models (DBNM) The second approach is based on the Dynamic Bayesian Network (DBN) model. A DBN is proposed in order to learn the criminals’ behavior, i.e., how the criminals pick targets and how likely are they to commit a crime at that target. This behavior is in part affected by the defenders’ patrol allocation. In this section, we assume that criminals are homogeneous, i.e., all criminals behave in the same manner. In every time step of the DBN, we capture the following actions: the defender assigns patrol officers to protect N patrol areas, and criminals react to the defenders’ allocation strategy by committing crimes opportunistically. Across time steps, the criminal can move from any target to any other, since a time step is long enough to allow such a move. From a game-theoretic perspective, the criminals’ payoff is influenced by the attractiveness of targets and the number of officers that are present. These payoffs drive the behavior of the criminals. However, rather than model the payoffs and potential bounded rationality of the criminals, we directly learn the criminal behavior as modeled in the DBN. The DBN is shown in Figure 4: squares are observed states, where N white squares represent input states (number of defenders at each target) and N black squares represent output states (number of crime at each target), while N circles (number of criminals at each target) are hidden states. For ease of exposition, we use C to denote the largest value that any state can take. Next, we introduce the various parameters of this DBN. Games 2016,7, 15 8 of 27 Figure 4. The Dynamic Bayesian Network (DBN) for games. 4.2.1. DBN Parameters First, we introduce parameters that measure the size of the problem: •N: Total number of targets in the graph. •T: Total time steps of the training data. Next, we introduce random variables for the observed state (input defender distribution and output crime distribution in our case) and the hidden state. We use three random variables to represent the global state for defenders, criminals and crimes at all targets. •dt : Defender’s allocation strategy at step t : the number of defenders at each target in step t with CNpossible values. •xt: Criminals’ distribution at step twith CNpossible values. •yt: Crime distribution at step twith CNpossible values. Next, we introduce the unknown parameters that we wish to learn. •π: Initial criminal distribution: probability distribution of x1. •A (movement matrix): The matrix that decides how xt evolves over time. Formally, A(dt,xt,xt+1) = P(xt+1|dt,xt) . Given the CN values for each argument of A , representing A requires CN×CN×CNparameters. •B (crime matrix): The matrix that decides how criminals commit crime. Formally, B(dt,xt,yt) = P(yt|dt,xt) . Given the CN values for each argument of B , representing B requires CN×CN×CNparameters. Next, we introduce variables that are used in the EM algorithm itself. These variables stand for specific probabilities as illustrated below. We use dj i(yj i) as shorthand for di, . . . , dj(yi, . . . , yj): •Forward prob.: α(k,t) = P(yt 1,xt=k|dt 1). •Backward prob.: β(k,t) = P(yT t+1|xt=k,dT t+1). •Total prob.: γ:γ(k,t) = P(xt=k|yT 1,dT 1). •Two-step prob.: ξ(k,l,t) = P(xt=k,xt+1=l|yT 1,dT 1). We can apply the EM algorithm to learn the unknown initial criminal distribution π , movement matrix A and output matrix B . However, EM applied to the basic DBN model above results in practical problems that we discuss in the next section. Games 2016,7, 15 15 of 27 observes and figures out that the defender strategy has changed. Thus, the optimal strategy planned using the learned parameters is no longer optimal after some time of deployment of this strategy, as the parameters themselves change in response to the deployed strategy. To address the problem above, we propose an online planning mechanism. In this mechanism, we update the criminal’s model based on real-time crime/patrol data and dynamically plan our allocation strategy. The first step is to use the initial training set to learn an initial model. Next, we use a planning algorithm to generate a strategy for the next Tu steps. After executing this strategy, we can collect more crime data and use them to update the model with the original training data. By iteratively doing this, we generate strategies for the whole horizon of T steps. Algorithm 1presents the details of this mechanism. Algorithm 1 Online planning (Train_data,Tu,T). 1: A,B,π←Learn(Train_data) 2: t=0 3: while t<Tdo 4: [D1, ..., DTu]←Plan(A,B,π) 5: [Y1, ...,YTu]←Execute{D1, ..., DTu} 6: Train_data ←Train_data ∪ {D1,Y1, ..., DTu,YTu} 7: A,B,π←Update(Train_data,A,B,π) 8: t=t+Tu 9: end while Compared to simply applying the planning algorithm for T steps, our online planning mechanism updates the criminals’ behavior model periodically based on their response to the currently-deployed strategy. In this online planning mechanism, three parts are needed: learning algorithm, updating algorithm and planning algorithm. For the learning and updating algorithms, we apply the EMC 2 learning algorithm from Section 5. In addition, we also need a planning algorithm, which we discuss next. 5.1. Planning Algorithms 5.1.1. The Planning Problem In the planning problem, the criminals’ behavior is known or, more specifically, we already know the criminals’ initial distribution π , movement matrix A and crime matrix B in the DBN model. Given a pure defender patrol allocation strategy for Tu steps, we can plug those values for the input state into the DBN and get the expected number of crimes in Tu steps. The goal of planning is to find the defenders’ pure strategy that optimizes the defenders’ utility, which in our case is to minimize the total expected number of crimes (in our framing, any randomized strategy, which is the combination of pure strategies, results in a greater number of crimes than the optimal pure strategy). Thus, planning against opportunistic criminals is a search problem in the defender’s pure strategy space. First, we present the practical impossibility of a brute force search. 5.1.2. Brute Force Search A naive way to solve this problem is to try all possible allocation strategies and to pick the one that leads to the least crimes in Tu steps. However, since at each step, the number of possible allocation strategies is CN and there are Tu steps in total, the strategy space is CNTu . For example, for our specific problem of patrolling in USC with five targets, two categories and the goal of planning for Tu= 300 steps, we need to search 21500 ≈10451 different strategies, which is impractical to solve. 5.1.3. Dynamic Opportunistic Game Search (DOGS) First, we list some notation that will be used in the next two planning algorithms. Games 2016,7, 15 16 of 27 •Dj t indicates the j -th strategy for the defender from the CN different defender strategies at time step t. •Pj,t is the total number of crimes corresponding to the optimal defender strategy for the first t time steps that has jas its final defender strategy. •Xj,t is the criminals’ location distribution corresponding to the optimal defender strategy for the first ttime steps that has jas its final defender strategy. •fY(Xt , D , B) is the expected number of crimes at all targets at t given the criminal location distribution Xtand defender’s allocation strategy Dat step tand output matrix B. •fX(A , Xt , Dt) is the criminal location distribution at step t+ 1 given the criminal location distribution Xtand defender’s allocation strategy Dtat tand transition matrix A. Algorithm 2 DOGS (A,B,π). 1: for each officer allocation Di 1do 2: Pa[i, 1]←0; Pi,1 ←fY(A,π,Di 1);Xi,1 ←π 3: end for 4: for t←2, 3,..., Tudo 5: for each officer allocation Dj tdo 6: F(i) = fY(fX(A,Xi,t−1,Di t−1),Dj t,B) + Pi,t−1 7: Pa[Dj t,t]←argmini[F(i)];Pj,t←mini[F(i)] 8: Xj,t←fX(A,XPa[Dj t,t],t−1,DPa[Dj t,t] t−1) 9: end for 10: end for 11: index[T]←argminiPi,T;b D[T]←Dindex[T] T 12: for t←T−1, ...,1 do 13: index[t]←Pa[Dindex[t+1] t,t+1] 14: b D[t]←Dindex[t] t 15: end for 16: return b D DOGS is a dynamic programming algorithm; hence, in order to find the optimal strategy for t steps, we first find the optimal strategy for the sub-problem with t− 1 steps and use it to build the optimal strategy for t steps. Given the values of π , A and B from our learning step, the optimal defender allocation strategy D1,..., DTuis given by the recurrence relations: Pj,1 =fY(π,Dj 1,B)Pj,t=min i[fY(fX(A,Xi,t−1,Di t−1),Dj t,B) + Pi,t−1](25) Retrieving the optimal allocation strategy requires remembering the allocation Di t−1 that minimizes the second equation, which is done by storing that information in the function Pa , as follows: Pa[j,t] = argmin i[fY(fX(A,Xi,t−1,Di t−1),Dj t,B) + Pi,t−1](26) As Pj,Tu is the total number of crimes for the optimal defender strategies for Tu time steps that has j as the final strategy, the optimum strategy for time step Tu is given by DTu=argminjPj,Tu . Then, recursively, given optimal Dt , we find the optimal strategy in the previous time step using function Pa:Dt−1=Pa[Dt,t]. The complexity of the DOGS algorithm (Algorithm 2) is O(C2NTu). 5.1.4. Greedy Search The dynamic programming-based algorithm can generate the optimal strategy, but takes time O(C2NTu) . We present a greedy algorithm that runs in O(CNTu) time, but the solution may be Games 2016,7, 15 17 of 27 sub-optimal. In the greedy search, we split the strategy space into Tu slices. Each slice represents the strategy at each step. Then, instead of searching the optimal strategy for Tu steps, we only look one step ahead to search for the strategy that optimizes the defender’s utility at the current step (Algorithm 3). It finds the optimal patrol allocation Dt at the current step by minimizing the expected number of crimes at all targets at step t . For the next step, we compute the criminal’s distribution Xt+1 and greedily search again. We keep iterating this process until we reach the Tu step. The complexity of greedy search is O(CNTu). Algorithm 3 Greedy (A,B,π=X1). 1: for t←1, . . . , Tudo 2: Dt←argminDfY(Xt,D,B);Xt+1←fX(A,Xt,Dt) 3: end for 4: return D= [D1,..., DTu] 6. Experimental Results 6.1. Experimental Setup All of our experiments were performed on a machine with 2.4 GHz and 16 GB RAM. MATLAB was our choice of programming language. There are two threads of experiments, one on learning and the other on learning and planning. To avoid leaking confidential information of the USC Department of Public Safety, all of the crime numbers shown in the results are normalized. 6.2. Learning (Setting) Our first experiment is on evaluating the performance of the EMC 2 algorithm in learning criminals’ behavior. We use the case study of USC in our experiments. We obtained three years of crime reports and the corresponding patrol schedule followed at USC. Since the EMC 2 algorithm and the EM algorithm only reach the locally optimal solution, we run the algorithms for 30 different randomly-chosen start points and choose the best solution from among these runs. These start points, i.e., the values of A , B and π , are generated by sampling values from a uniform random distribution over [ 0, 1 ] for all of the elements and then normalizing the probabilities so that they satisfy the initial conditions. Cis set to two by default, while the effect of varying Cis compared in Figure 5e. 1 2 3 4 0.4 0.6 0.8 1 1.2 date of training data Number of crime Real EMC2 EM MC (a) Total number of crime 1 2 3 4 0.1 0.3 0.5 0.7 date of training data Accuracy EMC2 EM MC Random (b) Individual accuracy 30 270 1100 0.1 0.2 0.3 0.4 0.5 0.6 0.7 number of training data Accuracy EMC2 EM MC Random (c) Vary data 30 270 1100 0 2 4 6 8 10 number of training data log(Runtime)(s) EMC2 EM MC (d) Vary data (runtime) 234 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 C Accuracy EMC2 EM MC Random (e) Vary C 1 2 3 4 0 0.2 0.4 0.6 0.8 1 date of training data Total number of crime DOGS Real Real−E (f) Compare with real 2 4 10 0.4 0.6 0.8 1 iterating time Total number of crime DOGS Greedy Plan Random Worst (g) Vary Tu 2 4 10 0 100 200 300 400 iterating time Runtime(s) DOGS Greedy Plan (h) Vary Tu(Runtime) Figure 5. Experimental results. Games 2016,7, 15 18 of 27 The results shown in Figure 5a compare the estimated numbers of crimes using different learning algorithms with the real number of crimes in one month. We divide the three-year data into four equal parts of nine months each. For each part, we train on the first eight months data and test on the ninth month’s data. That is why the estimated number of crimes for one month as the output by different learning algorithms is compared to the real number of crimes in that month. The x-axis in this figure indicates the index of the part of the data that we evaluate. The y-axis is the total number of crimes in the ninth month. The closer this number is to the real number of crimes, the better the prediction is. Three different algorithms are compared: (1) the Markov Chain (MC) algorithm, in which the best performance among all eight models is shown; (2) the exact EM algorithm; and (3) the EMC 2 algorithm. As can be seen, the prediction of EMC 2 is much closer compared to those of the EM and MC algorithms in all of the training groups. This indicates that the crime distribution is related to the criminals’ location, and including the number of criminals at each target as a hidden state helps to improve the performance. In addition, the EMC 2 algorithm achieves better performance than EM by reducing the number of unknown variables to avoid over-fitting. For Figure 5b, we measure the learning performance for each individual target using a metric that we call accuracy. To define this metric, let nit be the actual number of crimes at target i for time step t ; let n0 it be the predicted number of crimes at target i at time step t . Then, accuracy at step t is the probability of the event ∑N i=1|nit −n0 it| ≤ 1. In other words, it is the probability that we make less than one mistake in predicting crimes for all N targets. The reported accuracy is the average accuracy over all t . In Figure 5b, the y-axis represents the accuracy. The higher accuracy is, the more accurate our prediction is. We compare four different algorithms: the MC, EM and EMC 2 algorithms and the uniform random algorithm, which sets equal probability for all possible numbers of crimes at each target. As expected, EMC 2 outperforms all other algorithms in all training groups. In addition, even though the accuracy of the algorithms varies in different training groups, which we attribute to the noisy nature of the data in the field, the largest difference is within 15%. This indicates that accuracy of the algorithms is data-independent. We present additional results under this setting in Figure 5c,d. We compare the four approaches for varying the size of training data; thus, the x-axis in both figures shows the number of training data (in days of data) used in learning. Our test data are all of the data points from a 30-day period, and the training data are the data points just before (in order of time) the test data points. For Figure 5c, the EMC 2 algorithm again outperforms all other algorithms for any number of training data in accuracy. In addition, the more data we have for training, the better accuracy we achieve. In Figure 5d, the y-axis shows the runtime in seconds on a log scale. The more data we have, the longer it takes for each training method. The random algorithm is pre-generated and takes almost no time; hence, those data are not shown in the figure; the runtime for MC is negligible because the number of states is small ( O( 4 N) ), and we traverse all of the data points only once; the runtime for the EMC 2 algorithm is significantly better than that for the EM algorithm, as is expected by our complexity analysis in Section 5. In Figure 5e, we compare the four approaches by varying C . The x-axis shows the value of C . We use 1100 data points for training, while 30 data points, which are just after the training data points, are used for testing. The accuracy decreases as C increases. This is because when C increases, there are more possible values of the number of crimes. Thus, the possibility of predicting an accurate number decreases. However, when C increases from three to four, the decrease in accuracy is small in EMC 2 due to the fact that data with a value of four rarely appear in both the crime and patrol dataset. This indicates that a small C is a good approximation. In addition, the EMC 2 algorithm again outperforms all other algorithms for any C. In Figure 6, all of the Markov chain models are compared. The x-axis is the model index. RP represents the uniform Random Predicting. M 1 through M 9 are the nine Markov chain models in Figure 3. The y-axis represents the accuracy. We use four sets of data that are the same as Figure 5b to test the performance. All of the Markov chain models give similar to accuracy, which outperforms RP Games 2016,7, 15 19 of 27 significantly. However, as shown in Figure 5b, all of these models are outperformed by the EM and EMC2algorithms. RP M1 M2 M3 M4 M5 M6 M7 M8 M9 0 0.1 0.2 0.3 0.4 Model Index Accuracy (1−distance) Set 1 Set 2 Set 3 Set 4 Figure 6. Markov chain models. 6.3. Learning and Planning (Real-World Data) Figure 5f compares DOGS to the actual deployed allocation strategy generated by DPS experts at USC. Similar to the settings in Figure 5a, we divide the three-year data into four equal parts of nine months. For each part, we train on the first eight months’s data using the EMC 2 algorithm and test different allocation strategies on the first 10 days of the ninth month’s data. When testing the strategy, we assume the criminals’ behavior remains unchanged during these 10 days. Three different scenarios are compared: (1) the real number of crimes, shown as real in Figure 5f; (2) the expected number of crimes with the DPS strategy and learned criminal behavior, shown as real-E; and (3) the expected numbers of crime with DOGS allocation and learned criminal behavior, shown as DOGS. As shown in Figure 5f, the expected number of crimes with the DPS strategy is close to the real number of crimes, which indicates that EMC 2 captures the main features of the criminal behavior and provides a close estimate of the number of crimes. In addition, the DOGS algorithm outperforms the strategy generated by domain experts significantly. This demonstrates the effectiveness of the DOGS algorithm as compared to the current patrol strategy. By using the allocation strategy generated by DOGS, the total crime number reduces by ∼50% as compared to the currently-deployed strategy. 6.4. Learning and Planning (Simulated Data) Next, we evaluate the performance of our online planning mechanism. We use simulations for this evaluation. In the simulation, the criminal model is simulated using the model from an earlier work on opportunistic criminals [ 2 ], in which the authors explicitly model an opportunistic criminal’s behavior. However, the defender does not know the type of criminals in our experiments. Instead, the defender starts by executing a random patrol schedule for 300 steps and collects the corresponding crime report, which they use to learn an initial criminal behavior model. The criminal responds to the defenders’ patrol schedule as predicted by the behavior model in [ 2 ]. Since the criminal behavior in [ 2 ] is probabilistic, we run the experiment 30 times, and each data point we report in this part is an average over these 30 instances. We fix the number of patrol officers to 2 N− 2, where N is the number of targets. This number is consistent with our real dataset numbers (eight officers for five targets), where there were enough officers to allocate one officer to each target, but not enough to allocate two officers to each target. We use the EMC2algorithm as the learning algorithm. Games 2016,7, 15 20 of 27 6.5. Learning and Planning Results Figure 5g to Figure 7present the results from our experiments about the online learning and planning mechanism. The four planning mechanisms that we consider are as follows: first, a random planning mechanism that randomly generates the allocation strategy with limited resources; second, a pure planning mechanism, where we learn the criminal behavior model once and apply this model to plan for the entire horizon T using the DOGS algorithm; third, an online planning mechanism with a greedy planning algorithm that updates every Tu time steps; and the last mechanism is the online planning mechanism with the DOGS algorithm that also updates every Tutime steps. 456 0.2 0.4 0.6 0.8 1 Number of targets Total number of crime DOGS Greedy Plan Figure 7. Varying N. In Figure 5g, the total planning horizon T is set to 600. In addition to the four planning mechanisms, we also consider the worst case where the defender always protects the least valuable targets. The x-axis shows the update interval Tu , which is the time interval after which we update the criminals’ behavior model. The y-axis is the expected number of crimes that happen under the deployed allocation strategy within 600 steps. The expected number of crimes under the pure planning mechanism stays the same with different Tu , because it does not update the criminals’ model at all. For the online mechanisms, the expected number of crimes increases as the update interval Tu increases. This is because with infrequent updates of the criminals’ behavior model, we cannot keep up with the real criminals’ behavior. In addition, with any size of the update interval, the DOGS algorithm outperforms the greedy algorithm. In Figure 5h, we present the runtime of three mechanisms for the same experiment. We do not show the runtime for the random planning mechanism, as it is small and the same for any planning horizon T . The runtime decreases as the update interval Tu increases. There is a runtime-quality trade-off in choosing Tu . Figure 7shows the performance of the four planning mechanisms, but with different numbers of targets in the model. The x-axis is the number of targets in the graph, and the y-axis is the expected number of crimes under the deployed strategy. We set T=600, Tu=2. The results here are similar to the results of Figure 5g. These results lead us to conclude that online mechanisms outperform the baseline planning mechanisms significantly in any settings. For the online mechanisms, DOGS achieves better performance, while the greedy planning algorithm requires less runtime. Thus, based on the specific problem being solved, the appropriate algorithm must be chosen judiciously. 7. Real World Implementation In this section, we introduce web-based software with two contributions. First, our system collects and analyzes crime reports and resources (security camera, emergency supplies, etc.) data, presenting them in various forms. Second, our patrol scheduler incorporates the learning and planning Games 2016,7, 15 21 of 27 algorithm we proposed before in a scheduling recommendation system. The software is currently under deployment and testing at the USC campus in Los Angeles, USA. 7.1. Multi-User Software Our multi-user web-based software is built for the Department of Public Safety at the University of Southern California. It is composed of two main components: a data collector and a patrol scheduler. A detailed demonstration of our software can be found here (https://dl.dropboxusercontent.com/u/ 40377044/aamas_demo.pptx). 7.1.1. Data Collector The data collector receives crime data from the police department and presents and analyzes them in various fashions. There are three main tasks of the data collector: First, it visualizes crime data with spatial and temporal information, as shown in Figure 8a, to help officers analyze the trend of crimes around campus. As shown in Figure 8b, ‘hot’ areas indicate attractive targets for criminals to commit crimes. As of now, the police department can cool down these hot spots by increasing patrol coverage when assigning officers in the field. However, with our planning approach, the police allocation will be more intelligent. As we also learn how criminals move in response to patrols, our approach does not simply cover the hot spots, but also allocates officers to areas where criminals are expected to move. Second, the data collector provides information to the officers in the field about various available resources, such as emergency supplies and security cameras. As shown in Figure 8c, our software indicates the location for all of the emergency supplies on campus. Figure 8d shows the (mock) location of security cameras. To check certain locations, officers can use our software to watch the video from any camera. Finally, the data collector provides input for the patrol scheduler. By reading the data from the collector, the patrol scheduler can continuously learn and update criminals’ behavior. (a) Crime analysis (b) Hot spot analysis (c) Emergency supply (d) Security cameras Figure 8. Data collector. 7.1.2. Patrol Scheduler Patrol settings : At USC, our approach further divides the enforcement area (encompassing the campus) into 18 patrol areas, which are shown in Figure 9. DPS patrols would be in shifts of 4 h each. At the beginning of each patrol shift, our algorithm assigns each available patrol officer to a patrol area, and the officer patrols this area in this shift. Games 2016,7, 15 22 of 27 Figure 9. Patrol area. Schedule generator : As part of the integration of our learning and planning with the software, we show the use of the EMC 2 algorithm to learn the criminals’ behavior from previous crime and patrol data and the DOGS algorithm to generate patrol schedules for DPS officers. We highlight the recommended patrol area on the campus map, as shown in Figure 10. Figure 10. Sample patrol schedule. 8. Conclusions and Future Work This paper introduces a novel framework to design patrol allocation against adaptive opportunistic criminals. First, we use Markov chain and DBN to model the interaction between officers and adaptive opportunistic criminals. Next, we propose a sequence of modifications to the basic DBN resulting in a compact model that enables better learning accuracy and running time. Finally, we present an iterative learning and planning mechanism with two planning algorithms to keep pace with adaptive opportunistic criminals. Experimental validation with real-world data Games 2016,7, 15 23 of 27 supports our choice of model and assumptions. Further, our modeling assumptions were informed by inputs from our collaborators in the DPS at USC. We project a ∼ 50% reduction in the crime rate using our approach as opposed to the current approach followed by DPS. In terms of future work, we would like to capture other patterns of crime using our Markov chain and DBN, such as how crime is influenced by the time of day, day of the week, season or domain factors, such whether or not USC classes are in session or whether it is football season, and other such factors. Another line of future work would be to do a sensitivity analysis of our results by considering various divisions of the three-year real-world data available at USC. Currently, we divide the dataset into four sets of nine months each. However, comparisons and analysis of the results based on three divisions of 12 months each or other divisions based on seasons and other factors would be an interesting line of future research. Acknowledgments: This research is supported by MURI grant W911NF-11-1-0332. We thank Armorway. Inc. for helping generate the software. Author Contributions: Chao Zhang, Shahrzad Gholami, Debarun Kar, Arunesh Sinha and Milind Tambe contributed to the design of the model, ran the experiment, interpreted results and wrote the manuscript. Manish Jain and Ripple Goyal contributed to generating the multi-user software. Conflicts of Interest: The authors declare no conflict of interest. Appendix A Appendix A.1. EMC2Procedure Initialization Step Example 1. A simple way to do the initialization is to use the uniform distribution, which is: π(0, 1) = 0.5, π(1, 1) = 0.5, π(0, 2) = 0.5, π(1, 2) = 0.5; A(1, 1, 0, 1, 0) = 0.5, A(1, 1, 0, 1, 1) = 0.5, A(1, 1, 0, 2, 0) = 0.5, A(1, 1, 0, 2, 1) = 0.5; ... A(2, 2, 1, 1, 0) = 0.5, A(2, 2, 1, 1, 1) = 0.5, A(2, 2, 1, 2, 0) = 0.5, A(2, 2, 1, 2, 1) = 0.5; B(1, 1, 1, 0) = 0.5, B(1, 1, 1, 1) = 0.5, B(1, 1, 2, 0) = 0.5, B(1, 1, 2, 1) = 0.5; ... B(2, 2, 0, 0) = 0.5, B(2, 2, 0, 1) = 0.5, B(2, 2, 1, 0) = 0.5, B(2, 2, 1, 1) = 0.5; Appendix A.2. EMC2Procedure Expectation Step Forward probability: First, we calculate P(Y1,Y2, ..., Yt−1,Xi,t|D1,D2, ..., Dt−1)using α(m,k,t−1): Games 2016,7, 15 24 of 27 P(Y1,Y2, ..., Yt−1,Xi,t|D1,D2, ..., Dt−1) = ∑ Xt−1 P(Y1,Y2, ..., Yt−1,Xt−1,Xi,t|D1,D2, ..., Dt−1) =∑ Xt−1 P(Y1,Y2, ..., Yt−1|Xi,t,Xt−1,D1,D2, ..., Dt−1)P(Xi,t|Xt−1,Dt−1)P(Xt−1) =∑ Xt−1 P(Y1,Y2, ..., Yt−1|Xt−1,D1,D2, ..., Dt−1)P(Xi,t|Xt−1,Dt−1)P(Xt−1) =∑ Xt−1 P(Y1,Y2, ..., Yt−1,Xt−1,D1,D2, ..., Dt−1)P(Xi,t|Xt−1,Dt−1) i f Xi,t=0 =∑ Xt−1 ∏ m α(m,Xm,t−1,t−1)∏ m P(Xi,t=0|Xm,t−1,Dm,t−1) =∏ m ∑ Xm,t−1 α(m,Xm,t−1,t−1)P(Xi,t=0|Xm,t−1,Dm,t−1) i f Xi,t=1 =∑ Xt−1 ∏ m α(m,Xm,t−1,t−1)[∏ m ∑ xi,t P(Xi,t=xi,t|Xm,t−1,Dm,t−1)−∏ m P(Xi,t=0|Xm,t−1,Dm,t−1)] =∏ m ∑ Xm,t−1 α(m,Xm,t−1,t−1)∑ xi,t P(Xi,t=xi,t|Xm,t−1,Dm,t−1) −∏ m ∑ Xm,t−1 α(m,Xm,t−1,t−1)P(Xi,t=0|Xm,t−1,Dm,t−1) The complexity is this step is O(N2) to calculate the whole intermediate vector. Next, we calculate α(i,k,t)using P(Y1,Y2, ..., Yt−1,Xi,t|D1,D2, ..., Dt−1). α(i,k,t) = P(Y1,Y2, ..., Yt,Xi,t=k|D1,D2, ..., Dt) =∑ Xt:Xi,t=k P(Y1,Y2, ..., Yt,Xt|D1,D2, ..., Dt) =∑ Xt:Xi,t=k P(Y1,Y2, ..., Yt|Xt,D1,D2, ..., Dt)P(Xt|D1,D2, ..., Dt) =∑ Xt:Xi,t=k P(Y1,Y2, ..., Yt−1|Xt,D1,D2, ..., Dt)P(Yt|Xt,D1,D2, ..., Dt)P(Xt|D1,D2, ..., Dt) =∑ Xt:Xi,t=k P(Y1,Y2, ..., Yt−1|Xt,D1,D2, ..., Dt)P(Yt|Xt,D1,D2, ..., Dt)P(Xt|D1,D2, ..., Dt) =∑ Xt:Xi,t=k P(Y1,Y2, ..., Yt−1,Xt|D1,D2, ..., Dt−1)P(Yt|Xt,Dt) =∑ Xt:Xi,t=k ∏ j P(Y1,Y2, ..., Yt−1,Xj,t|D1,D2, ..., Dt−1)∏ j P(Yj,t|Xj,t,Dj,t) =∏ j6=i ∑ Xj,t P(Y1,Y2, ..., Yt−1,Xj,t|D1,D2, ..., Dt−1)P(Yj,t|Xj,t,Dj,t) ·P(Y1,Y2, ..., Yt−1,Xi,t=k|D1,D2, ..., Dt−1)P(Yi,t|Xi,t=k,Di,t) The complexity to calculate each element is O(N), and the total complexity is still O(N2).