Crime Prediction Using Machine Learning Project[1] [Read-Only]
Crime Prediction Using Machine Learning Project[1] [Read-Only]
(Autonomous),Kurnoo
l
CST –
A2
Project Guide Team Members:
B. ThimmaReddy, 219x1a2803-Vasavi
Associate Professor, 219X1a2807-Sreevani
Department of C.S.E. 219X1a2849-Jaswanth Ralph
CRIME PREDICTION & ANALYSIS
USING MACHINE LEARNING
PROBLEM STATEMENT
This project aims to create a special tool
using old crime stories, facts about people
in different areas, and real-time info. This
tool can help police use their tools better,
tell regular people about safety, and stop
crimes before they even start. The goal is
to help police predict and prevent crimes in
a better way. Designing a computer system
to predict and understand crimes and need
to guess crime types, combine diverse
information, ensure logical outcomes, and
adapt to various scenarios.
INTRODUCTIO
N
Crime prediction helps us guess what crimes might
happen and stop them, which is really important.
We can even figure out what type of crime could
occur in a specific place. This machine learning
project focuses on finding crimes in a city and
studying them. This can show us dangerous areas
needing more police attention and help keep people
safe. The goal is also to predict when and where
crimes might take place and what kind they could
be. Lastly, we want to study crime records along
with information about people in a particular area.
Project Flow:
Project Initialization: Define project goals and objectives.
Data Collection and Preprocessing: Collect crime data from the Toronto
Dataset and tweet data, Preprocess crime data, Preprocess tweet data.
Feature Engineering: Combine crime and tweet data to create a unified
dataset for machine learning.
Machine Learning Model Development: Train machine learning models for
crime prediction using features and historical crime data
Model Validation and Testing: Test the model's ability to make predictions for
specific locations and times in the future.
Integration with Crime Prediction App: Develop a user interface for the Crime
Prediction App.
User Interaction: The app queries the model to predict potential criminal events for
the specified location and time.
Display Results: Display the predicted crime events to the users, including risk
Datasets :
Dataset which we are using is scraped daily from website of police which is publically available.
But the dataset is Hindi and in order to perform machine learning this data cannot be used as it is.
Hence the data needs to be processed after following some preprocessing steps, we ran some out-
of-the box learning algorithms as a part of our initial exploratory steps. Our new feature set
consisted of some features, all of which were now numeric in nature.
Modules Description
User Interface Module:
• Description: This module provides the user interface for interacting with the
system. It includes web pages where users can enter the location and date
and then it predicts the results.
• Components: HTML, CSS, JavaScript for the front-end web interface.
Web Server Module:
• Description: The web server module handles incoming user requests,
manages the user interface, and orchestrates interactions between different
parts of the system.
• Components: Flask or a similar web framework for Python, request handling,
routing.
Data Preprocessing Module: 8000 entries are present in the dataset. The null
values are removed using df = df.dropna() where df is the data frame. The
categorical attributes (Location, Block, Crime Type, Community Area) are
converted into numeric using Label Encoder. The date attribute is splitted
into new attributes like month and hour which can be used as feature for the
model.
Feature selection Module: Features selection is done which can be used to
build the model. The attributes used for feature selection are Block,
Location, District, Community area, X co-ordinate , Y coordinate, Latitude ,
Longitude, Hour and month.
Building and Training Model: After feature selection location and month
attribute are used for training. The dataset is divided into pair of
xtrain ,ytrain and xtest, y test. The algorithms model is imported form
sklearn. Building model is done using model. Fit (xtrain, ytrain)
Prediction Module: After the model is build using the above process, prediction
is done using model.predict(xtest). The accuracy is calculated using
accuracy_score imported from metrics - metrics.accuracy_score (ytest,
predicted).
Visualization Module: Using matpoltlib library from sklearn. Analysis of the
crime dataset is done by plotting various graphs.
UML
Diagrams :
Algorithms
:
Data Preprocessing:
Data cleaning: Handle missing values, outliers, and inconsistencies in the
dataset. Feature engineering: Create relevant features from the existing data,
such as deriving additional attributes for analysis.
Feature Selection: Choose relevant features that contribute to crime prediction
while excluding irrelevant or redundant ones.
Crime Prediction: Apply the trained model to new data to predict the likelihood
of future crimes.
Continuous Monitoring: Regularly update the model with new data to ensure its
accuracy and effectiveness over time.
THANK YOU