Comparison of Machine Learning Algorithms for Crime Prediction in Dubai

—This study aims to find the most accurate algorithm that is capable of predicting crimes in Dubai. It compares models on a dataset of sample crimes in the Emirate of Dubai, United Arab Emirates using the open-source data mining software WEKA, which enabled us to use Random Forest, KNN, SVM, ANN, Naïve Bayes and Decision Tree, We chose those algorithms as former studies that were effective used them. We have applied the algorithms on a dataset containing 13440 Major Crime in four categories occurred between 2014 and 2018. After comparing the models and analyzing their success rates, we identified the ideal algorithms and evaluated the effectiveness of variables in making predictions by measuring the correlation coefficients. One of the study's most crucial recommendations is to increase the variables and data, also adding more details about the crime, the criminal, and the victim. These variables make an impact on the analysis and the ultimate prediction.


INTRODUCTION
The modern society in Dubai has gathered people from around all the world, more than 170 nationalities, estimated at 3,478,300 people in 2021 [1], Dubai is well known for the low crime rate [2], in Q3 of 2022, Dubai Police has reported 65% drop in the number of criminal reports at the General Department of Criminal Investigations (CID) quarterly appraisal meeting, which was presided over by Lieutenant General Abdullah Khalifa Al Marri, Commander-in-Chief of Dubai Police [3].
The rise in urban crime statistics has become a major concern for law enforcement agencies across the world.Machine learning algorithms have been progressively used to predict and prevent crime in recent years.We intend to compare the performance of various machine learning algorithms for crime prediction in Dubai in this applied scientific research.Crime is a pervasive, global social problem that lowers people's quality of life and slows economic growth [4].As it affects people's security, crime reduction remains one of the most important social issues in large metropolitan areas [5].
In order to reduce crime by predicting and preventing it, we must have a clear understanding of the current crime situation, which requires a crime data set that enables the use of machine learning.Predicting the future occurrence of crime is more possible today than ever before with digitalization and e-governance generating data that allows for effective analysis [6].
We hope to gain insights into the most effective methods for predicting and preventing crime in this city by analyzing and comparing the accuracy, precision, and recall of these algorithms.Some research claims that crime cannot be predicted, as predictions are never 100% accurate [7].Indeed, data is not always helpful in solving real world problems, but some scholars have succeeded in building models that helped to prevent crime [8].This suggests that the issue with prediction may sometimes be caused by using the wrong model.Predictive policing aims to identify areas that may be subject to crimes.This is supported by routine activity theory and rational choice theory.According to both theories, a crime occurs when a person who is willing to commit it has the chance to do so and these opportunities follow patterns in both location and time rather than being distributed randomly [9].This paper is structured as follows: Section II presents the main problem and motivation for the work.Section III presents work related to this research.Section IV describes the methodology.Section V presents the prediction models we use to analyze the data.Section VI presents our results, and Section VII summarizes our conclusions and related work.

II. PROBLEM AND MOTIVATION
There are no applied, academic studies open to students based on Dubai Crime Data as they due to the restrictions which keeps access to crime data internal and confidential.The current study makes significant contributions by attempting to fill multiple research gaps.
First, the study adds to the relatively limited research on crime prediction in the Arab world.Our study is one of the first to use prediction models on real data from a reliable source in the Arab region.
Second, ours is one of the few research projects that has used six prediction models to determine which provides the best outcome with greater understanding and insight into the data used.
Third, to the best of the author's knowledge (based on a search of peer-reviewed databases), no previous study has compared machine learning algorithms on crime prediction in Dubai in an applied academic setting.

A. Dataset
The crime data used in this study is confidential data individually supplied to the research team by the Dubai Police.The only publicly available crime data in Dubai are the total published by the Dubai Police, which would be insufficient for the completion of the present study [16].This restricted and non-georeferenced dataset consists of a spread sheet that contains data compiled by the police, as shown in Table I, containing the date, the hour, the typology, used tool, the technique used, and the area of the crime, as well as the age, nationality, status and education level of the criminal for all reported crimes occurring inside the city limits between January 2014 and December 2018, amounting to approximately 52 thousand entries.

B. Pearson Correlation Coefficient
Pearson correlation coefficient; descriptive statistic; indicates relationship (extent of linear correlation) between two continuous variables; the better comparable the data resulting from two different methods are (i.e. the closer the correlation is) the more the r value approaches the value 1, whereby 0 represents no correlation, −1 a perfect inverse correlation (negatively sloping line) and +1 a perfect positive correlation [34].
We calculated the correlation coefficient value in order to determine how strong the association between the factors.

The correlation coefficient can be understood as follows:
 There is absolutely no association when the correlation coefficient is 0. It implies that the variables have a fully unfavorable connection.There is no association if the correlation coefficient is zero.
 If the correlation coefficient is 1, a significant positive correlation is demonstrated.It implies that the variables have their optimal positive correlation.
 A correlation coefficient with a larger absolute value denotes a stronger link between the variables.www.ijacsa.thesai.org We applied Pearson correlation in the crime dataset using Weka by selecting the attribute ranking using correlation Attribute Eval.Here are the outcomes we obtained: In the Table II, we notice the most significant attribute affect for crime type is nationality with a weight = 0.105.The second largest attribute is time with a weight = 0.099.The third largest attribute is date with a weight = 0.076.The fourth largest attribute is status with weight 0.062.Next is sex, with a weight of = 0.050.Then police, with a weight of = 0.049.Finally, the last two attributes are education with a weight of = 0.031, and age with a weight of = 0.025.

C. Preprocessing
First, we selected four major crime typologies out of 10.The Major Crimes are categorized as: (Willful Murder, Aggravated Assault, Rape, Robbery, Theft, Abduction, Grand Auto Theft, Burglary, Drugs, Human Trafficking) due to the Non-disclosure Agreement we cannot declare which four categories we have chosen.We removed any crimes that had missing values due to missing data or compiling errors.This reduced the number of entries to 13,440.
To train and validate the data, the dataset is divided into various subsets with 10 folds in cross-validation, the training was on 70% and test was on 30%.

D. Evaluation Metrics 1) Accuracy:
The percentage of overall predictions that were correct.
2) Accuracy: ( ( TP + TN) / (TP + FP + TN + FN) ) * 100 3) Precision: Precision reveals the proportion of genuinely positive forecasts among all positive ones.The ratio of accurately positive predictions to all positive predictions is how it is defined.

V. PREDICTION MODELS
A. Random Forest During the training phase of the random forests or random decision forests ensemble learning approach (which is used for classification, regression, and other tasks), a large number of Decision Trees are built.For classification problems, the random forest output is the class that the majority of the trees choose.For regression tasks, the mean or average prediction of each individual tree is returned.Random decision forests correct Decision Trees' proclivity for overfitting their training dataset [18] [19] [20] [21].
The classifier used is Random Forest.

B. (The K-Nearest Neighbor's Algorithm) KNN
The K-Nearest-Neighbours (KNN) is a non-parametric classification method, which is simple but effective in many cases [22].KNN is a non-parametric classification algorithm, it works as a supervised learning algorithm.A labeled training dataset is provided where the data points are categorized into various classes, so that class of the unlabeled data can be predicted [23].
The classifier used in KNN is IBk.

C. Support-Vector Machines (SVM)
Support vector machines (SVMs) can be used to handle classification, regression, and outlier problems that are frequently encountered in supervised learning [24].
The mathematical pedigree of SVMs is the best of any statistical learning procedure.It was created as a classifier that maximizes a slightly different definition of a margin, resulting in a novel "hinge" loss function [25].Weka can classify objects using the support vector machines algorithm [26].

D. Artificial Neural Networks (ANNs)
Artificial Neural Networks can be defined as systems designed to model functions that simulate the human brain [27].They are increasingly being used to model complex, nonlinear phenomena [28].ANNs are nonlinear, adaptive information processing systems that are made up of many interconnected processing units.ANNs have functions such as associative memory, nonlinear mapping, classification www.ijacsa.thesai.orgrecognition, and optimization computation as an effective empirical modelling tool [29].
The classifier used in ANN is Multilayer Perception.

E. Naive Bayes
The naive Bayes classifier significantly simplify mastering through assuming that capabilities are impartial given class [30].Naive Bayes is a probability classification model that makes machine learning easier by performing calculations on datasets with the goal of predicting probabilities in a class under the assumption of strong independence.Classification is a type of directed learning [31].
The classifier used in Naive Bayes is Naive Bayes

F. Decision Tree
Decision tree is one of the popular predictive modelling approaches used in many areas including statistics, data mining and machine learning [32].Decision tree classifiers are regarded to be a standout of the most well-known methods to data classification representation of classifiers [33].
The classifier used in Decision Tree is J48 which is a Decision Tree classification algorithm based on Iterative Dichotomiser 3.

VI. RESULTS
We can summarize the results in Table III: In the preceding Table III and Fig. 2, we observe that Random Forest and KNN achieve the best results.KNN achieves the best results where accuracy = 78.474%,and F1 = 0.784.Next comes Random Forest with accuracy = 76.986%, and F1= 0.769.Decision Tree achieves good results with accuracy = 67.976%,and F1 = 0.678.SVM, Naïve Bayes, and ANN achieve low performance.SVM achieves accuracy = 54.58%, and F1 = 0.520.Then comes Naïve Bayes with low results of accuracy = 53.526%,and F1 = 0.511.Last comes ANN with the lowest results: accuracy = 51.093%, and F1 = 0.509.For time complexity, Random Forest, KNN, Naïve Bayes, and Decision Tree take seconds while SVM takes minutes.ANN takes more than two hours.

VII. CONCLUSIONS AND FUTURE WORK
This study compared several popular machine learning algorithms for use in crime prediction, including KNN, Random Forest, SVM, ANN, Nave Bayes, and Decision Tree.
Our findings show that these algorithms can provide useful insights into predicting crime patterns, with KNN having the highest overall accuracy (78.474%) and F1 scores.The performance of each algorithm, however, varied depending on the dataset and crime type being analyzed.
According to our findings, using machine learning for crime prediction has the potential to improve public safety and law enforcement efforts.However, it is critical to recognize the limitations and ethical concerns associated with the use of predictive algorithms in criminal justice systems.Because machine learning models are only as good as the data on which they are trained, it is critical to ensure that crime prediction datasets are diverse and representative of the population.Furthermore, it is critical to address potential biases and avoid discrimination when deploying these models.Also, by using the correlation, we discovered that adding more attributes, and detaching and elaborating the current data rather than grouping it into periods, may yield better results in the future.
Overall, our research highlights the potential and challenges of using machine learning to predict crime in Dubai.As the field develops, it will be critical to carefully evaluate and refine these algorithms to ensure their accuracy, fairness, and ethical implementation.

TABLE II .
RANKED ATTRIBUTES

TABLE III .
ALGORITHMS RESULTS