INTERNSHIP

18
Department of Computer Science & Engineering Sikkim Manipal Institute of Technology A PRESENTATION ON MACHINE LEARNING IN IMAGE PROCESSING FOR FACE DETECTION USING HISTOGRAM OF ORIENTED GRADIENTS BY VISHAL SRIVASTAVA CSE 7 TH SEM. SEC ‘A’ REG. NO : 20130226 UNDER THE GUIDANCE OF: PROF. RAJIB GHOSH ASSISNTANT PROFESSOR NATIONAL INSTITUTE OF TECHNOLOGY PATNA DONE AS A PART OF SUMMER INTERNSHIP PROGRAM AT NIT PATNA

Transcript of INTERNSHIP

Page 1: INTERNSHIP

Department of Computer Science & EngineeringSikkim Manipal Institute of Technology

A PRESENTATION ON

MACHINE LEARNING IN IMAGE PROCESSING FOR FACE DETECTION USING HISTOGRAM OF ORIENTED GRADIENTS

BYVISHAL SRIVASTAVACSE 7TH SEM. SEC ‘A’REG. NO : 20130226

UNDER THE GUIDANCE OF:PROF. RAJIB GHOSH

ASSISNTANT PROFESSORNATIONAL INSTITUTE OF TECHNOLOGY PATNA

DONE AS A PART OF SUMMER INTERNSHIP PROGRAM AT NIT PATNA

Page 2: INTERNSHIP

ABSTRACT

• With the advent of devices that penetrate every aspect of our daily lives, it’s very important to ensure maximum security when it comes to authentication of devices as well as for identity purposes. Machine Learning in Facial Recognition Systems is a very important aspect for identifying individuals as well as in identity and authentication purposes. It has vast applications in surveillance systems, mobile authentication and individual identity revelation and confirmation.

Page 3: INTERNSHIP

INTRODUCTION• Face Recognition is a part of object and pattern recognition where objects are

classified using a particular feature and a model is prepared for the same. Depending on the feature being used for the model, templates for that particular object are created which act as a standard in isolating the object under considering from a given image.

• In this project, we shall deal with HOG features, i.e., Histogram of Oriented Gradients features which is discussed latter in details.

• The project can be sub-categorized into the following parts: • Selecting the feature to be extracted • Collecting image samples & preprocessing them • Extract the features required • Train the model • Match components with query image • Display Closest match

Page 4: INTERNSHIP

OVERVIEW

Page 5: INTERNSHIP

LITERATURE SURVEY• Bin Lia, Guang Huo recently illustrated the mechanism of face detection and

recognition using Locality Sensitive Histogram of Oriented Gradients (LSHOG). They proposed that the traditional histograms of oriented gradients (HOG) divide an image into many cells, and computed a histogram of gradient orientations over each cell.

• First, we use LSHOG to extract feature vectors of face images. Then, to show how different dimension reduction algorithms affect recognition accuracy, we choose several typical dimension reduction algorithms to reduce the dimensions of feature vectors of face images. They evaluated LSHOG and our proposed face recognition method on four benchmark face databases. Experimental results verify the feasibility and effectiveness of LSHOG and our face recognition method.

Page 6: INTERNSHIP

DATASET• The database consists of 40 different individuals where there are 10 samples

of non-standard RGB images per person. The individuals are marked from 1 to 40 and their samples are marked 1 to 10. These images are then further subjected to preprocessing softwares and algorithms to convert them into standard images.

TRAINING AND TEST DATA SET• The most important part for preparing a learning model is training the classifier. • The database is partitioned into 2 parts as: • Training Set (80 %) • Testing Set (20 %) • This means that 80 % of the data (images) of every individual are used for preparing the training

data-set and rest 20 % is used for testing the Algorithm.

Page 7: INTERNSHIP

PRE-PROCESSING OF DATA

Page 8: INTERNSHIP

FEATURE EXTRACTION AND TRAINING

EXTRACTING HOG FEATURES

The Computer Vision API for MATLAB provides for the necessary tools the extract the HOG Features for a given Image sample. Following is the Code with the detailed explanation for the same.

extractHOGFeatures • Extract histogram of oriented

gradients (HOG) features • o Syntax • features = extractHOGFeatures(I) • [features,validPoints] =

extractHOGFeatures(I,points) • [___, visualization] =

extractHOGFeatures(I,___) • [___] =

extractHOGFeatures(___,Name,Value)

Page 9: INTERNSHIP

TRAINING & PARTITIONING

• The most important part for preparing a learning model is training the classifier.

• The database is partitioned into 2 parts as: • Training Set (80 %) • Testing Set (20 %)

• This means that 80 % of the data (images) of every individual are used for preparing the training data-set and rest 20 % is used for testing the Algorithm.

• The following code illustrates the portioning of the database: • % Splitting database in Training Sets & Test Sets • [training,test]=partition(facedatabase,[0.8 0.2]);

Page 10: INTERNSHIP

CLASSIFICATION• The choice of model is a very sensitive topic as it determines the accuracy of

the algorithm which we are implementing. • In this case we are using ‘fitcecoc’ classifier which is the Fit multiclass models

for support vector machines or other classifiers: SYNTAX:faceClassifier=fitcecoc(trainingFeatures,trainingLabel);

FEATURE VECTOR

The result of the above code is a 2-D Matrix , i.e., The training feature vector which looks like as shown below:

Page 11: INTERNSHIP

RECOGNITION• Once the model is prepared and ready the testing phase is carried out. This is

done using the Test Data-Set that we had earlier partitioned during initial stages. Several Test samples are taken as query images whose HOG features are extracted and then it is looped through to find the best matched class for the given input.

• The sample results are illustrated:

CASE 1: CORRECT MATCH

Page 12: INTERNSHIP

CASE 2: INCORRECT MATCH

Page 13: INTERNSHIP

RESULTS AND ANALYSIS USING SVM • SUPPORT VECTOR MACHINE

• Support vector machines (SVMs) are supervised learning models with associated learning algorithms that analyze data used for classification and regression analysis. Given a set of training examples, each marked for belonging to one of two categories, an SVM training algorithm builds a model that assigns new examples into one category or the other, making it a non-probabilistic binary linear classifier. An SVM model is a representation of the examples as points in space, mapped so that the examples of the separate categories are divided by a clear gap that is as wide as possible. New examples are then mapped into that same space and predicted to belong to a category based on which side of the gap they fall on.

• USING libsvm (SVM Library) • The predictive analysis is carried out using libsvm. The training & test feature vectors are

converted into suitable format before carrying out further processing using code. We have 400 image samples, with each image having a feature vector of size 4680, analysis was carried out and results are shown later below.

• Proper scaling of training feature vector gives us more accurate results. • The Analysis is done in 3 steps: • Scaling • Training • Prediction

Page 14: INTERNSHIP

SCALING • Syntax: • svm-scale –l <lower bound> -u <upper bound> -s abc TrainSet.dat >

ScaledSet • Fig: 8.1 Scaling the Trained & Test Data Set

Page 15: INTERNSHIP

TRAINING • Syntax: svm-train TrainedData.dat • Fig:

Page 16: INTERNSHIP

PREDICTION AND ACCURACY: • Syntax: svm-predict test_data.dat trained_data.model a.out • Fig:

Page 17: INTERNSHIP

REFERENCES

• Face recognition using locality sensitive histograms of orientedgradientsBin Lia, , Guang ∗HuobaSchool of Information Engineering, Northeast Dianli University.

• I.T. Jolliffe, Principal Component Analysis, Springer-Verlag, New York, 1989. • H. Yu, J. Yang, A direct LDA algorithm for high dimensional data with applicationto face

recognition, Pattern Recognit. 34 (2001) 2067–2070. • Face Recognition Algorithms, Proyecto Fin de Carrera, June 16, Ion Marqu´es, • http://www.intechopen.com/books/face-recognition/feature-extraction-and-representation-for-

face-recognition • http:// Wikipedia.org/wiki/Support-vector-machine • http://scholastictutors.webs.com

Page 18: INTERNSHIP

THANK YOU