Computer Vision - Real Time Face Recognition using Open CV and Python
PROJECT REPORT
1. PROJECT REPORT
-FRAUD DETECTION
Problem Statement: The main objective of this project is to prevent a fraudster from applying
loan twice in a particular bank. When an image comes from the user registration page the
algorithm will check whether the image already exists in the bank’s database or not. If a match is
found a warning message will be displayed to the bank manager who can take appropiate action
based on the details of that particular user.
Dataset Description: The dataset consist of frontal-face of a person’s image. Since the problem
is related to a bank we can safely assume that all the images will be of a good quality(image will
not be of mobile camera quality) and the person will be facing the camera.
Pre-processing: All the images were resized to a common size and then converted to gray-scale
to remove the remove high frequencies and detail.
Model developement: Using OpenCV haarcascade-frontal face classifier we first detect the face
of a person from an image and crop it out and store it in the local filesystem. After this PCA was
used for image re-construction. This step was necessary as it will further remove the noise that
will be present in the image after being converted to gray-scale. After this 2 similarity measures
were used to check for image duplication
a. dHash Algorithm: dHash is a perceptual hashing algorithm. A perceptual
hashing algorithm that takes a fingerprint of a multimedia file by deriving it from
various features from its content so it can take into account transformations on a
given input and yet be flexible enough to distinguish between dissimilar files.
dHash (difference hashing) algorithm computes the difference in brightness
between adjacent pixels, identifying the relative gradient direction. This algorithm
is very fast and we use this algorithm to filter out those images which differ vastly
from the input image.
b. Structural Similarity Index(SSIM): The structural similarity (SSIM) index is a
method for predicting the perceived quality of digital television and cinematic
pictures, as well as other kinds of digital images and videos. SSIM is used for
measuring the similarity between two images. The SSIM index is a full reference
metric; in other words, the measurement or prediction of image quality is based
on an initial uncompressed or distortion-free image as reference. SSIM is
designed to improve on traditional methods such as peak signal-to-noise ratio
(PSNR) and mean squared error (MSE), which have proven to be inconsistent
with human visual perception. Based on this measure we calculate our final
accuracy.
2. Output: our final output displays the proper message to the bank manager based on whether
fraud has been detected or not. Based on the output the bank manager will take appropiate action.
If fraud has been detected on the output window will display the image of the fraudster and
his/her matching image from the bank’s database and the customer id no.
Accuracy of the model: Model accuracy is around 61 %
Drawbacks:
1. The model does not give accurate results if the image quality is poor as OpenCV fails to
detect the face from an image.(eg . if the photo is taken from a mobile phone)
2. The model gives poor results if the user is not facing the camera or standing far away
from the camera.
Tools Used:
1. Python
2. OpenCV for Image Processing
3. Apache Spark for scaling up the model
4. Bottle Framework for Integrating with Java
5. Java for frontend development
References:
1. Wikipedia
2. Github
3. http://blog.iconfinder.com/detecting-duplicate-images-using-python/
4. Apache Spark Documentation
5. Stackoverflow