Smart Attendance System using DLIB

Download Full-Text PDF Cite this Publication

Text Only Version

Smart Attendance System using DLIB

Akshay M P

Dept of ECE, MIT Mysore, Mandya, Karnataka, India

Hemanth Kumar B S Dept of ECE, MIT Mysore, Mandya, Karnataka, India

Tejas N

Dept of ECE, MIT Mysore, Mandya, Karnataka, India

Varun Kumar H S Dept of ECE, MIT Mysore, Mandya, Karnataka, India

Anisha P S

Asst Professor, Dept of ECE, MIT Mysore, Mandya, Karnataka, India

Abstract: Attendance plays an important role in a student's career. The educational institutions monitor students attendance to determine the eligibility to write the exams. The conventional methods of taking attendance are slow and hence there is a need to build a smart attendance system. The face recognition based smart attendance system is one of the best techniques to overcome the proxy issues.

Key words: Dlib Face recognition, MQTT, Google drive, Convolutional Neural Network.


    Nowadays face recognition is trending and also it is one of the developing domains. Continuous research has been done on face recognition which would recognize human faces accurately. Face recognition system is the most reliable technique used for security purposes. It is used for taking attendance in working places and educational institutions. Most of the institutions still take attendance by calling the name or the roll numbers of the student which is time consuming [1][7]. To overcome this problem Face Recognition based attendance systems can be used.

    Python implementation of the Dlib library is used to build this proposed system. The students photographs are stored in the folder creating a database of the class. The Google Drive and MQTT dashboard helps for the wireless transfer of the photographs from phone to the computer so that the image clicked on the phone is uploaded to Google Drive and can be accessed from the computer anywhere. This is a cost effective system which requires less hardware that is readily available in todays world.


    Shraddha Arya and Arpit Agarwal [1] proposed a work to design and implement a face recognition system that accepts full or partial face image to verify the face of the person. The steps involved are pre-processing, LDA algorithm and Neural network. Pre-processing of the images takes place where the image of the face is partitioned to many different facial parts. Secondly LDA algorithm is proposed which features in reducing the dimensional spaces with the reduction of higher dimensional image to lower dimensional image and retains as much as information possible for recognition. Finally, a neural network is proposed to train the extracted features in the database and the trained model receives the input image and computes the input faces and face recognition is performed [8].

    Prashant Ksambe, Akash Upadhyay, Anushka Waingankar,

    Nevil Pooniwala,Ruchi Shah [2] proposed a smartphone attendance system which is based on mobile application where face recognition technique based on machine learning is used to mark the attendance. The result shows the capability of the system to cope with the change in posing and projection of faces. From face recognition with deep learning, it has been determined that during face detection, the problem of illumination is solved as the original image is turned into a HOG representation that captures the major features of the image regardless of image brightness. In the face recognition method, local facial landmarks are considered for further processing. After which faces are encoded which generates 128 measurements of the captured face and the optimal face recognition is done by finding the persons name from the encoding. The authors have claimed to have an accuracy of 98.3%.

    Shama S, Karthikeyan Shanmugasundaram, Satees Kumar Ramasamy [3] proposed a deep learning CNN based face recognition system. This model uses Dlib library for the face alignment, face recognition and FAREC has been implemented using the C++ language by computer vision. They have implemented Convolutional neural networks on trained feature models. They have discussed how CNN and Dlib helps in facial recognition. The input images are compared with the images in the database and the compared models have maximum accuracy. The false acceptance ratio(FAR) is only 0.1 and has accuracy of 96%.

    Sanjay Badhe, Kunal Chaudhari, Sneha Kale, Tejaswi Mane [4] proposed a fingerprint based attendance system using a fingerprint module by taking fingerprints of the students. It is a fingerprint Scanner Module with TTL UART interface. The system uses ZigBee wireless communication module to transfer data to a microcontroller which operates within the frequency band of 2.4 GHz ISM. The information obtained by the controller will be compared with the database and the attendance is marked. Ahmad Farhan Azan and Geetha Baskaran [5] proposed a face recognition and GPS based attendance system which makes use of Mobile GPS and Local Binary Pattern Histogram (LBPH) for face recognition. JAVA is used to write a mobile application. The students have to login to get their GPS coordinates. The application is used to open the front facing camera of the phone to take a photograph of the student and the face is recognized by LBPH algorithm. The image is compared with the database and the attendance is marked if the image is matched.

    Ze-Yan Yang, Che- Pin Chang, Shyan-Ming Yuan [6] proposed a CDMI compliant cloud storage access gateway which is the combination of APIs of three Cloud storage services (CSSs) which includes OneDrive, Dropbox and Google Drive. The most popular Cloud storage services (CSSs) are Google Drive, OneDrive and Dropbox. They can store the data through the internet and can be accessed at any time and anywhere. With the use of CDMI- compliant cloud storage access gateway, WPSs can easily develop web services which support accessing user data in their cloud storage and the data of users can be managed by themselves in their trusting CSSs. The proposed access gateway not only provides the access for the data but also avoids WPSs spending most of its time for the purpose of understanding how to use different APIs of different CSSs and also WPSs saves the storage memory on storage devices which can cost more by storing the data online.


Marking attendance in an educational institution is an important task to evaluate the overall performance of a student. Face recognition method is manual and hence time consuming. Therefore, it is needed to build an automated system which marks the attendance of the students with less effort as possible. The proposed model aims to achieve the above by building a smart attendance system as depicted in the figure below

Smar pt hon

Googl e

Compute r

Smar pt hon

Googl e

Compute r

Databas e

Databas e

Face Recognitio

Face Recognitio

Attendanc eupdate


Figure 1: Block diagram for the proposed model

The photo of the students inside the classroom will be taken by the lecturers. Depending on the dimension of the class we take multiple photos to cover all the students in the class without missing any one of them. The photo will be uploaded to Google drive. The image is fetched from the Google drive by using the MQTT where MQTT consists of publisher and subscriber. MQTT publisher is the smartphone where the photo is captured and the shareable link of the photo is published in MQTT application and MQTT subscriber is the program running in the computer will continuously check for the shareable link which is publishd from smartphone. If there is any link published by the lecturer the image is automatically downloaded and Face recognition is performed using Dlib and finally gets the list of all the students who are present in that photo and is updated in the form of a text file.


  1. Smartphone section: This section consists of the lecturers smartphone that is used to take the image of the students present in the classroom. The Google Drive application must be installed in the lecturers phone to upload the image.

  2. Computer section: This section consists of a laptop or a desktop computer in which a smart attendance system program will be running. The program will continuously monitor the MQTT for any new image uploaded from the smartphone.

  3. Google Drive: Google Drive provides a wireless transmission of data between the smartphone and computer. It is used for storing the image in the cloud uploaded by the lecturer. When the image is uploaded to Google Drive, the image is fetched with the help of MQTT.

Face recognition system

Dlib provides an efficient technique for face recognition based on the Convolutional neural network. It gives ideas about the methods involved in face recognition step by step. It consists of four main steps, they are Face Detection, Face Alignment, Face cropping and Feature extraction.

Figure 2: Block diagram of Face recognition system

Figure.2 Shows the overview of the Dlib Face recognition system that starts from the input image of a person to be recognized, then detects the landmark of the face and alignment will be done. Later the features are extracted from facial images.

  1. Face Detection

    The face detection is a computer vision technology to detect the front faces of the person from the digital image or video. This will detect the frontal faces by using facial landmark detection of upper lips and nose. Human nose is the middle point of the facial landmarks. The precise detection of human faces is a much more important process. Dlib facial landmark detector which is faster, more efficient and smaller than the original version. a 5- point facial landmark detector is used. The 68-point detector localizes regions along eyes, nose, mouth, jawline and eyebrows. The 5-point facial landmark detection reduces this information.

    Figure 3: Face detection

    II Face cropping

    Face cropping is the process of elimination of unsolicited outer area from an image. Face cropping is used to learn the facial features of humans in neural networks. The process encompasses in deletion of unnecessary trash from the image, to improve its framing or separate the subject matter from its background.

    Figure 4: Face cropping

    1. FEATURE EXTRACTION Convolutional neural network

      When it comes to Machine Learning, Artificial Neural Networks (ANN) perform very well. ANN is used in various classification tasks to classify image, audio, words etc. CNN is a derivative of ANN which is used mainly to classify images like classification of images of animals, plants or face recognition. CNN is designed to process data through multiple layers of arrays. The primary difference between CNN and any other ordinary neural network is that CNN takes input as a two- dimensional array and operates directly on the images rather than focusing on feature extraction. The solution for the problems in face recognition can be solved using CNN approach.

      A convolutional neural network uses three basic ideas:

      1. Local respective fields

      2. Convolution

      3. Pooling

      CNN uses spatial correlations which are present in the input data. Each layer of a neural network is connected to some of the input neurons. This region is called the local respective field. Local respective field is used to mainly focus on the hidden neurons. The hidden neurons process the input data which is present inside the mentioned field without realizing the changes outside a specific boundary.

      Figure 5: Local receptive fields

      The convolution learns a weight present in the hidden neuron which is associated with movement from one layer to another layer. Here, each neuron changes its position from time to time. The convolution layer is used to produce a feature map, which is different for different filters used for convolution operation. The mapping of connections from the input layer to the hidden feature map is defined as shared weights. To extract characteristic features from the feature map, activation layers are combined with the convolutional layers.

      Activation layers contain neurons with activation functions. By calculating weighted sum, Activation function decides whether a neuron should be activated or not. The main use of the activation function is to introduce non-linearity into the output of a neuron. Non- linearity helps in making the learning process efficient because most of the complex problems are nonlinear in nature. Some of the activation functions are shown in Figure.6.

      Convolutional neural networks use pooling layers, i.e., they are the layers which are positioned after the convolution layers. Pooling layer can be inserted after every convolutional layer or after the Hidden layers. It gets the input data from a feature map that comes from the convolutional networks which creates a smaller feature map. Pooling layers can be used to create the layer with neurons of the last layer and it extracts the important and characteristic features in the feature map.

      Figure 6: Functions of CNN

      The output from the pooling layer is provided to the fully connected layer which is a regular neural network layer that gets input data from the last layer and computes the class scores and provides the 1-D array of size which is the

      same as the number of classes. Database

      A database is an organized collection of data, generally stored and accessed internally from a computer system. Formally, a "database" refers to a set of related data and the way it is organized. Access to this data is usually provided by a database management system consisting of an integrated set of computer software that allows users to interact with one or more databases and provides access to all of the data contained in the database. The DBMS provides various functions which allows entry, storage and retrieval of large quantities of information and provides ways to manage how that information is organized.

      In this proposed work Database consists of 100 images and the database path is given to the program to compare the faces with test images.

      Figure 7: Dataset

    2. RESULTS

      The dataset of the proposed work consists of 100 images. The group image which is downloaded from the link will be compared with the dataset one after the other. If both the faces are matched, then it marks as present and gets updated in the txt file. The proposed work is tested on two group images. Out of 100 people in the test dataset, we took a photo of a group of three. The image in Figure.8 has three students.

      Figure 8: Test image of three students

      It can be seen that the system detects all 3 students faces despite having limited visibility and varied poses. Once the detection is done, the next task will be to identify the detected faces based on the dataset. When the test image is compared with the database, the identified students name will be obtained in the form of a text file as shown in Figure.9

      Figure 9: Present students list in the form of text file


In this work, a smart attendance system has been proposed.

The proposed work is dedicated to design and implement a face recognition model that accepts face images in order to recognize the face and it facilitates to update the attendance of the students in a very effective manner. The proposed model for taking attendance is effective in reducing extra hardware components required to take attendance. All the devices required for this purpse are already available with almost everyone in the present day and age. Dlib Face recognition approach for detecting and recognizing faces has been seen to be very effective. Hence from the above results we can obtain a paperless attendance system which is automatically maintained. This method effectively reduces proxy for the students and also is a time effective system.


  1. Face Recognition with Partial Face Recognition and Convolutional Neural Network Shraddha Arya and Arpit Agarwal, International Journal of Advanced Research in computer Engineering Technology, Jan 2018.

  2. Face Recognition based Attendance Management System using Machine Learning Anushka Waingankar, Akash Upadhyay, Ruchi Shah, Nevil Pooniwala and Prashant Kasambe,International Research Journal of Engineering and Technology(IRJET), 2018.

  3. FAREC-CNN Based Efficient Face Recognition Technique using Dlib Sharma S, Karthikeyan Shanmugasundaram, Satees Kumar Ramasamy, International Conference on Advanced Communication Control and Computing Technologies (ICACCCT),2016.

  4. Smart Attendance Management System Sanjay Badhe, Kunal Chaudhari, Sneha Kale, Tejaswi Mane, International Journal of Computer Applications National Conference on Advancements in Computer & Information Technology (NCACIT), 2016.

  5. Attendance System Using a Mobile Device: Face Recognition, GPS or Both? Geetha Baskaran, Ahmad Farhan Aznan, International Journal of Advances in Electronics and Computer Science, Volume 3, Issue8, pp. 2632, 2016.

  6. Cloud Storage Access Gateway Ze-Yan Yang, Che-Pin Chang, Shyan-Ming Yuan, IEEE International Conference on Smart City/SocialCom/SustainCom together with DataCom 2015 and SC2 201

  7. Parameshachari B D et. Al Optimized Neighbor Discovery in Internet of Things (IoT), 2017 International Conference on Electrical, Electronics, Communication, Computer and Optimization Techniques (ICEECCOT), PP 594-598, 978-1-5386-2361- 9/17/$31.00 ©2017 IEEE.

  8. Prabu, S., M. Lakshmanan, and V. Noor Mohammed. "A multimodal authentication for biometric recognition system using intelligent hybrid fusion techniques." Journal of medical systems 43.8 (2019): 249.

Leave a Reply

Your email address will not be published. Required fields are marked *