Intelligent door unlock system using AI MediaPipe

ABSTRACT


INTRODUCTION
Security is an ever-growing concern, necessitating innovative approaches to safeguard lives and property.The shortcomings of current security measures are evident in the growing instances of immediate criminal activities and unauthorized entries [1].This research addresses this critical issue by proposing a novel security paradigm centred around facial recognition technology.Traditional door access mechanisms often involve intricate security protocols, ranging from keycards to passcodes.However, the integration of AI MediaPipe offers a fresh perspective, envisioning a future where door access is streamlined through the sophistication of facial recognition and real-time data processing.AI MediaPipe, a versatile and powerful AI framework developed by Google, stands at the forefront of this revolution.Its ability to process and analyze visual data in real-time opens new possibilities for creating smart door access solutions that are not only userfriendly but also significantly more secure.Developing a smart security system to control door access motivates our research work.Much research has been carried out in this domain, but here we have tried to use the most promising AI media pipe model, which can effectively detect the faces without any lags, and how it can be seamlessly integrated into the security systems.
This paper aims to explore the unique features of AI MediaPipe and its application in simplifying smart door access, ushering in a new era of convenience and security.To materialize this advanced security system, we employ a combination of hardware components, including Raspberry Pi and a camera module strategically placed near the entrance for facial recognition.A solenoid lock, operated through a relay, facilitates the automated lock and unlocking of the door.The smart software, powered by the cutting-edge technology of AI MediaPipe, takes security to a whole new level.As someone steps up to the door, the camera snaps a quick shot of their face.The magic happens when our software, fueled by AI MediaPipe, checks that face against a list of authorized users.If it's a match, consider the door openaccess granted.But, if the face isn't on the list, our door stays locked tight, ensuring no unauthorized entries [2].
In the following sections, we will explore the key components of AI MediaPipe, its implications for smart door access, and its potential for revolutionizing security measures.We aim to shed light on how this cutting-edge technology can simplify door access, making it more accessible, user-friendly, and secure than ever.

LITERATURE REVIEW
Several studies have been conducted in the field of automated face recognition systems.Different algorithms and hardware are used to build an automated door unlock system using face recognition.In the last few years, much work has been done in the area of home automation.Research [3] proposed a facial recognition-based smart door lock system.Researchers have used the eigenface concept for face detection.The eigenface concept for face detection and door unlock will be controlled through the mobile application [4].Researchers have proposed door unlocking using fingerprinting [5].Various other research was also done on fingerprint-based models for door unlocking systems [6,7].The fingerprint-based sensors are used to identify the fingerprint and send the data where already saved data of the authorized user is present, and it is matched to unlock the door.Most of the work has been done using Arduino as a microcontroller.A smart anti-theft system using LBP and PCA models for face detection was used [8].Researchers developed remote servo control authentication for a smart door unlock system [9].The research used a face recognition system that combines discrete wavelet transform and discrete cosine transform methods.Several research works were done for smart door lock systems using fingerprint, face detection, and voice control systems [10].One of the papers [11] proposed a system for monitoring door-opening functions using a single wrist-worn sensor, which can detect and identify signals associated with holding, rotating, and opening a door by analyzing the upper limb's movements during daily activities.
The data collection phase involves using a 3-axis accelerometer and a gyroscope sensor worn on the wrist.In [12], a Door Security System featuring Wi-Fi Door Lock technology, ESP32 CAM, and IoT integration was developed.This system ensures real-time door status monitoring, advanced door management, and heightened security through Blynk, establishing a comprehensive solution for modern smart homes.CNN model was used to build face recognition [13].Google assistance for IoT IoT-based door unlock systems was developed [14].One of the research papers reviewed various literature on smart locking systems for illegally parked vehicles [15].Various other research works were carried out to develop smart door unlock systems using various microcontrollers and AI-based face recognition systems [16][17][18].
After reviewing various research papers related to this domain, we found that most systems used computer vision-based or neural network models for face detection.One of the limitations of computer vision-based models is the accuracy with which the prediction of faces is done.Light intensity also plays an effective role in face detection in these systems, which can occasionally be limited.The neural network-based models give efficient results, but it takes more computational time, and more memory is required for the hardware controller being used to execute the program.To overcome these difficulties, we have developed an AI media pipe model that can give better accuracy with less computational time.

METHOD
In this work, we have used Raspberry Pi as a microcontroller and a camera module to develop a door unlock system powered by a face detection system.The face detection model used here is an AI media pipe, which can give very accurate results compared to other computer vision-based models or machine learning-based models.MediaPipe is an open-source framework developed by Google that provides tools and components for building applications with perceptual computing capabilities, such as computer vision and machine learning.It includes a variety of pre-built models and pipelines for tasks like hand tracking, face detection, pose estimation, and more.The hardware used for the project is Raspberry Pi 4, relay, solenoid lock, and camera module, and the details of the hardware are explained below.

Raspberry Pi 4
The Raspberry Pi 4, developed by the Raspberry Pi Foundation, is a powerful and versatile singleboard computer that features a Quad-core Cortex-A72 processor running at 1.5GHz, up to 8GB of LPDDR4 RAM, dual HDMI ports supporting 4K video output, Gigabit Ethernet, USB 3.0 and USB 2.0 ports, onboard wireless LAN, Bluetooth 5.0, and a 40-pin GPIO header.This credit-card-sized computer serves as an affordable and accessible platform for various projects and applications, ranging from desktop computing and retro gaming to home automation and educational programming.With a robust community and many online resources, the Raspberry Pi 4 has become a popular choice for enthusiasts, hobbyists, and educators alike, offering an excellent balance of performance and affordability in a compact form factor. Figure 1 shows the Raspberry Pi board used in this project.

Relay Driver Board
A relay driver board is an electronic module designed to interface between a microcontroller or other low-power digital signal source and high-power devices, such as electrical appliances, motors, or industrial equipment.It typically includes one or more relay switches, each controlled by a low-voltage input signal.The primary purpose of the relay driver board is to provide isolation between the low-voltage control circuitry and the higher-voltage/higher-current loads.When the low-voltage input signal is applied, the relay driver activates the corresponding relay, allowing it to switch the high-power load on or off.It is a 5-volt, one-channel relay.Maximum load on the relay normally open interface: AC 250V/10A, DC 30V/10A.It has a 5mA trigger current and a DC 5V working voltage.A jumper can be used to set a high or low level on each relay channel.Figure 2 shows the single-channel relay driver board.

Solenoid lock
A solenoid lock is an electromechanical device that regulates the locking and unlocking of a mechanism using the same principles as a solenoid, a coil of wire with an iron core.The solenoid creates a magnetic field when an electrical current is delivered, which pulls the iron core, activating the locking mechanism and securing the apparatus.Electronic door locks, safes, and access control systems are among the many applications where solenoid locks are frequently used.Figure 3 shows the solenoid lock used in the project.
Figure 3. Electronic solenoid lock

Camera Module
The Raspberry Pi Camera Module is an accessory that enables the Raspberry Pi board to capture images and videos.It offers a resolution of 8 megapixels (3280 x 2464 pixels).The camera module is powered directly from the Raspberry Pi board through the CSI port, eliminating the need for a separate power source.Figure 4 shows the USB cable camera module used with Raspberry Pi for face detection.

Figure 4. USB cable camera module
The software used in this project is an AI media pipe module and Python programming for developing a face detection algorithm, which needs to be integrated with the hardware setup.

AI MEDIA PIPE FACE DETECTION
An artificial intelligence-based neural network model trained on various datasets is used by MediaPipe's face identification to identify facial features.An input image or video frame is fed into the model, which uses a neural network to interpret data and find face-related patterns.Bounding boxes representing the most likely positions of faces that were spotted in the image are included in the output.Postprocessing techniques could improve these outcomes even more.This makes it appropriate for applications like facial recognition and emotion analysis by enabling accurate localization of faces.Because of MediaPipe's modular design, its face detection component can be easily integrated into various projects, providing developers with a reliable and effective solution for computer vision applications involving facial tracking and recognition.
The flowchart below shows the steps involved in developing a project to use an AI media pipe-based face detection model for door unlocking.Figure 6 shows the circuit diagram for the automated door unlock system developed here, which connects Raspberry Pi, the camera module, the relay module, and the solenoid lock.Figure 7 shows the original circuit assembled for the project.Figure 7 shows the complete circuit assembly, which includes a Raspberry Pi microcontroller, solenoid lock, relay module, USB cable camera, and power supply.Our project consists of hardware assembly, which is shown in the figure.Figure 8 shows the complete setup developed for the project with all hardware parts assembled.Further, all parts were tested and worked as designated.

RESULTS
Once the circuit connections were completed, the AI media pipe model was developed and deployed using the Raspberry Pi module.The model was trained for authorized users.Once the authorized user comes in front of the camera module, the face gets detected, and the signal is sent to the solenoid lock through the Raspberry Pi microcontroller to unlock the door.It was found that the AI media pipe model gave 99.2% accurate results while predicting the authorized user faces.Once the face was detected, the signal was immediately sent to the solenoid lock through the GPIO pin module in Raspberry Pi.It was also found that there was no delay period in face detection and door opening.Figure 9 shows the user sitting in front of the camera, and the face is detected efficiently.Once the face is detected using a USB cable camera module, the AI media pipe model is used to predict the authorized user's face, as shown in the figure below.From the above prototype, it was clear that the developed model was working efficiently.The Table 1below shows the accuracy of face detection achieved by using other models like LBPH (Local binary pattern histogram) [19] and Haarcascade classifier [20] in comparison to the AI media pipe model, keeping into consideration its compatibility with the Raspberry Pi microcontroller.

CONCLUSION
AI MediaPipe stands out as a superior choice among face recognition algorithms for several reasons.Its real-time processing capabilities, robust feature extraction, adaptability to diverse environments, integration of deep learning techniques, and efficient partial occlusion handling contribute to its exceptional performance.The algorithm supports multi-modal inputs and ease of integration in the field of face recognition.The project here has proposed a setup for efficient door unlock using an efficient AI model for face detection.The complete hardware setup has been developed and deployed successfully.Our proposed model can efficiently detect the authorized user and unlock the door.The AI media pipe model used here can be a very efficient result.
Future work could involve refining AI MediaPipe's capabilities for handling complex scenarios, such as low-light conditions or variations in facial expressions.Furthermore, integrating additional modalities, such as voice or gesture recognition, could pave the way for more comprehensive and multidimensional access control systems.The ongoing exploration of this technology holds great promise for creating smarter, more secure, and seamlessly integrated access control solutions in the future.

Figure 2 .
Figure 2. Relay driver board single-channel Figure 5 below shows the steps to develop a smart face detectionbased door unlock system.

Figure 5 .
Figure 5. Flow chart for the steps involved in the project

Figure 6 .
Figure 6. Circuit diagram for the automated door unlock system.

Figure 8 .
Figure 8. Complete setup with hardware parts

Figure 9 .
Figure 9. Authorized user face being detected using AI Media pipe model

Figure 10 .
Figure 10.The setup shows the door is unlocked once the face of the authorized user is detected.

Table 1 .
Comparison models used for face detection