Motion Detection and Face Recognition For CCTV Surveillance System

Closed Circuit Television (CCTV) is currently used in daily basis for a wide variety of purposes. The development of CCTV has transformed from a simple passive surveillance into an integrated intelligent control system. In this research, motion detection and facial recognition in CCTV video is used as the basis of decision making to produce automatic, effective and efficient integrated system. This CCTV video process provides three outputs, motion detection information, face detection information and face identification information. Accumulative Differences Images (ADI) method is used for motion detection, and Haar Classifiers Cascade method is used for face detection. Feature extraction is done with Speeded-Up Robust Features (SURF) and Principal Component Analysis (PCA). Then, these features are trained by Counter-Propagation Network (CPN). Offline tests are performed on 45 CCTV video. The result shows 92.655% success rate on motion detection,76% success rate on face detection, and 60% success rate on face detection. It shows that this faces detection and identification through CCTV video have not been able to obtain optimal results. The motion detection process is ideal to be applied in real-time conditions. Yet if it’s combined with face recognition process, it causes a significant time delay.


INTRODUCTION
CCTV has been used daily for many purposes such as crime investigation, traffic control, chemical process record, production control, and security surveillance.Public places such as offices, hospitals, shops, tourism resorts and also houses install CCTV for Security surveillance.In its development, the use of CCTV has transformed from passive surveillance into integrated intelligent surveilance system [1].
One of CCTV's drawbacks is the operator has to control record the whole time and identify faces manually.It also produces a large amount of data since the surveilance is done continuously [2].Its drawback in less effective manual surveillance and its big need of memory can be reduced by setting an intelligent system which is integrated with CCTV in order to automatically produce surveilance system and data control.
Office is one of the places where CCTV is used at most for surveillance system as the main purpose.The intelligent surveillance system using CCTV video data in offices can be installed for some purposes, for example motion surveillance, data storage control, access control, warning alarm control, and employee's attendance.In order to make CCTV data the basis of the decision, it is necessary to process CCTV data to provide various information.This research is done to process CCTV videos to gain information on motion, face detection, and face identification in places monitored by CCTV.
Face detection process is an inseparable part of face recognition process.Face detection using Viola-Jones method is widely used because it produces high accuracy on face detection.One of the research using this method is research [3].Research [4] also uses AdaBoost algorithm approach in face detection process to count the number of the faces in a classroom.
Face recognition system [5] is built by implementing Speeded-Up Robust Features (SURF) for face pattern extraction and Support Vector Machine (SVM) for classification method.The result of this research shows that the system succeeds in dealing with variation in illumination, perspective, expression and scale.Research [6] and [7] uses face pattern recognition for attendance system application.Researh [6] develops attendance system by capturing students' images using the camera set in the front part of the classroom.In research [7], the camera is set on the classroom door to record their faces naturally.These research applies Viola-Jones method for detection and Eigenface for identification.
Research [8] develops web-basis application for face detection at real time background used as employee's attendance.In face identification process, PCA is used for face pattern recognition and Haar Cascade method is used for face detection.This system has been tested and makes 68 % accuracy of face recognition.It is also used for security surveilance system.Research [9] builds access control system automatically.It uses Viola-Jones method for detection process, and PCA for face identification.Research [1] develops an intruder warning system for house safety.If an excessive movement is detected, system will detect faces with Eigenface algorithm.If it can't identify faces, it will send a warning and pictures to the house owner's mailbox.This face recognition test system makes 62% accuracy.
This research uses motion detection and face recognition for surveilance system through CCTV.This process involves Accumulative Differences Images (ADI) method for movement detection, Cascade Classifiers (Haar Cascade Classifiers) for face detection, Speeded-Up Robust Features (SURF) algorithm and Principal Component Analysis (PCA) for feature extraction and reduction, and Counter-Propagation Network (CPN) algorithm for data training and testing in face identification proces.
ADI method used by comparing image differences on some sequential frame can minimize error better than a method that can only count motions from two frame on each process.This method is preferred because of its simplicity that can save computation time.Haar Cascade Classifiers as a face detection method is believed to be able to process images fast and 109 produce a good detection succes [10].The use of this method is expected to produce a good face accuracy as in research [3].SURF algorithm used in feature extraction has some benefits.It can detect feature fast, describe a feature in a unique way and has invariance toward transformation and noise.SURF implementation method is expected to be able to overcome variation in illumination, perspective, expression and scaling, as in research [5].It is hoped that the research using Prinsipal Components Analysis (PCA) which is started with extraction by SURF algorithm can give better accuracy on face detection than that in research [1] and [8].It is also anticipated that PCA can extract prominent and influential specific features and eliminate data redudancy.
In training and testing process of face identification test, CPN algorithm is used for it has high accuracy in pattern recognition process and is built with simple algorithm to save computation [11].

Research Design
This research is designed with four main processes : motion detection process, face detection process, data training process, and face identification process.In general, the architectural design of the research can be seen in diagram of Figure 1.
The first step is by acquiring video images from CCTV.Those images will be used for motion detection process.If a motion is detected, the information of time stamp and images with detected motion will be stored.Then, the motion value will be compared to face detection threshold.If the motion exceeds it, the face recognition process will be committed.Images with detected motion will be the input of face detection process.This process will decide if the face object exists.If it exists, detection information will be recorded and continued to face identification process.
In face identification process, the face features is tested by using the value gained from data training and matched with data basis.The data training process is done before testing the face identification by using the same image processing.Face identification process produces decision and record the identity of the identified face.
The collected data in this research is in the form of video file and was taken in PT.Mitranet Software Online Purwokerto for five days.The videos were taken indoor by CCTV at 07:45 -08:45 IWST, 12:00 -13:00 IWST, and 15:15 -16:15 IWST.The CCTV video resolution is 960 x 720 and 640 x 480 with 10 fps frame per second.There are 90 video files with 10 minute duration each.Of those 90 files, 45 videos are trained and the rest is tested.

Image Enhancement
Image Enhancement is a process of image manipulation using certain operations to gain quality based on a specific application purpose.The enhancement that will be applied are histogram equalization and gamma correction.Histogram equalization is good to enhance the contrast on image, but sometimes the intencity produced are too dark or too light.To overcome this problem, enhancement continued with gamma correction.

Accumulative Differences Images (ADI)
In this research, motion segmentation is carried on using ADI.In this method, not only one but some images are compared to references.Comparison results between the referrent images with tested images will be accumulated and compraed to certain threshold [12].For example, f(x,y,t 1 ) = R(x,y) is the referrent image and f(x,y,t k )= f(x,y,k) is the k-image where k>2, therefore, ADI value can be defined in equation ( 1).
(1) Next, determine the threshold which sets the accumulation limit.This limit determines the presence of motion.If it exceeds the threshold, the image has motion.

Haar Cascade Classifier
Haar Cascade Classifier algorithm is a learning machine approach to detect an object which is able to process images fast and results high detection.This method uses three key The size and location of each kernel is used to calculate Haar feature value.This procedure will produce a large number of feature value.We need to use integral image method to count it fast.With this method, this operation only takes 4 main pixels whatever the amount of the pixel in one image is.

AdaBoost-based algorithm learning
All image features calculated with integral image are mostly irrelevant.A feature may be a good feature for a region with suitable property.For other areas, the same feature might be irrelevant.The best way to choose a feature can be done by using AdaBoost algorithm.

Cascade method for merging classifiers
Cascade structure increases the speed of the detector by focusing on areas where there are objects in the image.The best features will form a strong classifier which classifies faces into postive and negative images.Here, classifier is applied in order to reject the non-face sub-window.The whole process of this detection process is aimed to grow a decision tree called cascade as shown in Figure 2.
Figure 2 Detection scheme with cascade classification

Speeded-Up Robust Features (SURF)
There are three main steps when using SURF, they are integral image, feature detection and feature description.Feature detection uses integral image by applying blob-like feature and is done as follows.
1. Do convolution using the second partial derivative box filter approximation of Gaussian.Use bigger size when doing convolution to shape a pyramid image.The result of convolution will form Hessian matrix.It is used because it has a good performance on both computation and accuracy speed.
2. In order to bear up the detected features from scaling, find the Hessian matrix extrema 3. Do localization for the feature candidate on each space scale using non-maximum suppression method.The extrema of Hessian matrix determinant is interpolated with quadratic 3D which shows Hessian function.
SURF descriptor needs definition on feature orientation in order to bear up rotation.The value of SURF descriptor is Haar Wavelet toward x and y directions which refers to dx and dy.It is a region of 20s.Each region is split into 4x4 sub-region.Each sub-region is explained by HaarWavelet response based on sample 5x5 with a four-component vector.Finally, there are 64 Surf descriptors in each feature.PCA is a statistic procedure using orthogonal transformation which converses correlated variables into uncorrelated fewer variables called Principal Component.PCA method can extract dominant specific feature and eliminate data redundancy.
The steps of PCA method are as follow: 1. Prepare a set of testing data in the form of vector 2. Find the median of the data 3. Find the difference between the tested data and the median 4. Count the covarian matrix value 5. Calculate the eigen vector and value of covarian matrix 6. Find the main component based on the biggest eigenvalue and use it to transform data to different subspace.

Counter-Propagation Network
This research will use Counter-Propagation Network (CPN) model which is a combination of unsupervised learning method with Kohonen layer and supervised learning with Grossberg layer.There are two types of CPN architecture, they are Full CPN and Forward-only CPN.This research uses Full CPN.There are 3 layers in CPN architecture.The first layer is the input layer, the second is cluster layer, and the third is the output layer representing the value of input value approach and output target.Figure 3 shows full CPN architecture.(Note :  and  value are small constant value during phase 2) S9 : For each training input pair of x and y, do step 10 to 14. S10 : Apply activation of input layer X to vector x and input layer Y to vector y.S11 : Find the winner cluster unit by using equation ( 2), mark index winner unit with J.The winner unit has the smallest z_in.S12 : Update weights into Z J , by using equation ( 3) and ( 4).S13 : Update weights from Z J unit to output layers by using equation ( 5) and ( 6). (

RESULTS AND DISCUSSION
The result of this research has three output information: motion detection, face detection, and face identification.The summary of the test result is as shown in Table 1.Next, some factors related to test success value are analyzed.The research implementation of motion detection and face identification for surveillance system using CCTV is shown in Figure 4.

The Result of Motion Detection
The face detection result explains an output information on time detection about when the motion starts and ends.This method involves three types of threshold: pixel difference threshold (t 1 ), image difference threshold (t 2 ), and motion threshold (t 3 ).
This research uses 5-video simulations to determine the best threshold value which will be used for motion detection.Face detection test is done by applying value t 1 =15, t 2 =0.001 and t 3 =10 which is the best threshold of the three.The simulation chart of the three motion detection threshold is shown in Figure 5.

Figure 3
Figure 3 Architecture of Fully Counter-Propagation Network

Figure 4 :
Figure 4 : The implementation of motion detection and face identification for surveillance system using CCTV video

Figure 5
Figure 5 Simulation chart to motion detection threshold

Table 1 The
Result of Motion Detection and Face Recognition