Face recognition door unlock using AI

We are building a system that utilizes convolutional neural networks, stochastic gradient descent for reducing the loss function, ReLU as the activation function and Open-CV for using the powerful image processing libraries. To train the face recognition model, we are using a custom dataset that con

2025-06-28 16:32:32 - Adil Khan

Project Title

Face recognition door unlock using AI

Project Area of Specialization Artificial IntelligenceProject Summary

We are building a system that utilizes convolutional neural networks, stochastic gradient descent for reducing the loss function, ReLU as the activation function and Open-CV for using the powerful image processing libraries. To train the face recognition model, we are using a custom dataset that contains the facial images of authorized users. Furthermore, a laptop PC is being used to host all the computation and processing along with handling the image input (taken in via a camera). The activation of the relay that controls the physical unlocking of the door is dependent upon the approval of the system. Access will only be granted to the known user by comparing the input images with the stored image of the authorized user i.e. the known user. This system aims to reduce the existing intricacies of traditional security methods and hopes to make peoples’ lives more secure without being too expensive. It has great scope in various domains and promises to be the mainstream technology of the future. we focused particularly on the study that would determine the feasibility of the proposed project. We walked through the operational feasibility that shed light on how the project is able to solve the target problem and how each of the components are equally significant in the creation of this project. Technical feasibility determined the potential problems that may arise while using this project and how the users are supposed to handle it skillfully. And finally, the economic feasibility study proved our claim that the project is economically viable and can be produced on a large scale since the components used are easily available in the market.

Project Objectives

Machine Learning and Computer Vision have practically enabled modern embedded devices to use cameras and understand whatever input they get. It is high time that people may have the feasibility of using modern security systems to their advantage that allows them the freedom from keeping a whole bunch of keys and worry about their safekeeping all the time. We aim to build strong and reliable security systems that are easy to use and are not ultra-expensive. Furthermore, we believe that people shouldn’t rely on old fashioned locks to keep their prized possessions safe since they are quite easy to pick and are helpless in front of modern tools. We have come up with the solution in the form of a door unlocking system that is based upon facial recognition. The access shall only be granted if the image of the person trying to access the door, matches the stored image of the legitimate user.

Project Implementation Method

Hardware Implementation

The first thing to do is to check all the physical components and verify whether they are working on an optimum level or not. The laptop is to be fully charged and a backup is to be made available at all times. If the laptop consists of a built-in high definition camera of at least 5 MP quality, then good. Otherwise, a USB 5 MP camera is to be connected with the laptop and positioned in a manner that it may be able to appropriately capture a focused image of the user present in front of it. The Arduino Uno microcontroller is to be connected with the laptop using a USB cable via which the two devices would communicate. The Arduino Uno is to be provided a separate DC supply (7V – 12V) for optimal performance. The relay is to be connected with the microcontroller in a traditional hardwired manner. The Vcc of the relay is connected with the digital output pin of Arduino, while the ground of the relay is connected with the ground of Arduino. The NO port is connected with the 220V power supply of the door lock, while the NC and common port is shorted and connected with the domestic 220V electricity supplying plug. The ground of the door lock power supply is also connected with this 220V electricity supplying plug.

Software Implementation

The laptop has Windows 10 OS pre-installed and operating with the latest update. The facial recognition program, contained in the python file, is executed and run using the Anaconda navigator. The facial recognition program is implemented as follows:

First, we import the required libraries:

2021-01-18_07:39:24pm_image-20210118193920-1.jpeg

Then we set up connection with the connected Arduino Uno’s serial communication port:

Face recognition door unlock using AI _1639950901.jpeg

After that, we provide the path to the database that contains the authorized users’ images:

Face recognition door unlock using AI _1639950903.jpeg

If a match is found, then character “c” should be sent to Arduino via the communication port. It will be saved in the variable “on”:

Face recognition door unlock using AI _1639950903.jpeg

We will list down the authentic users’ images in the variable “cls”:

Face recognition door unlock using AI _1639950904.jpeg

For the encoding points:

Face recognition door unlock using AI _1639950906.jpeg

And for the encoding list:

Face recognition door unlock using AI _1639950907.jpeg

To activate the camera and take the input:

Face recognition door unlock using AI _1639950908.jpeg

Finally, we will use a loop that would continuously look for the authorized users’ image in the camera. The character “c” will be sent to the Arduino if a match is found. Otherwise, the loop will continue running infinitely until the match is found:

Face recognition door unlock using AI _1639950909.jpeg

Face recognition door unlock using AI _1639950910.jpeg

On the other hand, when a match is found and character “c” is sent to the Arduino via the serial communication port, the Arduino Uno sends a HIGH signal to the connected relay for 1 second. That HIGH signal closes the relay and activates the 220V power supply that unlocks the door.

Face recognition door unlock using AI _1639950912.jpeg

Benefits of the Project

The benefits of our project in different organizations and systems are;

Technical Details of Final Deliverable

Hardware we use in this project are ;

The following software/packages are installed so that machine learning can easily be carried out:

Final Deliverable of the Project HW/SW integrated systemCore Industry SecurityOther Industries Education , IT , Energy , Finance Core Technology Artificial Intelligence(AI)Other TechnologiesSustainable Development Goals Peace and Justice Strong InstitutionsRequired Resources
Item Name Type No. of Units Per Unit Cost (in Rs) Total (in Rs)
Total in (Rs) 58150
Laptop Core i5 3rd Gen Equipment13500035000
Arduino UNO microcontroller Equipment110001000
HD USB Camera Equipment150005000
4 channel relay module Equipment1750750
Automatic Door lock Equipment140004000
Wooden door model Equipment126502650
USB 2.0 Cable Equipment1150150
Jumper wires Equipment1150150
FYP 1 report hard book binding 3 copies Miscellaneous 315504650
FYP 2 report hard book binding 3 copies Miscellaneous 316004800

More Posts