The proposed algorithm is elucidated in Fig. 1. Face detection; alignment and enhancement are achieved by using standard algorithms available in OpenCV library. The face image is normalized as preprocessing step to convert the complete dataset in the common range. Normalization process helps to handle various image datasets having different size and format of face images. Face identification is accomplished by extracting the required features using modified LBP. The LBP features are further reduced using proposed technique and the reduced features are stored along with Face ID. The stored features are uploaded on cloud or on IoT device for real time deployment. Once system is deployed and any face is detected by the camera the features are extracted and reduced in real time for recognition. If the face is recognized from the database, the name and identity are displayed otherwise the face may be registered in the database for future recognition. The authors tested this system on raspberry Pi board but this can be further extended to other IoT devices.
Pseudo code of the proposed algorithm is as follows:
Training Phase:
-
Step 1: Normalize the dataset to convert the dataset by substracting the mean image and divide by variance. Also divide the image into 8 × 8 bins for computation of Local Binary Patterns
-
Step 2: Apply Local Binary Pattern of each image using uniform LBP.
-
Step 3: Create histogram of each bin and concatenate the histograms to get global histogram
-
Step 4: Apply Chi Square transformation of the resultant image to achieve Gaussian distribution
-
Step 5: Store the transformed data into the requisite format into the csv/xml file.
Testing/Deployment Phase:
-
Step 1: Read the stored csv/xml file.
-
Step 2: Input image from Camera/DataSet for recognition
-
Step 3: Apply LBP, Chi Square Transformation as per training on this single image.
-
Step 4:Compute Chi Square Distance of test image to all the images in the dataset and Classify the image to the minimum error class.
Testing/Deployment can be done on a local Machine or on IoT devices. In case of IoT device csv/xml file and trained model need to be deployed on IoT device.
Optimize computational efficiency
The proposed Chi-square transformed fast subspace LBP algorithm described as: Initially, uniform \( {LBP}_{8,2}^{u^2} \) is extracted the feature of a query image where subscript 8,2 represents eight neighbours at a distance of 2. Superscript u2 stands for using codes for uniform patterns and one code for all other patterns. The central pixel denoted as (xc, yc), P denotes the
$$ {LBP}_{P,R}\left({x}_c,{y}_c\right)={\sum}_{P=0}^{P-1}S\left({i}_c-{i}_p\right){2}^P $$
(1)
sampling points on a circle with radius R, ic and iP denotes, gray-scale values of the central pixel respectively [3]. Thresholding function S(a) may be defined as
$$ S(a)=\left\{\begin{array}{c}1, if\ a\ge 0\\ {}\kern0.5em 0\ otherwise\end{array}\right\} $$
(2)
$$ {h}_{LBP}=\sum \limits_aS\left({f}_{LBP}(a)\right),P $$
(3)
The hLBP is features histogram calculated by the standard LBP algorithm. Further, Chi-Square transformation is performed to make the distribution of the PDF of LBP as Gaussian thereby optimum usage of extracted LBP features is achieved.
This Chi square transformation is performed by taking two samples of LBP features denoted as ‘a’ and ‘b’. These samples further introduce another feature vector x = {x1, x2, x3………. xd} where each element of xi is represented as:
$$ {x}_i=\frac{a_i-{b}_i}{\sqrt{a_i+{b}_i}} $$
(4)
To evaluate the Chi squared distance the normalization of ‘x’ is performed as:
$$ {x}^Tx={\sum}_{i=0}^d\frac{{\left({a}_i-{b}_i\right)}^2}{a_i-{b}_i} $$
(5)
Now, the fast sub space decomposition is applied on the input LBP feature ‘x’ for the dimensional reduction as:
$$ x(t)=A\left(\theta \right)s(t)+n(t) $$
(6)
Where s(t) is the LBP feature histogram, A(θ) is the subspace span with the dimension ‘d’, n(t) represents additive noise and x(t) is the array output observed at time ‘′t ′ = 1, …. , N. In order to remove the unreliable features, the co-variance matrices of signal x(t) is calculated as:
$$ {W}_x=E\left\{x(t){x}^H(t)\right\}=A\left(\theta \right){W}_s{A}^H\left(\theta \right) $$
(7)
Where Ws is the co-variance matrix of the signal and the decomposition of Wx signal for the finite number of features ‘N’ (say) can be written as:
$$ {\hat{W}}_x=\frac{1}{N}\sum \limits_{t=1}^Nx(t){x}^H(t) $$
(8)
\( {\hat{W}}_x \) is the signal subspace and its dimension is calculated from the ‘d’ eigenvectors {e1, ……., ed} of \( {\hat{W}}_x \). Now the task is to calculate the optimal value of ‘d’ so that non-repeated feature of the LBP histogram can be extracted. The length of ‘d’ can be evaluated using the non-repeated Eigen values of the co-variance matrices [37]. This optimal length of ‘d’ is calculated by taking new statistics in consideration as reported in [37]. The extracted features of the trained data set are reduced by the signal subspace vector. Thereafter, the trained data set is stored in the system memory and the signal subspace vector extracts the optimal features for all the testing samples.
Recognition
The proposed approach reduces features of histogram of the trained data set stored in the system memory. For the recognition of the given query image, the reduced feature histogram can be computed. Thereafter minimum distance of the features is calculated by Chi square distance.
Various feature similarity approximation techniques between the test image features histogram and stored trained image feature histogram such as log-likelihood, Euclidean distance, histogram intersection technique and Chi square distance are probed. In the proposed work, Chi square distance calculation is used for recognition. Further authors substantiate that after applying weights to the unique features on the image gives better results in terms of accuracy and time complexity. The extracted feature image and the histogram vector is shown in Fig. 2.
Proposed architecture for IoT applications
The proposed architecture is shown in Fig. 3. The High end server in the architecture is used to store dataset, module training. The trained model and the computed features are then stored in the common dataset. This common dataset is either on cloud or inside IoT device memory. The IoT Gadget is used to deploy the model in real time. The gadget is also connected to cctv/web camera for real time input. The trained model inside the gadget will work as Identfication module for all applications like Employee Identification use Face, Security Surveillance in Industries and Security device for Vehicles. The computed decision can further be communicated to mobile device for further actions.