Predicting Crime with AI

Crime Prediction
Machine Learning

An exploration of using artificial intelligence to predict crime, based on a comprehensive study utilizing machine learning algorithms and historical data.

Soft pink and baby blue water ripples together in a subtle texture.

Predicting Crime with Artificial Intelligence

By Samuel Brown

In my dissertation, I explored the potential of using artificial intelligence (AI) to predict crime. By leveraging machine learning algorithms and historical data from the UK police, I aimed to create a predictive model capable of identifying crime hotspots and forecasting the types of crime likely to occur.

Read the full dissertation


Predictive policing involves identifying areas and individuals at high risk of crime. Traditionally, this has been achieved through community insights and statistical analysis. My project builds on these foundations by applying machine learning to historical crime data, aiming to enhance the accuracy and effectiveness of crime prediction.

Machine Learning Techniques

In my research, I employed several machine learning algorithms:

  • Linear Regression: For its simplicity and effectiveness in mapping variables.

  • K-Nearest Neighbour (KNN): Suitable for prediction problems, assuming similar inputs have similar outputs.

  • Random Forest: Combines multiple decision trees to improve prediction accuracy.

  • K-Means Clustering: Groups data points into clusters based on distance metrics.

Data Processing

The data used in this project was sourced from the UK police, focusing on crime statistics. Key steps in data preparation included cleaning, normalizing, and filtering the data to ensure it was suitable for machine learning models. This involved handling missing data, removing duplicates, and addressing potential biases.


The project utilized a tech stack comprising Python, Scikit-learn, and TensorFlow. Two main models were developed:

  1. Predicting Crime Locations: A feedforward neural network built with TensorFlow to predict crime locations based on historical data.
  2. Predicting Crime Types: A random forest model to predict the type of crime based on the predicted locations.

Results & Evaluation

The models produced promising results, effectively predicting realistic crime locations and types. However, challenges such as data accuracy, computing power limitations, and class imbalance were encountered. Future work could involve incorporating more diverse data and exploring additional machine learning techniques to improve prediction accuracy.


While AI-driven predictive policing shows significant potential, it is crucial to balance it with traditional policing methods that rely on community insights and human experience. Combining AI technology with human expertise can lead to more effective and well-rounded predictive policing strategies.

This project demonstrates the potential of AI in enhancing public safety and optimizing police resource allocation. As AI continues to evolve, its application in predictive policing is poised to become an invaluable tool for law enforcement agencies worldwide.