**Library Reservation System Using Face detection**

\*\*Double blind review, please do not include authors information in this version \*\*

Received Date: \*date

Accepted Date: \*date

Published Date: \*date

**HIGHLIGHTS**

  - The new era of Covid-19 has changed our everyday life.

  - Covid 19 caused a change in the room booking process at the library.

  - The system helps users make reservations more effectively by using face recognition.

ABSTRACT 

*Today, Covid-19 has completely changed our way of life. The new generation has made people stay at home, instead of going on vacation. The users are not allowed in a close place, especially in a building or room. The library that used to be packed with people reading books, studying, and using the computer is now becoming empty. The room in the library has been limited only to a certain number of people to prevent any dangerous situation regarding the Covid-19 virus to spread. The room needs to be reserved beforehand for the user to use. This situation has become a problem for users as the user’s desired room may be occupied by other users. Thus, Reservation System using face recognition for the library was developed to overcome this situation. In this paper, the researcher will use the Haar Cascade Algorithm to scan the face and MySQL as a database to detect the room and time slot for a reservation. Phyton language and Visual Studio Code were used to develop the system. The limitation of this project is that the face registration took a long time for some users because of the lightning that makes it the system hard to recognize the face. The recommendations for future work are to use a high technology camera to scan the face and construct an admin page because the system does not have an admin page.*

*Keywords: Haar cascade Algorithm, reservation system, face recognition, library*

# INTRODUCTION 

Nowadays, because of Covid-19, people cannot go to the library often. This is because the library is a tight space, and it is not a suitable place for people to gather in one place. The room in the library also can’t be open to many people. Only a limited amount of people may enter. This issue has caused the number of people who have been using the library has become lesser. Another issue users are facing right now is that users who want access to the room at a specific time need to come much sooner to reserve the room sooner than other users. Most times, the earliest user will get the space, but the others will have to wait until the room is not filled (Atkinson & Lee, 2018). The difficulty in reserving the rooms causes inefficiency and is time-consuming for the user in a rush. For instance, booking rooms will require the user to go to the library.

It is inconvenience for the library to provide a room reservation system that includes a manual system. This is because, in many cases, libraries always lack librarians to provide the services.

Currently, manual system usage which is done by hand, without using technology has been decreases (Kumar et al., 2018). The traditional way of reserving a room can be quite hard for students since most of the students are busy. In addition, the students have assignments to do or other work that require them to spend more time on it. Besides, the usage of paper and pens also increases, due to a large number of papers and pens consumptions during reservation. Therefore, room reservation systems still using the manual system need to be banished, considering it is inconvenient for the students. The reservation system should be conveniently accessible for users while booking rooms (Atkinson & Lee, 2018).

Hence, a reservation system that can see the rooms for the user to reserve needs to be developed. The users can easily reserve the rooms without going to the library.

Face recognition embraces a variety of services and applications, beginning from human identification and surveillance and coming as far as e-marketing and advertising for the interested customers (Evangelos, 2020). Face recognition is often utilized, within ubiquitous computing realms, that embrace livestream feeds from installed cameras, which deliver snapshots of human faces under noisy real-life conditions and varying lighting conditions and physical surroundings uncertainties (Evangelos, 2020).

# Thus, a reservation system using face recognition is recommended because of these issues. People can save time by reserving a room beforehand. The cost of paper and pen also can be decreased because of the reservation system. Image Processing is a method to convert an image into digital form and perform some operation to get an enhanced image or extract some helpful information. However, by using image processing, the user did not have exchange skin contact with each other. Therefore, this project aims to develop a reservation system using face recognition for the library. 

**LITERATURE REVIEW**

The language for the project was decided which is Programming Python Language, the database is OpenCV and MySQL Workbench and for the developer is Visual Studio Code. Python was selected for building the system because of its ease of learning and implementation. It is also the most popular language for implementing machine learning and data science (Patil, 2021). OpenCV, a robust library for computer vision, was used to implement the face detection and recognition algorithms. The study by researcher concludes that OpenCV proves to be more efficient and productive than dlib for face detection and recognition problems (Boyko, 2018; Patil, 2021). OpenCV provides Haar Cascades for face detection and Eigenfaces, Fisherfaces and LBPH algorithm for face recognition (Patil, 2021).

Haar **C**ascade Algorithm is an object detection algorithm that used to identify faces in an image or a real time video. The algorithm is given a lot of positive images consisting of faces, and a lot of negative images not consisting of any face to train on them. The repository has the models stored in XML files and can be read with the OpenCV methods. These include models for face detection, eye detection, upper body and lower body detection and license plate detection. Figure1 shows the Haar features. Haar-like features are used and calculated extremely efficiently with integral images.

![](6224d2c0a8b4c_media/media/image1.png)

Figure 1: Haar features (Sources: https://towardsdatascience.com)

Haar cascades classifier provided by OpenCV are used. Haar features are used to detect faces. It uses Ada-boost learning algorithm. This pre-trained classifier has 6000+ features. Next, Adaboost Training trains the weak classifiers to create strong classifiers for the algorithm to detect the objects. Weak learners are created by moving a window over the input image, and computing Haar features for each subsection of the image. This difference is compared to a learned threshold that separates non-objects from objects. Because these are weak classifiers, many Haar features is needed for accuracy to form a strong classifier. Figure 2 shows the Adaboost.

![](6224d2c0a8b4c_media/media/image2.jpeg)

Figure 2: Adaboost (Sources: http://www.medium.com)

The last step combines these weak learners into a strong learner using cascading classifiers. The cascade classifier is made up of a series of stages, where each stage is a collection of weak learners. Weak learners are trained using boosting, which allows for a highly accurate classifier from the mean prediction of all weak learners. Based on this prediction, the classifier either decides to indicate an object was found (positive) or move on to the next region (negative). Stages are designed to reject negative samples as fast as possible, because most of the windows do not contain anything of interest. It’s important to maximize a

low false negative rate, because classifying an object as a non-object will severely impair your object detection algorithm.

# SYSTEM IMPLEMENTATION 

1)  **Haar Cascade Algorithm**

Haar Cascade Algorithm is an algorithm that help detecting life images. In the library reservation system, the system will capture user’s face when they register their face. The system will capture the face until 100 milliseconds before save the image. The image will be using Haar Cascade classifier and save in the XML file which is haarcascade\_frontalface\_default.xml. The Figure 3 shows the coding using Haar Cascade Algorithm to save the captured image.

![Graphical user interface, text, application, email Description automatically generated](6224d2c0a8b4c_media/media/image3.png)

Figure 3: Coding to Train Image

The Haar Cascade file that save the trained images will be used to compare the face that being scan and the trained images. Figure 4 shows the Haar Cascade file that contain the trained images.

![](6224d2c0a8b4c_media/media/image4.png)

Figure 4: Haar Cascade file

Next, the image that has been trained also save in the separate file. The file that has been used to save the trained image is called TrainingImage. The data of the user such as name, matric number and phone number that has been taken when user register face also has been kept in the MySQL Workbench in the table named student. Figure 5 shows the training image file that contain the images that has been trained.

![](6224d2c0a8b4c_media/media/image5.png)

Figure 5: Trained Image

Each image that has been trained will be used when the users scan their faces to reserve room in the library. When the face is being scan, the system will compare the live image with the trained image in the Haar Cascade file. Figure 6 shows the coding used to compare the images.

![Text Description automatically generated](6224d2c0a8b4c_media/media/image6.png)

Figure 6: Coding to Compare Images

2)  **System Interface**

> The system was build using Python programming language and Tkinter package to build the Graphic User Interface (GUI). Figure 7 shows the Registration Page and Reservation Page.
> 
> ![](6224d2c0a8b4c_media/media/image7.png)

Figure 7: Registration Page and Reservation Page

The Registration Page is for the user who did not register the face. The user needs to fill in the name, matric number and phone number and click the Register Face button. The user’s information will be saved in the database, and the face will be kept in the XML file, which is haarcascade\_frontalface\_default.xml. Reservation Page is for the registered user to reserve the room by scanning the faces. The user needs to write the class and choose the time slot and room. Then click the Reserve button to start scanning the face. The user can view the reserved slot by clicking the View Reservation Slot button.

After that, when the new user registers their face, they will fill in the registration form and scan their faces. When the face has been saved in the system, the system will tell that the profile has been saved. If the system already has their information, it will show a message to the user that their data has been registered. Figure 8 shows the face-scanning for registration, Figure 9 shows the profile has been saved in the system, and Figure 10 shows the student who existed in the system.

![](6224d2c0a8b4c_media/media/image8.png)

Figure 8: Face Scanning for Registration

![](6224d2c0a8b4c_media/media/image9.png)

Figure 9: Profile saved

![](6224d2c0a8b4c_media/media/image11.png)

Figure 10: User existed

Next, when the user makes the reservation, they will enter the class name and scan their faces that have been registered. Then the user can proceed with the face scanning. The information of the user will be displayed. Figure 11 shows the reservation process when scanning the faces.

![](6224d2c0a8b4c_media/media/image12.png)

Figure 11: Reservation process

The reserved slot will show the user's information that has reserved the room and time slot, including the room, time slot, and reservation. Figure 12 shows that reservation slot

![](6224d2c0a8b4c_media/media/image13.png)

Figure 12: Reserved slot

**FINDING AND DISCUSSIONS**

The system able to create easiness among users on reserving rooms in library*.* By inventing this system, the time consuming for the users in locating the available room and reserve it will be less because the users do not need to go to the library anymore to reserve the room.

Furthermore, users can identify the room and time slot available in the library by using the system. The users able to see about the room's information before they reserve the room such as maximum capacity and name of the room. The cost of the reservation also will be lesser than before. This is because the price is dedicated to paper, and pen usage is no longer needed since there will be no more paper and pens. Thus, the users are capable of reserving rooms on their own. Furthermore, it also helps the users reserve the available rooms in the library based on the time slot and room available using only faces since the system will be using image processing.

**CONCLUSION AND RECOMMENDATIONS**

This paper proposes an Image processing based library reservation system that can provide information about room availability to help user to reserve an available room slot from their respective homes in order to reduce the cost and saving time. The system will detect the face of the person who is reserving the room and use it to match the face with faces stored in the database at the time of slot booking.

The main motive of our study is to revamp the reservation process by reducing the time that is demanded to reserve a library room.

The limitation of choosing image processing is some of the images are hard to be detected. Because this project uses a laptop’s camera to detect real-time images, the faces detected might be shaking or un-focus. The lighting and color effect are also some of the reasons the system can’t detect faces. Therefore, it is recommended to use a high technology camera when capturing the images to get a better resolution.

Furthermore, facial recognition algorithms can be further facilitated and be extended to various other sectors if personal identification is required.

**REFERENCES**

Atkinson, S., & Lee, K. (2018). Design and implementation of a study room reservation system: Lessons from a pilot program using google calendar. *College and Research Libraries*, *79*(7), 916–930. <https://doi.org/10.5860/crl.79.7.916>

Behera, G. S. (2020, 12 24). *Face Detection with Haar Cascade.* Retrieved from https://towardsdatascience.com/face-detection-with-haar-cascade-727f68dafd08Boyko, N. B. (2018). Performance Evaluation and Comparison of Software for Face Recognition Based on Dlib and Opencv library. *IEEE second International Conference On Data Stream Mining \&Processing (DSMP)*, (pp. 478-482).Evangelos, M. S. (2020). On the Extension of the Haar Cascade Algorithm for Face Recognition: Case Study and Results. *24th Pan-Hellenic Conference on Informatics (PCI 2020)* (pp. 53-56). Athens, Greece.: ACM, New York.Hern, A. (n.d.). *What is facial recognition- and fhow do police use it?* Retrieved from www.theguardian.com/technology/2020/jan/24/whatis-facial-recognition.Kumar, A., Kumar, A., Chakraborty, D., Abhishek, P., & Rao, P. (2018). Analyzing Consumer Preference for Online Booking of Tourism and Hospitality in India. *Atithya: A Journal of Hospitality*, *volume 3*(February), 12–20.Mittal, A. (2020, 12 21). *Face Detection with Haar Cascade.* Retrieved from https://medium.com/analytics-vidhya/haar-cascades-explained-38210e57970dPatil, S. T. (2021). Digitized railway ticket verification using facial recognition. *5th International Conference on Intelligent Computing and Control Systems (ICICCS)* (pp. 1556-1563). IEEE.
