Face Liveness Detection based on Local Diffused Patterns

DOI : 10.17577/IJERTV9IS090219

Download Full-Text PDF Cite this Publication

Text Only Version

Face Liveness Detection based on Local Diffused Patterns

Meghana P S1, Akhila S 2

Dept. of ECE,

B.M.S. College of Engineering, Bengaluru

Abstract – Biometric systems are widely used in many application for authorization of a person which is based on either behavioral characteristics or physical. Face liveness detection technique is used in various authentication scenarios (Adhar card, passport, swiping badges for entry and exit, etc.). And the face can be spoofed using various methods such as screenshot, taking a picture of a 2D face. The proposed work is to discuss the method to distinguish the persons face is live or non-live face. This method depends on the diffused patterns of live and fake faces. To extract the face features, RGB image is converted to HSV,(hue, saturation, value) its mean and standard deviations are calculated. The pattern skewness is calculated at each pixel position to apply liveness detection algorithm as a input for the linear support vector machine for classification. By last, proposed work effectively distinguishes the live and non-live face using MATLAB tool.

Key Words: Features, Skewness, histogram, Point spread function, Support vector machine


    In the field of image processing, there has been an exponential development over the past few years. Now a days, to process large bytes of data computers are becoming faster and smarter. Object verification and recognition has gained attention in many field because of its usage in industries such as packing, manufacturing etc. To identify the product, common example is super market that uses a barcode and other encryption techniques. In order to find the accurate position of the object, manufacturing unit employs a security device. Computer vision allows the computer to sense the object and process the desired information at prescribed speeds.

    Detection of face is a part of the object detection. It can be distinguished into two classes with face and without face. These applications should locate the face position in the video or image. Also in the recent years, it has been included a much needed security aspect in biometric systems. Few of the key implementations of detecting a face are the a smart phones selfie or a front sided camera biometric systems, detection of a human presence. In the 2D frame, face detection senses the absence or presence of the face. For detecting the face several approaches and methods are developed. Its the challenging task for face recognition system to identify live and fake face against the spoofed attack

    Figure.1 Liveness detection in face recognition system

    Figure-1 represents a block diagram of a traditional liveness detection system. It accepts an input from the sensing device, detects & preprocesses detected face, applies liveness detection algorithms and determines whether the input image belongs to actual live user.

    Attack classification is based on the usage of verification proof, such as vedio, photo or module of a face with eye blinking, movement of lip and various fexpressions of face and so on. Detection of liveness for face recognition system based various methods as, frequency spectrum based, motion based or quality based. During the recent years, liveness detection has been identified as a challenging and crucial security issue which deals with the trustworthiness of biometric system security against spoofing attacks, Therefore, Liveness detection or anti spoofing in biometrics systems has achieved great progress in the recent years.

    To extract the features of the image, RGB [Red, Green, Blue] format is converted to HSV [Hue, Saturation, Value] its mean and standard deviations are calculated. The local pattern of the skewness is calculated at position of each pixel to apply liveness detection algorithm. Linear support vector machine is used for classification of live and fake faces


    Face liveness detection method is discussed and uses the concept of diffusion speed to get the valuable information to differentiate the live face from the fake face by conducting nonlinear diffusion on the face image to get the diffused image[1],obtains identity authentication for face recognition by presenting the downloaded and candid videos or printed videos to the sensing device. The classication based on face map feature (local binary), which is extracted to determine whether the face map is a live face or a fake face[2]. In face detection,

    an arbitrary image is given, the main objective is to detect upper body, eyes and to finding whether there are any faces in the image[4]. Since, its a very crucial task for computer systems, the difficulty included with detection of face can also be attributed to many variations in location, view point, illumination, scale, occlusions. Face liveness detection system named IriTrack, iris trajectories are compared to perform detection with the randomly generated patterns. Each module in IriTrack does not require special hardware and is easy to implement on devices. Extensive experimental results demonstrated the effectiveness of IriTrack in fending against video-based spoofing attacks. But efficiency and compatibility of the proposed system is low[5].


    Set of live and fake images and test images obtained by database. Once the input image is taken, face is detected by bounding box. Figure.2 depicts a block diagram of the proposed methodology. The features of the normalized image are extracted using RGB and HSV format. SVM classifier is trained with live and non-live features. Test image is given as input, and its features are compared with SVM classifier features which are already trained. Liveness level is calculated. SVM Decides input image belongs to live face or fake face.

    Figure 2: Overall process of the proposed system

    The technique depends on the distinction in the illumination characteristics of live and fake face. When light falls on the live face, it reflects randomly in different directions due to its 3D surface (lip, nose, etc.), whereas light reflects uniformly from the planer 2D surface of the fake face such as a photograph, electronic screen. The illumination energies incident on a 2D surface are evenly distributed and hence they diffuse gradually, though those with a live face diffused non-uniformity [2].

    3.1 Algorithm for a test image

    First step is to train SVM classifier with different fake and live faces. Once the features are extracted from those image, test image is given as input to determine whether it belongs to live user or non-live user.

    Step 1: go to cd .. and give the test image name which has to be checked for classification.

    Step 2: Read image with .jpg format

    Step 3: Detect a face within a image using bunding box. Liveness detection procedure can be proceeded if and only if face is detected within the box.

    Step 4: Convert RGB format to HSV format.

    Step 5: Calculate the Means and standard deviation of H,S,V Step 6: Determine the skewness factor using Mean and standard deviation. And find minimum and maximum value of H,S,V

    Step 7: calculate the motion blur using PSF function

    Step 8: Find the edge of the normalized image e1 and edge of the blur region e2.

    Remove blur= sum(e1-e2)/RxC

    Step 9: Store the skewness values of normalized image and concatenate. Find out the histogram values of normalized image (H)

    Step 10: Compare the histogram values of normalized image, if the feature is same increment out else increment out1. Out is considered as positive features belongs to live face out1 is consideed as negative features.

    Step 11: Store all the values in QF.

    Step 12: compare stored values with trained image values, if the outfuse is -1 then it is live face else fake face.

  4. Implementation and results

    Figure.3, Shows the image set from the internet datbase. It consists of live and fake faces which are used to train the SVM classifer. Each test image is given with different name to check whether face belongs to live or fake face.

    Figure.3 Image set from internet database

    Fig 4.1a and 4.2b shows the detected face within bounding box, cropped face and normalized image for the given input image. Classified as live face and non live face,[ outfuse =out x out1

    =-1 (live face)] [outfuse =out x out1 [fake face]. 5.1a and 5.1b shows the histogram of the normalized image.

    The horizontal or the x axis of the histogram graph indicates the intensity value, while the total number of pixels are represented by the vertical or y axis at that intensity in particular. At the horizontal axis of left side represents the dark areas, the middle of the graph values represents mid-tone values and light areas are represented by the light areas. Therefore, a very dark image in the histogram will be having most of its points of data are on the center and left side of the graph.

    4.1a Live image

    4.1b Fake image

      1. a Histogram of normalized live image

      2. b Histogram of normalized fake image


In the identity authentication system face recognition plays an important role.In the image processing field vision of machine is a powerful tool and it is the key component to overcome many of the difficulties to obtain the mathematical equation and model of live photos and spoofed images. This carries on the study of facial feature detection based on different local patterns and its skewness.Approached for sppofing detection based on texture of patterns that distingushes the real face from non live ones.Inspired by the image quality assessment and from differences in reflection of light. Indeed, prints of face significantly contains quality of printing defects this can be very well detected by the use of texture patterns. Also, prints and faces reflects light in various ways since face is 3D object where as photograph could be seen as a plane rigid object. It causes specular shades and reflections. In the proposed approched local patterns are encoded to enhanced feature histogram and skewness values.The result is fed to SVM classifier to determine live or spoofed face.Experiments on the photos taken handy and publicly available databse containing face showed excellent results.Proposed approch is robust, computationally fast and doesnt require user involvement and can also be used for face recognition. This work has been performed within the MATLAB R2018a. It can be believed in future this approach can also be extended for detecting spoof attack using 3D models or masks since skin has very particular, live and non live face skewness and histogram values differs.


  1. Gautam Pallavi.,Jayash Kumar Sharma., Face Liveness Detection using Local Diffused Patterns International Journal of Computer Applications (0975 8887) Volume 149 No.4, September 2016

  2. Xiaolei Liu., Wei Liu., Face Liveness Detection Based on Enhanced Local Binary Patterns.2017 Chinese Automation Congress (CAC) , 978- 15386-3524

  3. Bahajathul Fathema., Alamuri Dedeepya Lakshmi., Bandlamudi Ravali., Raja Rajeswari Dokku., Real Time Face Detection Using Matlab. International Journal of Engineering Research & Technology (IJERT)Vol. 7 Issue 02, February-2018

  4. Chun-Hsiao Yeh ., Herng-Hua Chang Face Liveness Detection Based on Perceptual Image Quality Assessment Features with Multi-scale Analysis 2018 IEEE Winter Conference on Applications of Computer Vision. 978-1-5386-4886-5

  5. Meng Shen, Zelin Liao, Liehuang Zhu, Rashid Mijumbi, Xiaojiang Du, and Jiankun Hu IriTrack: Liveness Detection Using Irises Tracking for Preventing Face Spoofing Attacks IEEE 8 oct 2018

  6. Pan, G., Sun, L., Wu, Z., & Lao, S. (2007). Eyeblink- based Anti- Spoofing in Face Recognition from a Generic Webcamera. 2007 IEEE 11th International Conference on Computer Vision

  7. J. Maatta, A. Hadid, M. Pietikainen, Face Spoofing Detection From Single images Using MicroTexture Analysis, Proc. International Joint Conference on Biometrics (UCB 2011), Washington, D.C.,USA

  8. K Kollreider, H Fronthaler, J Bigun, Non-intrusive liveness detection by face images. Elsevier Image and Vision Computing 27, 233244 (2009)]

  9. https://www.pyimagesearch.com/2019/03/11/liveness-detection-with- opencv/

Leave a Reply