top of page
Search
Writer's pictureThakkar Vedang

Practical 12- Developing Advanced Real Time Facial Recognition Employee Attendance System





Abstract


Face recognition is the task of identifying an already detected object as a known or unknown face. It reports the technologies available in the Open-Computer -Vision(OpenCV) library and methodology to implement them using Python. For a Face Detection , Haar-Cascades were used. It Report describes the following points, Introduction, Implementation, Description, Features, Demo of the project and last Conclusion of the face Recognition. Django is a best Web framework that encourages rapid development. By using Django we can create, read, update and delete interface that is generated dynamically .


Introduction of Project


As per there are many Security systems were there in market like Biometric Fingerprint Sensor, Face Recognition and passwords or Pin Numbers. But By using Face Recognition we can provide a security for Locking and Unlocking purpose. In this module The system compares the given individual faces to all the faces which are stored in database and gives a ranked list of matches and show a accuracy then check face is found or matched . It requires no physical interaction on behalf of the user It is accurate and allows for high enrolment and verification rates In that I make a face Recognition Model for Employee Attendance Purpose Using OpenCV (Open Source Computer Vision) And For Framework I use tkinter. Face recognition has evolved as one of the best used biometric in the recent times.


Implementation


For implementation these are the steps for face detection using OpenCV , the entire summary can be jotted down in just few simple steps :

1. Import a OpenCV library

2. Reading the data.

3. Gathering the data and store in particular dataset folder

4. Training the dataset.

5. Detecting the face (creating box around the face and mapping the result)

6. Recognizing the name of face which is detect by OpenCV trainer model.


Now Let's see how to store a set of images in particular dataset and Training the data.


Training Data- person1, person2, person3, .......

Where the person1 , person2,.. are contains 50 training images of a person to be recognized . Test-data- test1.jpg,test2.jpg…..some test images.



Now, After collecting a dataset we have to train this dataset by using Face detection Algorithms . for that first I started work on Viola-jones Algorithm ,


So , For developing the project i started work on Facial detection Algorithm. There are many face detection Algorithm but as of now i decided to work on DNN(Deep learning Neural Network) and Viola jones Algorithm for face detection.


Viola Jones Algorithm


Viola-Jones was designed for frontal faces, so it is able to detect frontal the best rather than faces looking sideways, upwards or downwards. Before detecting a face, the image is converted into grayscale, since it is easier to work with and there’s lesser data to process. The Viola-Jones algorithm first detects the face on the grayscale image and then finds the location on the colored image.


While detecting a face Viola-Jones outlines a box and searches for a face within the box. It is essentially searching for these haar-like features, which will be explained later. The box moves a step to the right after going through every tile in the picture. In this case, I’ve used a large box size and taken large steps for demonstration, but in general, you can change the box size and step size according to your needs.


With smaller steps, a number of boxes detect face-like features (Haar-like features) and the data of all of those boxes put together, helps the algorithm determine where the face is.



Imagine our haar-like feature was converted into a grid. Each square represents a pixel. For demonstration, I chose a 4 x 8 grid, but in reality, there would be many more pixels and thus a much larger grid for a certain feature.













Training Classifiers


algorithm is setting a minimum threshold to determine whether something can be classified as a feature or not. The algorithm shrinks the image to 24 x 24 and looks for the trained features within the image. It needs a lot of facial image data to be able to see features in the different and varying forms. That's why we need to supply lots of facial image data to the algorithm so it can be trained. Viola and Jones fed their algorithm 4,960 images (each manually labeled). For some images, you can feed the mirror image of a particular image, which would be brand new information for a computer.


we look at the second feature in the subwindow. If it isn’t present, then we reject the subwindow. We go on for the number of features have, and reject the subwindows without the feature. Evaluations may take split seconds but since you have to do it for each feature, it could take a lot of time. Cascading speeds up this process a lot, and the machine is able to deliver results much faster.


DNN(Deep Neural Network)


The latest OpenCV includes a Deep Neural Network (DNN) module, which comes with a nice pre-trained face detection convolutional neural network (CNN). The new model enhances the face detection performance compared to the traditional models, such as Haar.




When using OpenCV’s deep neural network module with Caffe models, you’ll need two sets of files:


The .prototxt file(s) which define the model architecture (i.e., the layers themselves) The .caffemodel file which contains the weights for the actual layers Both files are required when using models trained using Caffe for deep learning.


OpenCV’s deep learning face detector is based on the Single Shot Detector (SSD) framework with a ResNet base network (unlike other OpenCV SSDs that you may have seen which typically use MobileNet as the base network).





After performing detection on datasets by getting accuracy upto 93% in DNN frontal face detection.


Block Diagram



Flow-chart of the methodology used for Training Process



The training process starts with traversing of the training data directory. Each image in the training date is converted into gray scale. A part of the image is taken as center and threshold its neighbours against it. If the intensity of the middle part is more or equal than its neighbour then denote it with 1 and 0 if not.


After this the images are resized. Then the images are converted into a numpy array which is the central data structure of the numpy library. Each face in the image is detected. Creation of separate lists of each face is done and the faces are appended into them along with their respective IDs. The faces are then trained with their respective IDs.


Flow-chart of the methodology used for Face Detection and Recognition


Face Recognition Algorithm


There are various algorithms used for facial recognition. Some of them are as follows: Eigen faces, Fisher faces ,Local binary patterns histograms


EIGEN FACES

This method is a mathematical system. The object that influences images is based on this algorithm. The whole idea will depend on the training website that will be provided. Photos from two different classes are not handled separately.


FISHER FACES

Fisher faces an algorithm and follows a continuous path like Eigen's face. This method is a modification of Eigen's face and therefore uses the same basic Components Analysis. The big change that the fisherman is facing is looking at the classes


RESULT ANALYSIS


The interface for the Smart Attendance System has been created. Using the interface the images of the individual students is being recorded and stored in the training dataset. Simultaneously their information is stored in the database i.e. excel sheet. Finally the images of the students is being tracked and recognized.



















CONCLUSION


This Internship was fruitful for me and the system that has been implemented using the LBPH algorithm. LBPH excels other algorithms by confidence factor of 2–5 and has least noise interference. The implementation of the Smart Attendance System portrays the existence of an agreement between the appropriate recognition rate and the threshold value. Therefore LBPH is the most authentic and competent face recognition algorithm found in Open CV for the identification of the students in an educational institute and marking their attendance adequately by averting proxies.

3 views0 comments

Recent Posts

See All

Comments


bottom of page