Face Recognition of Passenger for Bus Services

: Most university students are using the bus provided by the university's management to move from one place to another place. The analysis are required to improvise the quality of the of bus services such as the amount of passenger that using the bus and information of passengers such as gender. The objectives of this project are to develop face recognition system based on gender using Raspberry Pi 4 and Intel Neural Compute Stick 2 and to test and validate the performance of the developed system for face classification and passenger counting system. Also this system is able to store passenger information into Google Firebase Cloud with Internet of Things. This system is used Raspbian in Raspberry Pi 4 with the libraries that used for face classification and recognition such as OpenCV and OpenVINO. This project able to detect faces of the passengers soon as they ride the bus and determine gender of the passengers and count passengers according gender and the information of the passengers will stored in Google Firebase. There are some recommendation that need to be added in this project to improve efficiency of the system. the gender either the passenger is male or female. The number of passengers be counted after analyzing face completed. The data regarding number of passengers based on gender send to Google Firebase for stored data using Cloud technologies. The results number of passengers based on gender displayed in Google Firebase through Google Firebase’s website.


Introduction
Most Malaysian these days using public transport such as bus as their preferred transportation to reach their destination. Based analysis that have been done in 2017 by the Ministry of Prime Minister's Department, about 56 per cent of people in Malaysia used public transportation services [1]. In the university, most of the students is rely on the bus services that provided by university management for them to move from one place to another such as to lecture halls and sports facility center. Bus service is one of the solutions to have a green campus environment which is helps reducing the traffic congestion and the release number of carbon emissions to surroundings. The management must be responsible to have a good quality of the bus services to ease mobility of the students in the campus. Lack of quality in bus services will give the impacts towards the students such as late for the class, wasting time and energy, unpleasant ride and problems in safety which make give negative perception towards managements of transport services [2].
In order to improve the quality of bus services, the analysis regarding the passengers must be done. The analysis that can be done such as the number of passengers that using bus services in different situations for example during peak hours which in early morning and evening and off-peak hours. Besides that, the information of the passengers also important to include in the analysis such as gender of the passengers. Face Recognition of Passenger for bus in UTHM is better solution to get the statistics of the bus passengers based on their gender. This system using real-time application, Internet of Things (IoT) system. The face of passenger have been analysed using Raspberry Pi 4 and sent to Firebase to store the results of the analysis.

Problem Statement
The method that available to count the amount of the passengers that riding the bus is by doing manual counting. This method required about one or two persons to count the passengers and wrote in the form. However, there is drawback with this method as this method need full commitment of the person that doing counting passengers for one day in term of energy and time. This will cause the person to waste their time spending in the bus counting the passenger and inaccurate statistics will occurs because the person may exhaust when doing their tasks. Therefore, the proposed system designed to detect face of passengers based on the gender. This system has ability to collect data of passenger which helps UTHM management to improve bus services. Besides that, the proposed system can save user's time as user do not need to spend whole day to collect data instead of installing the system in the bus and wait the analysis at the end of the day.

Face Recognition
Face recognition is defined as the system that used to finding a human face from an image [3]. In other article, face recognition is also defined as an automated computer system that work same as the human performance which is working same as human brain that have ability to recognize faces. recognition and biometrics in general still continue. There are many face recognition algorithms in academic field. Some of results from the research is relatively mature, and then several commercial face recognition system and products are appeared [4] such as Identix and Cognitec that has researched and developed FaceIt system and FaceVACS system, respectively.

Face Detection
In automated face recognition system, face detection is important to have a system that have accurate detection in face location and features such as nose, eyes, eyebrow, nostrils, mouth, lips and ears based on an image. Fundamental for face recognition is face detection. There are many related with face detection such as difficulties to determine the position of the face in the image, detecting the presence, location of facial feature and face authentication to confirm individual's identity in the image [5].

People Counting
People counting based on computer vision is implemented on different purpose according to the research problems being set earlier. There are two scale variation to captured image or video footage that used for processing people counting algorithm which is large-scale and small-scale people counting [6]. In small-scale people counting, mostly used to counting the number of people in a group among in the store or an area of interest using multiple technology. These technologies differ with sensor-based system to vision-based system which is sensor-based relying with multiple number of sensors that have obstacles such as unable to differentiate people and their direction of movement. Vision-based system able to implement more features for example tracking movement of the people.

Materials and Methods
For this project, there are some essential parts needed such as face detection, face classification and passenger counting. GPS tracker used to determine the location of bus. Google Firebase is used to store the information regarding the number of passengers based on gender and Google Maps for display the location of the bus. Figure 1 shows the block diagram of the system.

Materials
There is some equipment that used for allowing this project to run including: i. Raspberry Pi 4 Raspberry Pi is a small scale-based computer which the performance of the Raspberry Pi is very efficient when running games, image files and documents. They can be manufactured using different configuration as per the user's needs.The specification of Raspberry Pi 4 are: a) Broadcom 2711 with quad-core Cortex A-72 processor with speed at 1.5GHz. b) Capable of video playback using H265 which able to decode 4K resolution and H264 that able to decode Full HD at 60 fps and encode Full HD at 30 fps c) Include several ports including 2 ports of USB 3.0, Ethernet hub.
Raspbian is the operating system for Raspberry Pi 4 that produced by Raspberry foundation. The Raspbian able to operate any tasks in the Raspberry Pi 4 and have built-in Python 2.7 and Python 3.5 for easier to run the program as the system using the Python language.
ii. Intel NCS2 Intel Neural Compute Sticks 2 (NCS2) is an embedded deep learning device which is small USB 3.0 Type-A that able to use for learning in AI programming at the edge [7]. Intel NCS2 run with Intel Movidius Myriad X vision processing unit (VPU) that can found in smart security cameras and industrial machine vision equipment which this processor has an ability to support the Intel Distribution of the OpenVINO toolkit.
Based on Intel, the Intel NCS2 makes easier for test, tune and prototype deep neural networks. Besides that, NCS2 have 8 times higher performance with NCS. Moreover, with vision accelerators can helps the developers increase producing the IoT devices. NCS2 supports many types of operating system including Windows and Raspbian. Moreover, NCS2 also support TensorFlow, Caffe, MobileNet SSD, ApacheMXNet, Pytorch and PaddlePadle through open neural network conversion.
iii. USB webcam USB webcam are connecting with Raspberry Pi 4 through USB cable. There are many USB webcam that available in the market but for this research the type of USB webcam that used is Logitech C270 HD webcam. Google Firebase defined as a technology that allowing users to make web applications without server-side programming brings the development of web applications become easier and quicker than normal technique [8].
Google Firebase give benefits towards developers where able to store data without using SQL which data will store in NO SQL and sort in the form of paired key. Google Firebase also allowing the developers to use Firebase Cloud Messaging features that have capabilities including:  Figure 2 shows the flowchart of the system. When the passengers ride the bus, the system determine the faces of passengers according to the features that available in the faces such as eyes and nose with using USB webcam that located at the front door of the bus. After face of passenger been detected, the system analyze the gender either the passenger is male or female. The number of passengers be counted after analyzing face completed. The data regarding number of passengers based on gender send to Google Firebase for stored data using Cloud technologies. The results number of passengers based on gender displayed in Google Firebase through Google Firebase's website.

Results and Discussion
The results of project have been shown including the design of hardware, face recognition in any condition including the angle of faces, the brightness of environment and distance of faces that been detected. Besides that, this chapter shows information using Google Firebase.

Design of hardware
The Raspberry Pi 4 have been connected with many peripherals including USB web camera, GPS module with USB to TTL Serial converter and Intel NCS2. All components have been connected to the powerbank which used as power supply for the system as shown in Figure 3.

Face detection in bus
In Figure 4 shows the visual of video of front door of bus that captured USB webcam inside the bus. Based on visual below, height of the hardware was sufficient enough for the webcam to capture the faces of passengers as the system that able to detect faces when the passengers entering bus.   Table 1 shows the range of distance that face able be recognize by the system. Based on Table 1 the system was able to detect up to 150 centimeter which as suitable distance from hardware prototype to detect the faces of passengers. The limitation of camera distance used in this study. The distance is measured from face of passengers towards USB webcam where the measurement done by using measuring tape.

Face detection based on face accessories
The effectiveness of face detection is depending on the accessories that available at face such as spectacle, face mask and hat. Some of accessories has ability to determine the gender of the person and some of them are not able to determine the gender. Table 2 shows the face detection based on accessories that available on the face. Based on Table 2, shows the face detection based on accessories that available at faces where the passenger wearing the face mask is unable to detect as the system unable to detect because the face feature is been covered which is mouth and nose. Meanwhile, other accessories such as hat and scarf is able to determine the gender because the face features such as mouth and nose is not covered. The passenger wearing spectacle also able to determine the gender as eyes is able detect by the system.

Gender Detection accuracy
The accuracy of the system when detect the gender of the people is important to have good statistics when running the analysis. In the Table 3 shows the results of the gender detection of people. The number of people that involve is ten where seven of them is man while others is women. From Table 3, six out seven man is detected while for one out three women has been detected which bring the accuracy for man is 85.71% while for women is 33.33% where the calculation of the accuracy is shown in Eq. 1:

Conclusion
This project is able to determine the gender of human face real-time video by using webcam for real-time video detection with using Haar cascade classifier, count the passengers based on gender and able to track the location of bus services using Google Maps. The result of the analysis is send to Google Firebase. For future work, the system able to classify race of the passenger according to Malaysian citizen such as Malay, Chinese and Indian also can count the passengers based on age and races. Besides that, the system needs to enhance in order to increase the accuracy of face classification.