2015 Implementation of K-Nearest Neighbors Face Recognition on Low-power

2 Abstract Face recognition is one of early detection in security system. Automation encourages implementation of face recognition in small and compact devices. Most of face recognition research focused only on its accuracy and performed on high-speed computer. Face recognition that is implemented on low-cost processor, such as ARM processor, needs proper algorithm. Our research investigate K-Nearest Neighbor (KNN) algorithm in recognizing face on ARM processor. This research sought best k-value to create proper face recognition with low-power processor. The proposed algorithm was tested on three datasets that were Olivetti Research Laboratory (ORL), Yaleface and MUCT. OpenCV was chosen as main core image processing library, due to its high-speed. Proposed algorithm was implemented on ARM11 700MHz. 10-fold cross-validation showed that KNN face recognition detected 91.5% face with k=1. Overall experiment showed that proposed algorithm detected face on 2.66 s on ARM


Introduction
Smart building becomes top issues in last years. Some researches keep doing to propose better smart building system. A smart building should be able to modify environment according to the occupant command. First, the system must identify who is its occupant. Natural identification technique is face recognition that gives better solution. Applying face recognition, system could identify the occupant without disturbing the other people.
For years, face recognition become top issues in research paper. Several techniques were applied to propose better recognition. Changing in pose, expression variations and differences in the position of the light give difficulty to resolve in face recognition. Basically, face recognition can be approached with facial biometric features or statistical method. Facial biometric recognition technique offers high accuracy with long calculation. Hence, statistical approaches offer speed calculation. Due to the speed, a statistical approach is applied more widely than facial biometric [1]. Principal Component Analysis (PCA) and Linear Discriminant Analysis (LDA) are two popular statistical approaches in face recognition.
Several studies had shown that PCA (known as Eigenface) and LDA (known as Fisherface) method had high accuracy in face recognition [2]. Both of these methods calculated eigenvalues of face image. Calculation of eigenvalues required long steps. Several methods were proposed to improve them in accuracy and speed. Arif improved the Fisherface efficiency by calculate it in two-dimension. The improvement gave good result in 100% accuracy [3]. Twodimension calculation takes more steps with time-cost consequence. Wijaya combined holistic feature and linear discriminant analysis to reduce the training time and keep the accuracy [4].
However, the previous works were applied on computer equipped with high-power processor. Since energy conservation is one of key issues in smart building research, low power processor becomes interesting topic to be investigated and evaluated of face recognition. Based on Yong et al survey [2], K Nearest Neighbor (KNN) placed third rank after PCA and LDA on accuracy and KNN placed first rank on processing speed. In this study, we interest to measure how suitable KNN applied in low power processor compare with PCA/Eigenface and LDA/Fisherface.

K-Nearest Neighbor
K-Nearest Neighbor (KNN) is data classification method that can be used as face recognition method. Each pixel in face represents unique information. This paper recognized face based on each pixel classification. Face was determined by most class resulted in each pixel classification. In recognition, pixel matrix of face image should be reshape into vector before classification. The proposed KNN face recognition algorithm is described as follows: 1

Implementation
The proposed method was implemented with OpenCV library [6] in C language to ensure fast image processing. Raspberry Pi which was equiped with ARM11 700MHz core, was selected to be main processing unit. Overall algorithm that was implemented in video face recognition system, was shown in Figure 1. Main process recognized face continuously by capturing a picture from attached webcam perodically. Captured image was pre-processed by applying face detection. Haar-cascade was applied due to its robustness in face detection. Preprocessed image would be processed by proposed face detection method. The whole process would be repeated so as to produce a video-based face recognition.

Results and Discussion
Tests were conducted to evaluate performance of proposed algorithm. Tests carried out with three face dataset which are ORL [7], Yaleface [8] and MUCT [9] dataset. Before applying as training dataset, every images was applied face detection and equalized in same size. The result of preprocessing showed that some faces could not be used as dataset. The 296 ORL faces, 156 Yalefaces and 3644 MUCT faces would be used as training and testing data. Figure  2 shows the overall images that are used in training and testing.  First testing was conducted in 10-fold Cross Validation. Figure 3 showed how to determine training and testing images. Accuracy on each fold was calculated. Tabel 1 was detail accuracy on each fold in ORL dataset. The total accuracy was calculated on average of 10-fold. Table 2 shows the results of accuracy in different k value on several dataset.
Based on Table 2, KNN done best accuracy on k equal to 1. It showed that KNN gave 91.5% on 295 ORL faces, 78.8% on 156 Yalefaces and 70% on 3644 MUCT faces. Enormous number of MUCT dataset made the system confuse in recognition. K was equal to 1 and ORL dataset would be used in next test due to its best result. The next phase test was to compare the proposed method with Eigenface and Fisherface. Tests carried out to obtain information on how feasible the proposed method when implementing in low-power processor. Tests conducted on computer with Intel Core i7, 2.8 GHz and Raspberry Pi with Broadcom ARM11, 700MHz. The accuracy and execution time would be compared. Accuracy testing was held on same scenario of k-value adjustment. The final results of testing were shown in Table 3 and Table 4.  Table 3 showed that face recognition execution time on computer was not more than 4 seconds. Table 4 informed that execution time of fisherface and eigenface increased significantly into 299.7 seconds and 234.3 seconds respectively in low-power processor. Both of these popular methods were not appropriate low-power processor due to its long execution time. The proposed method took shorter time than the eigen or fisherface. This fact confirmed that KNN was proper face recognition method in low-power processor. On next scenario, KNN would be selected as the recognition method.

Tabel 3. Face recognition on computer
Final test aimed to observe performance of continuous face recognition on low-power processor. Experiment applied face detection by Local Binary Pattern and Haar-Cascade. Detection result was recognized by KNN. Experiment was done by showing printed test image on online camera. The camera captured image. Figure 4 shows the face detection and recognition process on low-power processor.   Experiment evaluated CPU load and memory usage of continuous face recognition on several camera pixel size. The system show different CPU Load and memory on each resolution. Detail CPU Load and memory usage was shown clearly on Table 4. Smaller camera resolution delivered smaller memory usage. CPU load shown anomaly between various resolution. The experiment shown that 640 x 480 resolution gave optimum in CPU load and memory usage. The resolution produced not high CPU load and memory usage. Experiment also performed face recognition 30 times sequentially and recorded each execution time. Based on Table 5, the average time of the face recognition process was 2.66 seconds on embedded systems. Test results showed that KNN face recognition was feasible to be implemented on embedded systems.

Conclusion
The research concluded some informations about face recognition on low-power processor. K-Nearest Neighbor face recognition delivered best accuracy 91.5% on k=1. KNN showed the faster execution time compared with PCA and LDA. Time execution of KNN to recognize face was 0.152 seconds on high-processor. Face detection and recognition only need 2.66 second to recognize on low-power ARM11 based system . Overal proposed method work well on low-power processor. Appropriate face detection on low-power system have potentialy to boost recognition.