Skip to content

bqwerr/Criminal-Record-Management-System

Repository files navigation


Logo

Image Retrieval System for Police

The objective of this project is to design a face recognition system for security control. Our system helps the police to detect events that might otherwise be overlooked or take a long time to detect manually

Repository


Table of Contents
  1. About The Project
  2. Getting Started
  3. Features
  4. Contributors
  5. Contact
  6. References

About The Project


Criminal Record Management System detects criminals using Artificial Intelligence in real time videos, images and alerts the human supervisor i.e. the police to take the necessary action. Video frames are converted into image frames using OpenCV and these frames are sent to the system where it uses Facial recognition over those frames to identify probable persons in the frame that could match with the trained model. The facial detection is done using KNN algorithm and dlib library.Additional features of the system is that the citizen can register complaints, apply for NOCs (No Objection Certificate) and request an appointment with the higher officials in the police department whereas police can view those complaints, appointment requests and NOC requests.


Flow Diagram

Flow Diagram


Steps Involved in Extracting Facial features.

  • Get Byte Stream from Image
  • Resize Image with OpenCV
  • Frontal Face detection using pre-trained model
  • Get 64 Landmarks using pre-trained model
  • Convert NumPy arrays into encoded string
  • Store the record in the database
    • id - criminal Id
    • img - original image of the criminal
    • key_points - key points (64 facial landmarks of criminal) in the form of encoded string

Steps for Training a Model based on criminal records from the database

  • Fetch Label & Key Points for each record.
  • Train the model using KNN classifier.
encoded_labels = LabelEncoder().fit_transform(labels)
classifier = KNeighborsClassifier(n_neighbors=len(labels),
                                        algorithm='ball_tree',
                                        weights='distance')
classifier.fit(key_pts, encoded_labels)

Class Diagram

Class Diagram

Use Case Diagram

Use Case Diagram

Sequence Diagram

Sequence Diagram


Screenshots of the application

Sign Up Page

Sign Up

Login Page

Login

Compliant Registration

Compliant Registration

Dashboard

Dashboard

Add Criminal Record

Add Criminal Record

Match Image with Database

Match Image

Result of Prediction

Result


Built With

My Skills


Getting Started

To get a local copy of this application up and running follow these example steps.

Prerequisites

  • Python & dlib have to be installed in your local machine.
  • For dlib Installation, I have followed this article.

Installation

  1. Clone the repository

    git clone https://github.com/bqwerr/Criminal-Record-Management-System.git
  2. In the root project directory, open a terminal and create a virtual environment to install python libraries.

    pip install virtualenv
    virtualenv env
    env\Scripts\activate
    
  3. Now install python libraries

    pip install -r requirements.txt
    
  4. Run the application, using below commands in sequence

    python manage.py makemigrations
    python manage.py migrate
    python manage.py runserver
    

Usage

Below are the API endpoints consumed at the frontend.

  • Fetch all criminal records
api/records/
  • Post URL to add a criminal record to the database
api/add-record/
  • Delete a criminal record from the database
api/delete-record/<str:pk>/
  • To train a KNN Classifier with the criminal records in the database
api/train/ 
  • Post URL to match an image with the trained model. An image should be included in the request to this endpoint.
api/match/

Features

  • Dashboard for Police to get criminal records of suspects.
  • KNN Algorithm is used to match the suspect image to the actual criminal record over a database.
  • An endpoint is built to accept image frame(s) and provides inputs to the trained model
  • Citizen can raise Compliants, NOC Requests and Appointment Requests in the portal.
  • Police can view latest requests in the dashboard and contact the users.

Contributors

Srujan Tumma
Sai Kiran Kammari

References