Lin - Using Machine Learning To Assist Crime Prevention
Lin - Using Machine Learning To Assist Crime Prevention
Abstract—Drug-related criminal activity is gradually rising month, following month, last year, grids surrounded eight-
in Taiwan and has a significant and negative social impact. direction in the current month, grids surrounded eight-direction
This paper proposes a data-driven method based on “broken last year, tendency, proportion.
windows” theory and spatial analysis to analyze crime data After calculating the value for each feature in the grids, we
using machine mining algorithms and thus predict emerging set drug crime for the following month as the dependent
crime hotspots for additional police attention. variable. We want to predict crime hotspots for the following
The Deep Learning algorithm has been widely applied in month, which are thus not in the same temporal environment.
several fields, include image recognition and natural language Empty grids are removed to prevent model performance
processing. With fine tuning, we find the Deep Learning degradation. For the different time scales, we design 7 sets of
algorithm provides better prediction results than other accumulated data over 1, 3, 6, 9,12, 15, and 18 months.
methods including Random Forest, and Naïve Bayes for We next prepared the data frames to train the models.
potential crime hotspots. Furthermore, we improve model Experiments were run using different algorithms (Deep
performance by accumulating data with different time scales. Learning, Random Forest, and Naïve Bayes) to compare
To validate experimental results, we visualize potential crime prediction results against the proposed method. Naïve Bayes is
hotspots on a map, and observe whether the models can
a simple algorithm based on Bayes’ theorem. Random Forest is
identify true hotspots. Finally, we discuss the applicability of
this method, and present future research directions.
an ensemble algorithm based on decision trees. Deep Learning
is a more recently developed algorithm which provides
Keywords—Crime prevention; Machine learning; Spatial outstanding performance in several fields, include image
analysis recognition and natural language processing Deep Learning
I. INTRODUCTION operates using Artificial Neural Networks and thus benefits
Drug-related crime is gradually increasing in Taiwan, and from improved computing capability to perform more complex
the police require more powerful tools to combat and prevent calculations and improve model tuning.
such crimes. Traditional approaches are highly dependent on Fig. 1. Spatial-temporal analysis workflow.
the experience of senior police officers, which presents
challenges for generalizing methods and information. Junior
police officers lack sufficient experience to identify potential Step 1
crime hotspots, thus losing opportunities to prevent crime. Step 2
Step 3 & 4
g1 1
g2
We present a data-driven method based on “broken g1
windows” theory and spatial analysis. Broken windows theory g3 g4
g4
posits that failure to respond to low level criminal activity in an
area will lead to more serious crimes. Based on this theory, we
design a model that predicts the incidence of drug-related
crime in the following month based on incidence of drug-
related crime, fraud, assault, intimidation, auto theft, and Step 1: Split the map Mġby grids gn,ġMġľ焊g1ĭg2ĭg3ĭɃĭgn焌.
burglary in the current month. Accordingly, we can extend the Step 2: Each grid g has the features fn , gġľ焊f1ĭf2ĭf3ĭɃĭfn焌, and calculate
model with its spatial-temporal characteristics. Let each grid the value of each feature in the grid.
which splitting from the map regard as a sample, and Step 3: Drug-related crimes which will happen in the following month are
accumulates samples in the same time scale to construct denoted as Y.
matrices. Each matrix represents different spatial-temporal If no drug-related crime occurs in the grid, the grid is a coldspot, and
Y = 0.
status, thus, we can use the matrix to train and test by machine Otherwise, the grid is a hotspot, and Y =ġ1.
learning algorithms. Step 4: If the sum of the grid is zero, it’s an empty grid that should be
II. METHOD removed.
As shown by the workflow in Fig. 1, we spilt the map into
grids, at different scales: 500m*500m (10,843 cells), Finally, we evaluated model performance in terms of
750m*750m (4,877 cells) and 1000m*1000m (2,817 cells). We accuracy, precision, recall and f-measure. We want to find the
then combined 56 features with eight different types of crime high accuracy and high f-measure results. Accuracy refers to
and seven different spatial-temporal patterns including current how correctly the model predicts hotspots and coldspots
1030
1027