Sunteți pe pagina 1din 6

Safety App: Crime Prediction Using GIS

Sourab Banka*, Sean D’cruz*, Atharva Deshmukh*, Sana Shaikh*


Department of Computer Engineering
Don Bosco Institute of Technology, Mumbai, India.

Abstract is generally high while traveling[17]. In fact, 72% of


the criminal activities that take place in Mumbai
Crime in Mumbai has always been a concern for are due to avoiding the basic signs which could have
both the government authorities as well as the been prevented if there existed a system that could
citizens of Mumbai. With the increase in the help identify and distinguish between the safe and
unsafe areas in Mumbai.[11] This research model ob-
population, the crime rate has also been on an
serves and realizes after studying several criminal
increase which in turn increases the risk factor
cases that Mumbai has encountered, that citizens
for the safety of the citizens of Mumbai. To deal usually ignore the fact to be safe when it comes to
with this, the citizens should not only rely on reaching a destination on time or in haste, and keep-
the government authorities to cater the needs ing the same thing in mind our group aims to build
but at the same time, the citizens should also an application that helps citizens to distinguish and
understand and adapt with the applications of predict between safe and unsafe areas of Mumbai
technology in this very era of technology, to help while traveling.
provide better safety for all the citizens residing The analysis is achieved using multiple sources in-
in the dynamic city of Mumbai. Safety while cluding the web scrapping, official FIR reports and
traveling can be considered as the major need user ratings for every specific area on which ma-
chine learning is applied and then created a Training
in Mumbai, as Mumbai is regarded as the city
model based on the 240 official FIR reports and ad-
that never sleeps. There have been several at-
ditional user responses to help achieve an accurate
tempts made by the government authorities as safety index.
well as individuals to help provide a model for
better safety while traveling but still it has never
been completely automated. This research pro- Literature Survey
poses a model that works in synergy with vari-
ous steps that include crime data collection, and Nowadays, millions ofcitizensgo through the streets
then analysis on that data to predict the crime of Mumbai town, takingsome specific routes that
area unit planned by victimisation either public or
hotspots which are specifically targeted to help
non-public transportation or perhaps walking. Al-
citizens to distinguish between safe and unsafe
though there area unit well-known routes that voters
areas while traveling. most frequently regard their traveling, new routes
Keywords— Crime Prediction, Safety Route, (probably unsafe) could be experimented especial-
Web Scraping, Crowd-sourcing, Safety Android Ap- lyfor newcomers. particularly, safetyis a important
plication characteristic that ought to be thought of for these
mobile applications, especiallyin overcrowded giant
cities. Mobile applications for routing and plan-
Introduction ningin town environments are more and more turn-
ing into essential for rising urban areas. Thus, this
In contrary to common belief, crime isn’t continu- means the looks of the nextgeneration of mobile
ally focused in poor areas, with moneyed elements of info systems, during which recommendations area
the town affected too, therefore residents and guests unit centered on call makingin order to adequately-
would like info to avoid additional dangerous ele- support the growth of bigcities. Applications like
ments of the town. the concept is to form a reli- CrowdPlanner [1] and DroidOppPathFinder [2] area
able source of data instead of suppose episodic news unit self-addressed to come up with crowdsensed
reports that contribute to a way of hysteria. Our route recommendation systems, that request from
goal is to form what ar already in public offered users to guage candidate routes counseled by totally
statistics accessible and unjust for citizens. Unwary different sources and ways, for determiningthe best
citizens can make easy targets because they stand route supported the feedback of these users. The
out in a crowd, these citizens are usually unused to routesgenerated bythese applications area unit eval-
their surroundings, or are generally carrying money, uated by people; in our case the assessment is cre-
credit cards and valuables like mobile phones, cam- ated by a clump formula and bythe crime occur-
eras. Due to this, the risk of being mugged or robbed rence. Recently, an outsized vary of experimental
applications, that take into consideration the social the sort of an internet site with completely different
network and crowdsensed information, were devel- visual image of knowledge options. This Application
oped. In [4], a spatio- and crowd-based routingsys- can use advanced machine learning to predict crime
tem is projected so as to boost the recommendation rates within the city’s neighborhoods at completely
quality; but, it’s solely supported volunteered info different times of the day and night, the applying
and therefore the enrichment of the crime informa- are going to be ready to predict new patterns of
tion sources is not considered crime within the space with the assistance of incom-
Firoz Ahmad, Md Meraj Uddin, Laxmi ing new crime data set. The app are going to be
Goparaju[3] has analyzed the crime using a ready to assess the danger of crime in several ele-
vector file of geographic information system for ments of the town by finding patterns in incidents,
India country and different states of India country. locations and time, using advanced algorithms. It
Using this vector file they analyze crime from the will this by process GPS coordinates furthermore as
year 2001 to 2015 to learn the temporal pattern a particular time and date.
of crime happening in India. They shortlisted The app filters these sectors by their magnitude to
crimes such as Murder, dacoity, robbery, burglary, make separate models. We have a tendency to then
theft, and riots. The analysis was done using some weight the events by sector population and adjacent
proprietary as well as free software. Vector data sectors and periods before ultimately manufactur-
was downloaded from the open-source platform ing the world score. The score is that the relative
and Crimes data set was available on National likelihood of against the law in every sector and at
Crime Records Bureau, Ministry of Home Affairs, completely different times, and is summarised on a
India. They downloaded the crime data for 10 scale of 1 to 10, wherever one is low risk and 10 is
different cities that have high crime rates. Through high risk, in many areas of the town. The ultimate
this, we come to know Geo graphics information is output can turn out a simplified and color-coded risk
available on the DIVA-GIS platform[22]. Historical rating that users of the app will see on a map. The
crime data and its location were mapped together app shows 3 completely different classes of against
and also analyzed to come to learn the pattern the law risk, together with bad crimes like assault,
of criminal behavior near such as the location of rape, etc and theft mistreatment arms; medium risk
the police station, road network, shopping malls, crimes, like stealing, etc.
buildings, recreational center.[14]
Researcher, market analyzer or academicians
gather data from different websites for their better
improvement. Copping of data on the website to
user local storage in forbidden by most of the web-
site authority. So that the user want to manually
coping the data from website to local computer
file storage. But such a task is very exhausting
and time consuming. Due to such limitation web
internet scraping techniques area unit introduces.
By exploitation net scraping techniques user will
extract info obtainable on multiple web site into
a single database or spreadsheets. So data can be
easily visualize and analyse for further use. Web
scraping technique is a sub-discipline of web mining
technology.

Proposed Architecture
Data from numerous open sources like news, open
Data, or through user input or web scraping knowl-
edge from the web site are going to be keep within
the information Server. At that time feature choice Figure 1: System Architecture
are going to be done on knowledge accessible within
the information. Once feature selection is finished, The safe route will be obtained by the difference
knowledge cleansing are going to be performed on of the Dijkstra formula, within which the nodes
knowledge to get rid of vociferous knowledge and within the network square measure assigned as a
chemical agent. Knowledge having great circle and mean weight that was obtained from the number of
latitude are going to be premeditated on the QGIS crimes for a particular purpose or geographical area.
server. Finally, the Prediction algorithmic rule can The values which will be generated from the math-
work on the given knowledge that is plotted within ematician formula mirror the chance of getting or
the MAP.[10] The output are going to be a map not an occurrence like “theft/crime.” etc. Or we can
accessible for the user on android Application and use a additional advanced formula for locating the
additionally for Agencies it’ll be accessible within shortest path are Highway/Route Hierarchies, A*
Path Finding formula.[15] The design approach is VII. Testing the application: User will upload the
to retrieving data from various sources that are re- images and rate the parameter on scale from 1 to 5.
lated to crime events, taking into account attributes Firebase provides developers with several advan-
that define the time and location when an event oc- tages, and file transfer with storage is one in all
curs. These data are analyzed and integrated with them. Uploading pictures from your android ap-
crime data from official sources (government insti- plication needs you to figure with Activities and In-
tutions). The integration process is automatically tents.
performed by using descriptions and spatiotemporal The user of the application uploads images of a par-
attributes of data.[6] The categorization and clas- ticular area as should below in figure(2).
sifying are carried out analyzing the spatiotempo- 2. Web Scraping: Web scraping is a process of au-
ral attributes and the description of words that ap- tomating the extraction of data in an efficient and
pear in the data available through various sources fast way. With the help of web scraping, you can
and/or official database records. Thus all the cat- extract data from any website, no matter how large
egorizedand classified knowledge ar used as input is the data, on your computer. Scraping from dif-
parameters forthe safe routing algorithmic program. ferent news websites related to crime will be done.
the ultimate result’s a saferoute that doesn’t cross Important data from the news will be added to the
or contain points with highcrime rates. database.
Following are the steps that actually takes place
when the program runs:
Techniques I.Import libraries
II.Set the URL you want to web scrape from
1. CrowdSourcing: The survey results clearly III.Connect to the URL
pointed to us that Lighting, Walk Path, Visibility, IV.Parse HTML and save to BeautifulSoup object
Security and Transport were the important 5 pa- V.To download the whole data set, we do a for loop
rameters. the particular area is rated based on the through all <a> tags
above 5 considered parameters and each one of the VI.Pause the code for a sec(To prevent ourselves
parameters can be rated in the index of 1-5, based from getting banned)
on what scale the parameter that is being considered Web scraping is a process of automating the ex-
is true. traction of data in an efficient and fast way. With
Thus, finally on the basis of rating, it will tell us the help of web scraping, you can extract data from
that the area on the right side has a much higher any website, no matter how large is the data, on
safety index than the area on its left thus making it your computer. Moreover, websites may have data
safer and less crime-prone. that you cannot copy and paste. Web scraping can
Steps for Uploading images and data in FIREBASE help us extract any kind of data that you want.[4]
database Following are the steps of performing web scrap-
I. Set Firebase Permissions: To allow your app ping :
access to Firebase Storage, you need to set up per- A. Open the website on which you want to perform
missions in the Firebase console. From your console, web scrapping and based on what kind of data you
click on Storage, and then click on Rules. want to extract start inspecting the particular el-
II. Create the Application: Open up Android Stu- ements from the console and try to figure out the
dio, and create a new project tags and attributes that are of relevance to your web
III. Set Up the MainActivity Layout: The appli- scrapping process.[4]
cation will need one activity layout. Two buttons B. Then Start by importing the python libraries
will be needed—one to select an image from your import requests
device, and the other to upload the selected image. import urllib.request
IV. Get MainActivity Up: Navigate to your Main- import time
Activity, and start by declaring fields. These fields from bs4 import BeautifulSoup
will be used to initialize your views (the buttons and The most important library here is the Beautiful-
ImageView), as well as the URI indicating where the Soup.
image will be picked from. Add this to your main Beautiful Soup is a Python library for pulling data
activity, above the onCreate method. out of HTML and XML files. It works with your
V. Uploading the File to Firebase: folder gets cre- favorite parser to provide idiomatic ways of navi-
ated automatically when the image is uploaded. Lis- gating, searching, and modifying the parse tree. It
teners are also added, with toast messages. These commonly saves programmers hours or days of work.
messages get displayed depending on the state of the To parse the html with BeautifulSoup so that we
upload. can work with a nicer, nested BeautifulSoup data
VI. Set Permission in the App: Finally, you need structure.
to request permission that your application will We use the method .findAll to locate all of our
make use of. Without this, users of your application required tags. We should include time.sleep(1) line
will not be able to browse their device gallery and of code so that we can pause our code for a second so
connect to the internet with your application. Do- that we are not spamming the website with requests.
ing this is easy—simply paste the following in your This helps us avoid getting flagged as a spammer.
AndroidManifest file From the news article from TimesofIndia paper
Figure 2: Web Scrapping Output

has scraped the important data we are required for


the project. Data can be places, type of crime,
day, age of the victim, etc which is available in any
news article of crime-related.[23] These data were
extracted from news and appended into a csv. in
figure (2). You can observe the same data extracted
from the news.
3. Official Reports: Under the public open-source
portal, Maharashtra police provide the facility to
view published FIR online. FIR can be downloaded
in a variety of formats like CSV, JSON, PDF, etc.
CID Branch also provides the weekly and monthly
statistical reports of each District[17]. These reports
can be useful to analyze the crime on a monthly or
weekly basis[19]. Figure 4: Crime Density plot of Murders in
Mumbai

Figure 3: Maharashtra Police - Services for Cit-


izen Portal

Maharashtra Police has provided a citizen portal to


access the FIR published on Internet figure (3). Por-
tal allows us to view FIR published in any 3 months
range of specifically unit areas. This portal gives
latest records as per the search parameters specified
in search query. Below is snapshot of available FIR
to download.
At once, you can download only one FIR. FIR is
available in multiple formats such as CSV, JSON,
PDF, etc. FIR has some important fields which can
be used in our project system. Some of the impor-
tant parameters which we can extract are Age of
victim, Place,Date, Time, etc. Once the parame-
ters are extracted we can insert into main Database
which is Integrated with other Data source.
The approach towards building an app is based on
Figure 5: Crime Density plot of Thefts in Mum-
three aspects which are Official Reports, Web scrap-
ping and Crowdsourcing. We will train our model
bai
initially using Official Reports and then build it up
in the sequential phases using Web scrapping and
Crowdsourcing, thus we are trying to build an sys-
tem that works on all the aspects and integrates all
technologies into one, which is what makes it dif-
ferent from some similar projects which have been
done earlier.

Implementation
This mobile application will be using Django as
backend, its flexible, stable and customizable. The
Backend API will have a simple model for Location,
Figure 7: Safety Index Analysis
Rating and Prediction object, which will have its
respective serializer class created using Django Rest
framework. The Backend API will also have respec-
Finally, we have come to a conclusion based on
tive API functions in views.py which will server re-
the research and the analysis we conducted is that
quests at end point. The Frontend Mobile Applica-
cities like Andheri, juhu and kurla are comparatively
tion is created using React Native. It works with
not very safe for the users.
Expo SDK and apps so testing the application is
convenient on mobile devices as well as simulator.
The Application fetches data from the server and
renders it to the view. In Short, this application
Result Analysis
will only be developed for Android, React Native is The Graph in figure (7) shows the plotting of Crime
powerful framework for building both iOS and An- committed at different time intervals in Mumbai
droid apps. city. Thus, from the graph analysis it is seen that
between 12AM to 12PM most of the crimes are com-
mitted.

Figure 8: Estimate of Crimes at Various Interval

The below mentioned graph depicts the crime


rates at different parts of the city ranging from low
to high based on the number of thefts, robberies
and/or murders and also based on the 245 responses
we accumulated during the initial data collection.
It can very clearly observed that cities like Andheri
and Bandra have a high rate of number of thefts,
similarly andheri, bandra, dadar have a high rate
of number of robberies, and also andheri, kurla and
mulund have a high rate of number of murders.
The Graph in figure (8) shows the plotting of var-
ious crime events like Murder, Theft and Robbery
in several cities of Mumbai. It is clearly visible that
Figure 6: Model Predication Output on App In- Theft is the most committed crime in all the cities
terface and Murder being the least frequent one

The Graph in figure (10) shows the plotting of


Safety Index Value in several cities of Mumbai. The Conclusions
lower the Safety value the more crime prone the lo-
cation. Thus, from the graph analysis it is obvious In this paper, the complete analysis, classification
that Andheri, Kurla and Bandra are unsafe because and prediction of the Mumbai City is done us-
it has the least safety index values. ing crowdsourcing information with the information
[7] Varvara Ingilevicha, Sergey Ivanov. "Crime rate
prediction in the urban environment using so-
cial factors". 7th International Young Scientist
Conference On Computational Science (2018).
[8] Hitesh Kumar Reddy, Bhavna Sainia, Ginika
Mahajana. "Crime Prediction Monitoring
Framework Based on Spatial Analysis”. Interna-
tional Conference on Computational Intelligence
and Data Science (ICCIDS 2018)
[9] ALEXANDROS BELESIOTIS, GEORGE PA-
PADAKIS, DIMITRIOS SKOUTAS . "Analyz-
Figure 9: Crimes in Different Cities ing and Predicting Spatial Crime Distribution
Using Crowdsourced and Open Data". ACM
Transactions on Spatial Algorithms and Sys-
provided from social network and also the official tems, Vol. 3, No. 4, Article 12 (2018).
crime reports which in this case is FIR.The spa-
tiotemporal analysis can confirm the situation wher- [10] Isha Pradhan, Katerina Potika, Magdalini Eiri-
ever the crime event occurs. Moreover, the confi- naki and Petros Potikas. “Exploratory Data
dence level of a location is going to be outlined and Analysis and Crime Prediction for Smart Cities”.
it’ll be used as a parameter for computing the safer International Database Engineering Applica-
route. tions Symposium (IDEAS 19).
[11] Aman Kumar, Nikhil Tiwari, Prakhar Gupta,
Dr.S.N.Rajan. “WOMEN CRIME PREDIC-
References TION”. International Research Journal of Engi-
neering and Technology (IRJET).
[1] H. Su, K. Zheng, J. Huang, H. Jeung, L. Chen,
and X. Zhou, “Crowdplanner : a crowd-based [12] Seung Hwan Bang, Bongjun Ji. “Real-
route recommendation system,” inProceeding- time Crime Prediction Method using Criminal
softhe30thIEEEInternationalConferenceonData Records”. Conference Paper - June 2016.
Engineering(ICDE’14),pp.1144– [13] Ginger Saltos, Mihaela Cocea. “An Exploration
1155,IEEE,Chicago,Ill,USA, April2014. of Crime Prediction Using Data Mining on Open
[2] V. Arnaboldi, M. Conti, and F. Delmastro, Data” Article in International Journal of Infor-
“Implementation of CAMEO: a context- mation Technology and Decision Making · May
aware middleware for opportunistic mo- 2017
bile social networks,” in Proceedings of the [14] Alkesh Bharati, Dr. Sarvanguru RA.K. “Crime
IEEE International Symposium on a World Prediction and analysis using Machine Learning”
of Wireless, Mobile and Multimedia Net- International Research Journal of Engineering
works(WoWMoM’11),pp.1–3,Lucca,Italy,June2011. and Technology (IRJET)
[3] Firoz Ahmad, Md Meraj Uddin, Laxmi [15] Chao Huang, Junbo Zhang, Yu Zheng, Nitesh
Goparaju," Role of Geospatial Technology in Chawla. “Deepcrime: Attentive Hierarchical Re-
Crime Mapping: A Perspective View of In- current Networks for Crime Prediction”. Inter-
dia",World Scientific News 88(2) (2017) 211-226 national Journal.
[4] M. Nagarajan, K. Gomadam, A. P. Sheth, [16] https://www.hindustantimes.com/mumbai-
A. Ranabahu, R. Mutharaju, and A. Jad- news/mumbai-s-crime-rate-shoots-up-in-
hav, “Spatiotemporal-thematic analysis of cit- 2018/story-1sUP9o33Ga53tADqjKjhKL.html
izen sensor data: challenges and experi-
[17] http://mahacid.com/monthly-clime-
ences,” in Web Information Systems Engi-
review.html
neering—WISE2009,vol.5802ofLecture Notes in
Computer Science, pp. 539–553, Springer, [18] http://www.mhpolice.maharashtra.gov.in/Citizen/MH/
Berlin, Germany,2009. [19] http://mahacid.com/StateBrpg.html
[5] S.C.M. de S Sirisuriya,2015, A Comparative [20] http://ncrb.gov.in/
Study on Web Scraping .Proceedings of 8th In-
[21] https://data.gov.in/
ternational Research Conference, KDU
[22] https://www.diva-gis.org/
[6] Félix Mata, Miguel Torres-Ruiz, Giovanni
Guzmán, Rolando Quintero, Roberto Zagal- [23] https://timesofindia.indiatimes.com/city/mumbai/mumbai-
Flores, Marco Moreno-Ibarra, and Eduardo two-arrested-for-stealing-goods-from-moving-
Loza,"A Mobile Information System Based on train-coaches/articleshow/71788161.cms
Crowd-Sensed and Official Crime Data for Find-
ing Safe Routes: A Case Study of Mexico
City",Hindawi Publishing Corporation Mobile
Information Systems Volume 2016, Article ID
8068209,

S-ar putea să vă placă și