You are on page 1of 47

CHAPTER 1

INTRODUCTION

The face is our primary focus of attention in social intercourse, playing a major role in
conveying identity and emotion. We can recognize thousands of faces learned throughout our lifetime
and identify familiar faces at a glance after years of separation. This skill is quite robust, despite large
changes in the visual stimulus due to viewing conditions, expression, aging, and distractions such as
glasses or changes in hairstyle or facial hair. Computational models of face recognition, in particular,
are interesting because they can contribute not only to theoretical insights but also to practical
applications. Computers that recognize faces could be applied to a wide variety of problems,
including criminal identification, security systems, image and film processing, and human computer
interaction [1]. Unfortunately, developing a computational model of face recognition is quite difficult,
because faces are complex, multidimensional, and meaningful visual stimuli. The user should focus
his attention toward developing a sort of early, pre attentive Pattern recognition capability that does
not depend on having three-dimensional information or detailed geometry. He should develop a
computational model of face recognition that is fast, reasonably simple, and accurate.

Automatically learning and later recognizing new faces is practical within this framework.
Recognition under widely varying conditions is achieved by training on a limited number of
characteristic views (e.g. a "straight on" view, a 45 degree view, and a profile view). The approach has
advantages over other face recognition schemes in its speed and simplicity learning capacity. Images
of faces, represented as high-dimensional pixel arrays, often belong to a manifold of intrinsically low
dimension. Face recognition, and computer vision research in general, has witnessed a growing
interest in techniques that capitalize on this observation, and apply algebraic and statistical tools for
extraction and analysis of the underlying manifold [2]. Eigen face is a face recognition approach that
can locate and track a subject's head, and then recognize the person by comparing characteristics of
the face to those of known individuals. The computational approach taken in this system is motivated
by both physiology and information theory, as well as by the practical requirements of near-real-time
performance and accuracy. This approach treats the face recognition problem as an intrinsically twodimensional (2-D) recognition problem rather than requiring recovery of three-dimensional geometry,
taking advantage of the fact that faces are normally upright and thus may be described by a small set
of 2-D characteristic views [3].
T.K.M College Of Engineering

1.1

MOTIVATION
Gestures form a significant part of business communication. Mostly it is a form of visual

information supporting interpersonal audio communication. Nearly 55% of interpersonal


communication comes from facial expressions alone. Accurately interpreting the meanings of nonverbal communications, especially facial expressions, can make effective leaders and business
managers. In business settings, people often dont say what they really think. Facial gestures often
reveals the concealed emotions such as fear, contempt, disgust, surprise or even unspoken political
tensions in board or executive committee meetings. It also better equips them to handle sensitive
staffing situations such as performance reviews. Each emotion has more or less unique signals in the
face, so facial gestures are more reliable indicators of a persons emotional state than other body
language. At the same time such a system for facial expression recognition can be used for developing
a prototype for drowsiness detection. The development of technologies for detecting or preventing
drowsiness at the wheel is a major challenge in the field of accident avoidance systems.
In this project all these concepts have been considered in developing an automated system to
recognize facial expressions in video conferencing and use their interpretation towards business
decision support.
1.2 OBJECTIVES
The main aim of this project is facial expression (gesture) recognition. Gesture is a form of
non-verbal, action-based communication made with a part of the body and used with verbal
communication. Facial gestures often reveal when people are trying to conceal emotions such as fear,
contempt, disgust, surprise. Such facial signals which can be directly processed by suitable image
processing system. Facial gestures are more pronounced via eyes and lip region of human face and
hence they form the regions of interest [4] while processing the image. In this project we use all these
concepts to develop a system to recognize the facial expressions. Well developed existing procedure
could be used to locate the face in the stored images. The project is developed to recognize the facial
expressions in captured images using Principal component analysis

[1] and Support Vector Machine

[5]. Also a prototype for drowsiness detection is developed using the technology.

T.K.M College Of Engineering

1.3 MODULAR DESCRIPTION


The system is divided into three modules. They are as follows:
1. Image Capturing Module
2. Face recognition Module
3. Expression Checking Module

1.3.1 Image Capturing Module


This module in the software helps in capturing images through a web camera connected to the
system for processing. The system recognizes the capturing device and activates the device
through the program to capturing images. The captured images are then sent to the system to
further processing. The captures images will be a joint photographers experts group file in
which can be converted to binary format and can be stored in a byte array. The images are
sent to the face recognition module in the program
1.3.2

Face Recognition Module


This module helps in recognizing the face from the captured images and then produces the
recognized face. The face is the further processed by the Expression checking system.

1.3.3

Expression Checking Module


This module checks for the expression in the captured images. The processing is based on the

following Appearance based features.


The basic block diagram of the proposed system is shown in fig 1.1 [1]
Sensors and preprocessing: An amalgamation of hardware and software to capture gestures. Image
Acquisition using video frames capture, frames to image. Preprocessing using red, green, blue to gray,
scaling, smoothing, cropping etc...
Gesture Recognition and Analysis Engine: This process sandwiches standard three level image
processing pyramid via: Pixel level, Feature level and Global level. Analysis component attempts to
map emotional narrative of identified gesture pattern with situational context of video data.
Gesture Recognition Algorithm: Implementation via Feature Extraction and classification of
gestures for video data.

T.K.M College Of Engineering

Fig 1.1: Gesture Recognition System

T.K.M College Of Engineering

CHAPTER 2
SYSTEM DESIGN AND DEVELOPMENT
2.1. SYSTEM DESIGN
The overall system design is as follows. In this system, user can give the request for
identifying the facial expression and a processing system can accept the request. An image capturing
device can be used for capturing the image and in the processing unit, image will be processed and
converted into suitable formats by the help of a processing module. The images can be converted into
binary format and can be stored in a byte array. These images can be given into a face recognition
system which helps in recognizing the face from the captured image. This captured image can be
processed in an expression checking module and process it based on the appearance based techniques
like Principle Component Analysis and feature classification technique like Support Vector
Machine.The overall system development diagram is shown in Fig 2.1.

2.2. STAGES
The various stages of the proposed system is shown in Fig 2.2.Using the capturing devices
facial signals is captured. Usually a webcam is used for this purpose. The image thus obtained is
given to the image processing system. Various functionalities are provided by image processing
system. Using these faces in the image frame is located. Expression is checked and the result is
exhibited.

2.3. METHODOLOGY
Different stages in the system are shown in Fig 2.3.Images can either be stored in a database
or it can be captured lively using a webcam. Image which is captured using a webcam is preprocessed
using mat lab and the region of interest is selected. Using the features extracted expression is
recognized. If the image is taken from the database same operations are applied on the image and the
expression is recognized. Recognized expressions are classified and stored as the knowledge of the
system.

T.K.M College Of Engineering

Fig 2.1 Overall system diagram

C
A
P
T
U
R
IN
GF
A
C
IA
LS
IG
N
A
LS

IM
A
G
E
P
R
O
C
E
S
S
IN
G
S
Y
S
T
E
M
.

C
A
P
T
U
R
IN
GF
A
C
IA
LS
IG
N
A
LS

IM
A
G
E
P
R
O
C
E
S
S
IN
G
S
Y
S
T
E
M
.

U
S
E
C
A
P
T
U
R
IN
G
DE
V
IC
E
S
.

N
E
E
D
S
T
E
C
H
N
IC
A
LS
U
P
P
O
R
T

Fig 2.2 Stages in the proposed system

T.K.M College Of Engineering

Fig 2.3 Methodology of facial expression recognition system

T.K.M College Of Engineering

2.4 USE CASE DIAGRAM-ADMIN


The use case diagrams show the options available for the user. Fig 2.4 shows the use case
diagram for the administrator. File contains options for open a file and exit. Image contains options
for uploading and viewing uploaded images. In the option sleepy the application for finding sleepy
driver runs. Webcam is started with taking images of the user by clicking on the start icon. Stop icon
is provided to stop the image capturing. Train option contains choices for training and checking
expression. Image can be captured using webcam or it can be loaded from a database. Using logout
admin can logout from the system.

2.5 USE CASE DIAGRAM-USER


The use case diagrams show the options available for the user. Fig 2.5 shows the use case
diagram for the user. File contains options for open a file and exit. Image contains options for
uploading and viewing uploaded images. In the option sleepy driver the application for finding sleepy
driver runs. Webcam is started with taking images of the user by clicking on the start icon. Stop icon
is provided to stop the image capturing. Using logout admin can logout from the system.
2.6 ACTIVITY DIAGRAM-ADMIN
Activity diagram shows the flow of activity in the application.fig 2.6 shows activity
diagram for the administrator.Admin home leads to logout,image,sleepy,train,file.Image leads to
upload image and there user can browse and save images. In my image user can select his stored
images and check expression. Sleepy option leads to start and stop buttons. Using train user can find
expression and train the system using either stored images or by using captured images.

2.7 ACTIVITY DIAGRAM-USER


Activity diagram shows the flow of activity in the application.fig 2.7 shows activity
diagram for the user. User home leads to logout, image, sleepy, train, file. Image leads to upload
image and there user can browse and save images. In my image user can select his stored images and
check expression. In the option sleepy driver the application for finding sleepy driver runs. Webcam is
started with taking images of the user by clicking on the start icon. Stop icon is provided to stop the
image capturing. Using logout admin can logout from the system.

T.K.M College Of Engineering

Fig 2.4 use case diagram-admin

T.K.M College Of Engineering

Fig 2.5 use case diagram-user

T.K.M College Of Engineering

10

ADMIN
HOME

LOGOUT

UPLOAD
IMAGE

BROWSE

SAVE
IMAGE

IMAGE

SLEEPY

MY
IMAGE

MY
STORE
D
IMAGE

TRAIN

START

FILE

STOP

CHEC
K
EXPN

HOME

LOAD
IMAGE

CAPTUR
E
IMAGE

DETECT FACE AND


FIND EIGEN VALUE

CHECK
EXPN

Fig 2.6 Activity diagram-admin

T.K.M College Of Engineering

11

TRAIN

USER
HOME

LOGOUT

UPLOAD
IMAGE

BROWSE

SAVE
IMAGE

IMAGE

FILE

SLEEPY
ALARM

MY
IMAGE

MY
STORE
D
IMAGE

START

CHEC
K
EXPN

STOP

CAPTURE
IMAGE

Fig 2.7 Activity diagram-user

T.K.M College Of Engineering

12

HOME

2.8 CLASS DIAGRAM


Sleepy driver application contains various forms. Each form is a class which
performs various functions in that form. Class diagram is shown in the figure 2.8.Each class
is

maintained

for

login,start,home

page,home,my

images,upload,detect,sleepy,view

expression, new user,admin home.


2.9 IMAGE SPACE VS FACE SPACE
In order to specify an arbitrary image in the image space, one needs to specify every pixel
value. Thus the nominal" dimensionality of the space, dictated by the pixel representation, is mn a
very high number even for images of modest size However, much of the surface of a face is smooth
and has regular texture. Therefore, per-pixel sampling is in fact unnecessarily dense [3]. The value of
a pixel is typically highly correlated with the values of the surrounding pixels. Moreover, the
appearance of faces is highly constrained; for example, any frontal view of a face is roughly
symmetrical, has eyes on the sides, nose in the middle, etc. A vast proportion of the points in the
image space does not represent physically possible faces. Thus, the natural constraints dictate that the
face images will in fact be confined to a subspace, which is referred to as the face space.

2.10 THE PRINCIPAL MANIFOLD AND BASIS FUNCTION


It is common to model the face space as a (possibly disconnected) principal manifold,
embedded in the high-dimensional image space. Its intrinsic dimensionality is determined by the
number of degrees of freedom within the face space, the goal of subspace analysis is to determine this
number, and to extract the principal modes of the manifold[3].
The principal modes are computed as functions of the pixel values and referred to as basis
functions of the principal manifold. To make these concepts concrete, consider a straight line R3 in
passing through the origin and parallel to the vector a= [a1 a2 a3]T. Any point on the line can be
described by 3 coordinates; nevertheless, the subspace that consists of all points on the line has a
single degree of freedom, with the principal mode corresponding to translation along the direction of
a. Consequently, representing the points in this subspace requires a single basis function:
3

( x 1, x 2 , x 3 )= a j x j
j=0

.(2.1)

The analogy here is between the line and the face space, and between R3 and the image space.

T.K.M College Of Engineering

13

FRMHOME

FRMLOGIN

START

FRMMYIMAGES

SLEEPY DRIVER

FRMDETECT

FRMNEWUSER

FRMUPLOAD

FRMSLEEPY

FRMVIEWEXPRESSION
FRMADMINHOME

Fig 2.8 Class diagram

T.K.M College Of Engineering

14

2.11 PRINCIPAL COMPONENT ANALYSIS

Principal component analysis

has been called one of the most valuable results from applied

linear algebra. principal component analysis

is used abundantly in all forms of analysis from

neuroscience to computer graphics - because it is a simple, non-parametric method of extracting


relevant information from confusing data sets. With minimal additional effort principal component
analysis

provides a roadmap for how to reduce a complex data set to a lower dimension to reveal

the sometimes hidden, simplified structure that often underlie it.


Principal component analysis is appropriate when you have obtained measures on a number
of observed variables and wish to develop a smaller number of artificial variables (called principal
components) that will account for most of the variance in the observed variables[3]. The principal
components may then be used as predictor or criterion variables in subsequent analyses.
Technically, a principal component can be defined as a linear combination of optimallyweighted observed variables. In order to understand the meaning of this definition, it is necessary to
first describe how subject scores on a principal component are computed. In the course of performing
a Principal component analysis, it is possible to calculate a score for each subject on a given principal
component. For example, in the preceding study, each subject would have scores on two components:
one score on the satisfaction with supervision component, and one score on the satisfaction with pay
component. The subjects actual scores on the seven questionnaire items would be optimally weighted
and then summed to compute their scores on a given component.
Below is the general form for the formula to compute scores on the first component extracted
(created) in a Principal component analysis
C1 = b 11(X1) + b12(X 2) + ... b1p (Xp) (2.2)

where C1 = the subjects score on principal component 1 (the first component extracted)
b1p = the regression coefficient (or weight) for observed variable p, as used in creating principal
component 1
Xp = the subjects score on observed variable p.

T.K.M College Of Engineering

15

A principal component was defined as a linear combination of optimally weighted observed variables.
The words linear combination refers to the fact that scores on a component are created by adding
together scores on the observed variables being analyzed. Optimally weighted refers to the fact that
the observed variables are weighted in such a way that the resulting components account for a
maximal amount of variance in the data set.

Number of components extracted. The preceding section may have created the impression
that, if a Principal component analysis

were performed on data from the 7-item job satisfaction

questionnaire, only two components would be created. However, such an impression would not be
entirely correct. In reality, the number of components extracted in a Principal component analysis is
equal to the number of observed variables being analyzed. This means that an analysis of your 7-item
questionnaire would actually result in seven components, not two. However, in most analyses, only
the first few components account for meaningful amounts of variance, so only these first few
components are retained, interpreted, and used in subsequent analyses (such as in multiple regression
analyses). For example, in your analysis of the 7-item job satisfaction questionnaire, it is likely that
only the first two components would account for a meaningful amount of variance; therefore only
these would be retained for interpretation. You would assume that the remaining five components
accounted for only trivial amounts of variance. These latter components would therefore not be
retained, interpreted, or further analyzed.
Characteristics of principal components. The first component extracted in a Principal
component analysis

accounts for a maximal amount of total variance in the observed variables.

Under typical conditions, this means that the first component will be correlated with at least some of
the observed variables. It may be correlated with many. The second component extracted will have
two important characteristics. First, this component will account for a maximal amount of variance in
the data set that was not accounted for by the first component. Again under typical conditions, this
means that the second component will be correlated with some of the observed variables that did not
display strong correlations with component 1.
The second characteristic of the second component is that it will be uncorrelated with the first
component. Literally, if you were to compute the correlation between components 1 and 2, that
correlation would be zero. The remaining components that are extracted in the analysis display the
same two characteristics: each component accounts for a maximal amount of variance in the observed
variables that was not accounted for by the preceding components, and is uncorrelated with all of the
preceding components. A Principal component analysis

proceeds in this fashion, with each new

component accounting for progressively smaller and smaller amounts of variance (this is why only the
first few components are usually retained and interpreted). When the analysis is complete, the
T.K.M College Of Engineering

16

resulting components will display varying degrees of correlation with the observed variables, but are
completely uncorrelated with one another.
An important and largely unsolved problem in dimensionality reduction is the choice of the
intrinsic dimensionality of the principal manifold. No analytical derivation of this number for a
complex natural visual signal is available to date. To simplify this problem, it is common to assume
that in the noisy embedding of the signal of interest (in our case, a point sampled from the face space)
in a high-dimensional space, the signal-to-noise ratio is high. Statistically, that means that the variance
of the data along the principal modes of the manifold is high compared to the variance within the
complementary space. This assumption relates to the eigenspectrum - the set of the eigenvalues of the
data covariance matrix. The i-th eigenvalue is equal to the variance along the i-th principal
component; thus, a reasonable algorithm for detecting k is to search for the location along the
decreasing Eigen spectrum where the value of i drops significantly. Since the basis vectors
constructed by principal component analysis

had the same dimension as the input face images, they

were named Eigen faces".


Principal component analysis

is an information theory approach of coding and decoding

face images may give insight into the information content of face images, emphasizing the significant
local and global "features". Such features may or may not be directly related to face features such as
eyes, nose, lips, and hair. In the language of information theory, we want to extract the relevant
information in a face image, encode it as efficiently as possible, and compare one face encoding with
a database of models encoded similarly. A simple approach to extracting the information contained in
an image of face is to somehow capture the variation in a collection of images, independent of any
judgment of features, and use this information to encode and compare individual face images. These
eigenvectors can be thought of as a set of features that together characterize the variation between
face images. Each image location contributes more or less of each eigenvector; so that we can display
the eigenvector as a sort of ghostly face which we call an Eigen face. Each individual face can be
represented exactly in terms of a linear combination of the eigen faces. Each face can also be
approximated using only the "best" eigen faces-those that have the largest eigenvalues and which
therefore account for the most variance within the set of face images. The best M eigen faces span an
M-Dimensional subspace- "face space" of all possible images.
This approach of face recognition involves the following initialization operations:

Acquire an initial set of face images (the training set).


Calculate the eigenfaces from the training set, keeping only the M images that correspond to
the highest eigenvalues. These M images define the face space. As new faces are
experienced; the eigenfaces can be up-dated or recalculated.

T.K.M College Of Engineering

17

Calculate the corresponding distribution in M-dimensional weight space for each known
individual, by projecting his or her face images onto the "face space".

Having initialized the system, the following steps are then used to recognize new face images:

Calculate a set of weights based on the input image and the M eigenfaces by projecting the

input image onto each of the eigenfaces.


Determine if the image is a face by checking to see if the image is sufficiently close to "face

space".
If it is a face, classify the weight pattern as either a known person or as unknown.
(Optional) Update the eigenfaces and/or weight patterns.
(Optional) If the same unknown face is seen several times, calculate its characteristic weight
pattern and incorporate into the known faces.

2.11.1 CALCULATING EIGEN FACES


Images of faces, being similar in overall configuration, will not be randomly distributed in the huge
space and thus can be distributed by a relatively low dimensional subspace. The main idea of
Principal component analysis

is to find the vectors that best account for the distribution of face

images within the entire image space. These vectors define the subspace of face images, which we
call "face space". Each vector is of length N square, describes an N-by-N image, and is a linear
combination of original face images, and because they are face-like in appearance, we refer then to as
"eigenfaces"[6].
Let the training set of face images be

1 ,

2 , 3 .

M . The average face of the set is

defined by

1
=
M

V =1

Each face differs from the average by the vector

i= i
.

(2.4)

An example training set is shown in Fig, with the average face Y shown. This set of very large vectors
is then subject to principle component analysis, which seeks a set of M orthonormal vectors, U ,
which best describes the distribution of data. The kith vector, U, is chosen such that

T.K.M College Of Engineering

18

1
T
2
k = M (uk n )
n=1
u1 u k =d =0 , if otherwise.The vectors u and scalars l are

is a maximum, subject to 1, if l = k ,

eigenvectors and eigenvalues, respectively, of the covariance matrix


C = 1/M

n Tn

where the matrix A = [

AA

1 2 3 M

(2.6)

]. The matrix C, however, is N by N, and determining the N

square eigenvectors and eigenvalues is an intractable task for typical image sizes. We need a
computationally feasible method to find these eigenvectors.
If the number of data points in the image space is less than the dimension of the space (M<N), there
will be only M1, rather than N, meaningful eigenvectors. (The remaining eigenvectors will have
associated eigenvalues of zero). Fortunately we can solve for the N2 dimensional eigenvectors in case
by first solving for the eigenvectors of an M-by-M matrix e.g., solving a 16 x 16 matrix rather than
a 16,384 x 16,384 matrix and then taking appropriate linear combinations of the face images.
Consider the eigenvectors vi of ATA such that

A A T v i = i v i
Premultiplying both sides by A we have
T

A A A v i= i A vi
from which we see that A

v i are the eigenvectors of C =

construct the M by M matrix L =

A T A ,where

A A T .Following this analysis, we can

T
Lmn m n and find the M eigenvectors, v l

, of L.These vectors determine linear combinations of the M training set face images to from the
eigenfaces

vl .

ul= v lk k
k=0

l= 1 M

.(2.9)

With this analysis the calculations are greatly reduced, from the order of the number of pixels in
images (N2) to the order of the number image in the training set (M).The associated eigenvalues allow
us to rank to eigenvectors according to their usefulness in characterizing the variation among the

T.K.M College Of Engineering

19

images. A new face image (G) is transformed into its eigenface components (projected into "face
space") by a simple operation,
=

uTk .(2.10)

for k = 1,..,M'. This describes a set of point-by-point image multiplications and summations,
operations performed at approximately frame rate on current image and its processing hardware. The
weights form a vector

= [

1 2 3 M ' ] that describes the contribution of each

eigenface in representing the input face image, treating the eigenface as a basis set for face images.
The vector may be used in a standard pattern recognition algorithm to find which of a number of
predefined classes, if any best describes the face. The simplest method for determining of an input
face image is to find the face class k that minimizes the Euclidian distance

2k = (k )2 .(2.11)
Where

is a vector describing the kth face class. The face classes WI are calculated by

averaging the results of the eigenface representation over a small number of face images of each
individual. A face is classified as belonging to class k when minimum
threshold

is below some chosen

. Otherwise the face is classified as "unknown" and optionally creates a new face class.

Because creating the vector of weights is equivalent to projecting the original face image onto the low
dimensional face space, many images will project onto a given pattern vector. The distance between
the image and the face space is simply the squared distance between the mean adjusted input images
M

and f = i ui
i=1

its projection onto face space:

f 2 ) .(2.12)

Thus there are four possibilities for an input image and pattern vector: Near face space and near face
class, near face space but not near a known face class, Distant from face space and near a face class,
and Distant from face space and not near a known face class. In the first case, an individual is
recognized and identified. In the second case, an unknown individual is present. The last two cases
indicate that the image is not a face image.

T.K.M College Of Engineering

20

2.12 SUPPORT VECTOR MACHINE

Support vector machines are a set of related supervised learning methods that analyze data
and recognize patterns, used for classification and regression analysis[5]. The original support vector
machine

algorithm was invented by Vladimir Vapnik and the current standard incarnation (soft

margin) was proposed by Corinna Cortes and Vladimir Vapnik.[1] The standard support vector
machine takes a set of input data and predicts, for each given input, which of two possible classes the
input is a member of, which makes the support vector machine

a non-probabilistic binary linear

classifier. Since an support vector machine is a classifier, then given a set of training examples, each
marked as belonging to one of two categories, an support vector machine training algorithm builds a
model that assigns new examples into one category or the other. Intuitively, an support vector machine
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.
More formally, a support vector machine constructs a hyper plane or set of hyper planes in a
high or infinite dimensional space, which can be used for classification, regression, or other tasks.
Intuitively, a good separation is achieved by the hyper plane that has the largest distance to the nearest
training data points of any class (so-called functional margin), since in general the larger the margin
the lower the generalization error of the classifier.
Whereas the original problem may be stated in a finite dimensional space, it often happens
that in that space the sets to be discriminated are not linearly separable. For this reason it was
proposed that the original finite dimensional space be mapped into a much higher dimensional space,
presumably making the separation easier in that space. support vector machine

schemes use a

mapping into a larger space so that cross products may be computed easily in terms of the variables in
the original space, making the computational load reasonable. The cross products in the larger space
are defined in terms of a kernel function K(x,y) selected to suit the problem. The hyper planes in the
large space are defined as the set of points whose inner product with a vector in that space is constant.
The vectors defining the hyper planes can be chosen to be linear combinations with parameters i of
images of feature vectors that occur in the data base. With this choice of a hyper plane the points x in
the feature space that are mapped into the hyper plane are defined by the relation:

iK(xi,x) = constant

T.K.M College Of Engineering

21

D , a set of n points of the form

We are given some training data


p

D=\{( x i , y ix i R , y i {1,1 } }i=1 .(2.13)

where the yi is either 1 or 1, indicating the class to which the point

x i belongs. Each

is a p-

dimensional real vector. We want to find the maximum-margin hyper plane that divides the points
having yi = 1 from those having yi = 1. Any hyper plane can be written as the set of points
satisfying samples on the margin are called the support vectors. Maximum-margin hyper plane and
margins for an SUPPORT VECTOR MACHINE trained with samples from two classes. Samples on
the margin are called the support vectors.

wx-b=0 .(2.14)

where denotes the dot product. The vector w is a normal vector: it is perpendicular to the hyper plane.
The parameter

|w|
b
determines the offset of the hyperplane from the origin along the normal

vector w.
We want to choose the w and b to maximize the margin, or distance between the parallel hyper planes
that are as far apart as possible while still separating the data. These hyper planes can be described by
the equations

wx-b=1 .(2.15)

w.x-b=-1 .(2.16)

Note that if the training data are linearly separable, we can select the two hyper planes of the margin
in a way that there are no points between them and then try to maximize their distance. By using

geometry, we find the distance between these two hyper planes is

T.K.M College Of Engineering

22

|w|
z
, so we want to

minimize ||w||. As we also have to prevent data points falling into the margin, we add the following
constraint: for each i either
This can be rewritten as:

w. xi b 1 of the first class

or

w xi b 1 of the second.

y i ( w . x ib ) 1 for all 1<=i<=n .

We can put this together to get the optimization problem: Minimize (in w,b) ||w|| subject to (for any
i=1,2,,n)

y i (w x ib 1 .(2.17)

Primal form: The optimization problem presented in the preceding section is difficult to solve because
it depends on ||w||, the norm of w, which involves a square root. Fortunately it is possible to alter the

equation by substituting ||w|| with

|w|
1

the factor of 1/2 being used for mathematical

convenience) without changing the solution (the minimum of the original and the modified equation
have the same w and b). This is a quadratic programming (QP) optimization problem. More clearly:
Minimize (in w,b)

|w|
1

.(2.18)

subject to (for any i=1,.,n)

y i ( w . x ib ) 1 .(2.19)

One could be tempted to express the previous problem by means of non-negative Lagrange
multipliers i as

T.K.M College Of Engineering

23

|w| i [ y i ( w . x ib )1]}
2

i=1

1
min x {
2
w ,b ,

.(2.20)

But this would be wrong. The reason is the following:

y i ( w . x ib ) 1 >=0 suppose we can find a

family of hyperplanes which divide the points; then all. Hence we could find the minimum by sending
all i to + , and this minimum would be reached for all the members of the family, not only for
the best one which can be chosen solving the original problem. Nevertheless the previous constrained
problem can be expressed as
n

1
max { |w|2 i [ y i ( w . x ib )1]}
2

i=1
.(2.21)
min
w ,b

that is we look for a saddle point. In doing so all the points which can be separated as:

y i ( w . x ib ) 1

>0 do not matter since we must set the corresponding i to zero. This problem

can now be solved by standard quadratic programming techniques and programs. The solution can be
expressed by terms of linear combination of the training vectors as
n

w= i x i y i .(2.22)
i=1

Only a few i will be greater than zero. The corresponding


lie on the margin and satisf

y yi ( w . x ib )=1

are exactly the support vectors, which

. From this one can derive that the support vectors

also satisfy

1
( w . x ib )= y = y i b=w . xi y i
i

T.K.M College Of Engineering

.(2.23)

24

which allows one to define the offset b. In practice, it is more robust to average over all NSV support
vectors:
N SV

1
b=
(w . x i y i ) .(2.24)
N SV
i=1
2.13 BIASED AND UNBIASED HYPERPLANES

For simplicity reasons, sometimes it is required that the hyperplane passes through the origin
of the coordinate system. Such hyperplanes are called unbiased, whereas general hyperplanes not
necessarily passing through the origin are called biased. An unbiased hyperplane can be enforced by
setting b = 0 in the primal optimization problem. The corresponding dual is identical to the dual given
above without the equality constraint

2.13.1 NON LINEAR CLASSIFICATION


The original optimal hyperplane algorithm proposed by Vladimir Vapnik in 1963 was a linear
classifier. However, in 1992, Bernhard Boser, Isabelle Guyon and Vapnik suggested a way to create
nonlinear classifiers by applying the kernel trick (originally proposed by Aizerman et al. [5] ) to
maximum-margin hyperplanes.[6] The resulting algorithm is formally similar, except that every dot
product is replaced by a nonlinear kernel function. This allows the algorithm to fit the maximummargin hyperplane in a transformed feature space. The transformation may be nonlinear and the
transformed space high dimensional; thus though the classifier is a hyperplane in the highdimensional feature space, it may be nonlinear in the original input space.
If the kernel used is a Gaussian radial basis function, the corresponding feature space is a Hilbert
space of infinite dimension. Maximum margin classifiers are well regularized, so the infinite
dimension does not spoil the results. Some common kernels include:

k( x i , x j =( xi . x j)d

Polynomial (homogeneous):

Polynomial (inhomogeneous):

|x ix j|

Gaussian Radial Basis Function:
k( x i , x j =exp

k( x i , x j =( x i . x j +1)d
2

using = 1 / 22
T.K.M College Of Engineering

25

, for > 0. Sometimes parametrized

2.13.2 PARAMETER SELECTION


The effectiveness of SUPPORT VECTOR MACHINE

depends on the selection of kernel, the

kernel's parameters, and soft margin parameter C.


A common choice is a Gaussian kernel, which has a single parameter . Best combination of C and
is often selected by a grid-search with exponentially growing sequences of C and , for example,

C { 25 ,23 , .. ,213 ,215 } ; \{ 215 , 213 ,., 21 , 23 \} . Typically, each combination of


parameter choices is checked using cross validation, and the parameters with best cross-validation
accuracy are picked. The final model, which is used for testing and for classifying new data, is then
trained on the whole training set using the selected parameters.

CHAPTER 3
SYSTEM IMPLEMENTATION

The entire sequence of training and testing is sequential and can be broadly classified as consisting of
following two steps:

Database Preparation
Training
Testing

3.1 DATABASE PREPERATION


The database was obtained with 15 photographs of each person at different viewing angels
and different expressions. There are 28 persons in database1.The Database is kept in the train folder
which contains subfolders for each person having all his/her photographs. Database was also prepared
T.K.M College Of Engineering

26

for testing phase by taking 4-5 photographs of 10 persons in different expressions and viewing angles
but in similar conditions ( such as lighting, background, distance from camera etc.) using a low
resolution camera. And these images were stored in test folder. The steps are shown below in fig 3.1.

3.2 TRAINING
1. Select any one (.bmp) file from train database using open file dialog box.
2. By using that read all the faces of each person in train folder.
3. Normalize all the faces.
4. Find significant Eigenvectors of Reduced Covariance Matrix.
5. Hence calculate the Eigenvectors of Covariance Matrix.
6. Calculate Recognizing Pattern Vectors for each image and average RPV for each person
7. For each person calculate the maximum out of the distances of all his image RPVs from average
RPV of that person.
8. Expression classification is performed after this.
Flowchart is shown in fig 3.2

T.K.M College Of Engineering

27

Fig 3.1 Flowchart indicating the sequence of implementation

Fig 3.2 Flowchart for training

T.K.M College Of Engineering

28

3.3 TESTING
Testing is carried out by following steps as shown in fig 3.3:

Select an image which is to be tested using open file dialog box.

Image is Read and normalize.

Calculate the eigen value of image using Eigenvector of Covariance Matrix.

Find the distance of this input image eigen value from average eigen values of all the
persons.

Compare the eigen value with that of the stored database.

When the value matches the required output is produced.

3.4 TECHNOLOGY

3.4.1 SOFTWARE DESCRIPTIONS

Microsoft released the .net framework in February 2002.Its biggest initiative since the launch
of windows in 1991. Dot net is a revolutionary Multi language platform that knits various aspects of
application development together with the internet .The framework covers all layers of software
development above the operating system. Several software will be developed by Microsoft to achieve
this goal .It is accepted that every player in the industry, be it a software developer or a device
manufacture adopt .Net so that they can be integrated. The .Net initiative is all about enabling data
transfer between networks, PCs and devices seamlessly, independent of the platforms, architecture
and solutions. Microsoft has taken many of the best ideas in the industry, combined in some ideas of
their own, and bought them all into one coherent package. .Net is Microsofts next generation
platform for building web applications and web service. It is a platform for building web application
and web service. It is a platform for XML web service areas of Microsoft.

T.K.M College Of Engineering

29

Fig 3.3 flowchart for testing

T.K.M College Of Engineering

30

Visual Basic .NET is one of the languages that are directed towards meeting the objectives of
the .NET initiative of creating distributed applications. It has inherited the capability of rapid
application development from its earlier versions and strengthened considerably the implementation
of object-oriented features .Visual Basic .NET is a powerful object-oriented language that provides
features such as abstraction, encapsulation, inheritance, and polymorphism. In addition, it provides
many other features that did not exist in the earlier version, such as multithreading and structured
exception handling.
3.4.2.

FEATURES OF VISUAL BASIC .NET

Some of the key features of introduced in Visual Basic .NET are as follows:
Inheritance
It is the ability of a class to derive its characteristics from an existing class. Using Visual
Basic .NET, you can create a class that provides basic functionality so that other classes can inherit its
members. The derived classes can further override the inherited properties and methods to provide
new functionality.VB.NET uses inherits keyword to implement inheritance.

Constructors and destructors


VB.NET supports constructors and destructors. A constructor is a special type of method that
is invoked when you create a new instance of class. A constructor is used to initialize the members of
a class. A destructor on other hand is invoked when an object is destroyed. A destructor releases the
resources used by an object.
Overloading
It enables methods to be defined with the same name but different parameters. In other words it
allows you to have multiple implementations of a method. In VB.NET we can create multiple
methods with the same name in a class provided their parameter list is different.
Overriding
It is the capability of a derived class to override the characteristics of parent class.VB.NET has
introduced overrides keyword for providing a new implementation of an inherited numbering the

T.K.M College Of Engineering

31

derived class. The methods that can be overridden by derived classes need to be marked as
overridable in the base class.
Structured Exception Handling
Exceptions are the errors that are generated at runtime as a result of an erroneous statement or
condition or because of some unexpected behavior of the application. For the program to be able to
handle such exceptions VB.NET supports structured exception handling that consists of protected
blocks of code and filters for the possible exceptions that can be raised by the program.
Multithreading:

VB.NET

provides

full

support

for

creating

multithreaded

applications.Multithreadng enables an application to contain one or more threads that can share the
workload in an application by executing one at a time.
3.4.3

SQL SERVER 2000 EXPRESS EDITION HIGHLIGHTS


SQL Server 2000 express Edition is a great database for developers, and includes all the

important programming features present in other SQL Server 2000 editions. In fact, SSE contains the
same database engine that ships with other SQL Server 2000 editions. The SQL Server 2000 database
engine contains support for the networking protocols, T-SQL, and the storage layer. Advanced
features such as .NET support, the XML data type, stored procedures and triggers, and replication
subscription are also present.
SSE supports databases up to 4GB. An application developed using SSE typically works seamlessly
with other editions of SQL Server 2000. There is no limit on the number of user connections to the
database, but performance is limited by the use of a single CPU and 4GB RAM. Typically
applications using SSE can scale to 25 concurrent users. Easy-to-use graphical interfaces provided
with the SQL Server Management Studio Express Edition (SSMS-EE) Graphical User Interface (GUI)
management tool simplify the basic database operations. This tool contains a query editor that enables
you to interactively work with data inside the database.
SQL Server Configuration Manager allows you to configure networking options. The SSE setup
offers extensive graphical interface tools that allow you to configure the installation. Silent installs are
also supported so that you can transparently install SSE with your application. Servicing of SSE is
integrated with Windows Update and is almost automatic for the user. There is deep integration of
SQL Server 2000 Express Edition with all editions of Visual Studio, including Visual Basic Express
and Visual Web Developer 2008 Express. The rich data controls provided automate simple tasks so
that you can develop a forms-based application that uses a SSE database without writing a line of
code. The single-user scenario that is commonly used for desktop clients and web users is simplified
by the Xcopy feature in SSE that enables the database files to be copied and moved like normal
T.K.M College Of Engineering

32

windows files. Xcopy deployment simplifies the deployment of your application so that you can just
zip up your application and database file and email it to the destination user. The recipient copies the
unzipped file to her machine and double-clicks the application to run it.

Features and Benefits of SSE


Although SSE is the most basic member of the SQL Server 2000 family, it contains features
necessary for database users ranging from beginner students to Independent Software Vendors (ISVs)
developing complex redistributable applications. The following list points out some of SSEs best
features.
Data types: As mentioned, SSE ships with the same database engine that is behind the SQL Server
2000 Enterprise Edition and supports data types such as User-Defined data types (UDT), the XML
data type, and VarChar (MAX). UDTs enable you to define new complex data types in C# or VB
.NET. SSE supports the native XML data type that allows you to directly manipulate or query XML
on the server, while the VarChar (MAX) data type allows you to store large character objects with a
maximum size of 2GB.
Language independent: Supporting .NET inside SSE allows you to use your favorite .NET language
such as C#, VB .NET, or J# for database development. Your VB .NET application runs inside SSE and
queries the database engine using the ADO.NET APIs. ADO.NET exposes .NET classes in all your
favorite programming languages to connect to a database instance as well as to create and manipulate
database objects such as tables and schemas. Using .NET, your ADO.NET functions can now run
inside SSE, not just on your client machine. Use this feature for procedural code where individual
records are manipulated one at a time.

Ease of deployment: Xcopy deployment allows you to copy, move, and delete database files just like
normal Windows files. There is support for SSE with all Visual Studio editions so that it is possible to
develop simple desktop and web database applications without writing a line of
code. Building, debugging, and deploying your application is possible with a few mouse clicks from
within Visual Basic Express or Visual Web Developer Express. Application deployment becomes very
easy with Xcopy deployment and Visual Studio Click Once support.

T.K.M College Of Engineering

33

User instance functionality: SSE supports the Run as Normal User scenarios, where a non
administrator on the local machine can use the functionality of SSE without having to involve the
system administrator. This is enabled using the user instance functionality that provides for
a private instance of SSE running in each users context. These user instances are automatically
started up by the application using the database owned by the user. One of the goals for the user
instance is to make the single-user scenario very simple; the application developer need not worry
about the complicated SQL Server Security model. SSE supports a file-based permission model which
means that the read and write permissions on the physical database file are used to assign user
permissions and privileges. SSE can also be used as a server where multiple users can connect to the
server database; the performance characteristics of the server are governed by the limits on the CPU
and memory usage. An instance of SSE can use only one CPU and 4GB RAM.

Security: Much thought was given to making SSE install and run securely on your machine. Only
local machine access is enabled by default because a majority of the SSE use cases are for local data.
SSE runs under a low privilege service account. The user instance feature described earlier ensures
that SSE runs under the context of each user for single-user scenarios. For multi-user scenarios, the
SQL Server security model ensures appropriate access to authenticated users.
Advanced security features including encryption are also included in the product.

Replication and messaging capabilities: SSE supports offline capabilities by supporting replication
subscription. Retail branches can subscribe to central offices with synchronization between the servers
occurring at regular intervals. The SQL Service Broker feature supported by SSE provides
asynchronous messaging capabilities so that SSE can send a message to SQL Server. This is
particularly relevant for B2B web services.
Management tools: The SQL Server Management Studio Express Edition tool, which is available
via web download, offers capabilities to develop and test against SSE. It has a query editor that allows
you to execute arbitrary T-SQL statements. SQL Server Configuration Manager allows you to change
networking protocol settings and the SQL Service options. Rich command line facilities are available
with the SQLCMD command line tool, while the SQL Bulk Copy (BCP) tool provides bulk transfer
features.
Easy setup options: SSE provides a reliable and robust setup user interface that guides you through
the various setup and configuration options. A silent setup option is available where little or no user

T.K.M College Of Engineering

34

interface is shown. In a silent install you have to pass in the relevant configuration values as command
line parameters or in setup initialization files. The silent option is typically preferred by ISVs who
want to completely control the user experience, for instance, they want their application logo to show
on the screen during installation.
3.4.4

SERVER DATABASE APPLICATION


The server database application scenario refers to an economical deployment of a large-scale,

SQL Server based server application where components are installed in a simpler, cheaper, server
configuration. They could be web-facing applications. There are three typical sub-scenarios including
usage: as evaluation copies, single-user or small-user editions, and low-volume web applications. The
evaluation scenario covers the case of a server application that must be deployed on a single machine
for evaluation or demo purposes. For example, the evaluation edition of a customer service
application can ship with SSE or SQL Server Evaluation edition. The application development
scenario is a subset of the evaluation scenario that involves the usage of SSE only in the design and
development phase of a SQL Server application. ISVs develop applications using free SSE licenses
while relying on their customers to purchase SQL Server licenses for testing and production
deployment. This scenario enables development to proceed on client operating systems on desktops or
laptops. The SQL Server 2008 Evaluation edition can also be used for this purpose.
The low-volume web application scenario typically includes web applications deployed on web
servers with low concurrent usage patterns. However, this includes a model where the server
application stores configuration or other data that does not get directly queried by remote clients, and
hence the SSE use is typically low volume.
The SQL Server compatibility for easy scalability as well as the price point provides the primary
attraction for SSE in this scenario.Whereas the previous scenarios involve end-users installing
applications on desktop operating systems, the server scenarios generally involve more
knowledgeable end-users or even IT staff, and will always include installation on server operating
systems. Thus the deployment environment will more closely match that of other editions of SQL
Server 2008; however, the end-user will still not be as typically skilled or experienced as the SQL
Server administrator in a server environment

3.4.5

MATLAB 7
MATLAB is a software package for high performance numerical computation and

visualization. It provides an interactive environment with hundreds of built-in functions for technical
computation, graphics and animation. It also provides easy extensibility with its own high level
programming language. The name MATLAB stands for matrix laboratory.

T.K.M College Of Engineering

35

MATLABs built in functions provide excellent tools for linear algebra computations, data
analysis, signal processing and optimization, numerical solution for ordinary differential equations,
quadrature and many other types of scientific computations. Most of these functions use state of the
art algorithms. There are numerous functions for 2-D and 3-D graphics, as well as for animations. The
user is not limited to built in functions, he can write his own functions in the MATLAB language.
Once written these functions behave just like built-in functions.MATLABs language is easy to learn
and use.
There are also several optional toolboxes available from the developers. These toolboxes are
collections of functions written for special applications such as symbolic computation, image
processing, statistics, control system design, neural networks etc.The list of toolboxes keep growing
in time. The basic building block of MATLAB is matrix. The fundamental data type is the
array.Vectors, scalars, real matrices; complex matrices are all automatically handled as special cases
of basic data type. The built in functions are optimized for vector operations. Consequently vectorized
commands or codes run much faster in MATLAB.
3.4.5.1 Basics of MATLAB
1.

MATLAB windows

On almost all systems, MATLAB works through three basic windows.


MATLAB desktop
This is where MATLAB puts you launching it. The MATLAB desktop, by default, consists of the
following sub windows.
Command windows: This is the main window. It is characterized by the MATLAB command
prompt. When you launch the application program MATLAB puts you in this window. All commands
including those for running user-written programs are typed in this window at mat lab prompt. In mat
lab 7, this window is a part of mat lab window c that contains three other smaller windows
Current directory: This is where your files from the current directory are listed. You can do file
navigation here. You also have several options of what you can you do with a file once you select it.
You can run m files, rename them, delete them etc. have generated
Workspace: This sub window lists all variables that you have generated so far h as plotting by
clicking on a variable and then using and shows their type and size, you can do various things with
these variables such as plotting by clicking on a variable and then using right button on the mouse to
select the option.

T.K.M College Of Engineering

36

Command history: All commands typed on mat lab prompt in the command window get recorded
even across multiple sessions. You can select command from this window with the mouse and execute
it in the command window by double clicking on it. You can also select a set of commands from this
window and create an m file with the right click of the mouse.
2. Figure window: The output of all graphics commands typed in the command window are flushed
to the graphics or figure window, a separate gray window with white background color. The user can
create as many figure windows as system memory will allow.
3. Editor Window: This is where you write,edit,create,and save your own programs in fields called
M-files.you can use any text editor to carry out these tasks. On most systems, matlab provides item
own built in editor.
A MAT-file stores data in binary (not human-readable) form. In MATLAB, create MAT-files
by using the save command, which writes the arrays currently in memory to a file as a continuous
byte stream. By convention, this file has the filename extension .mat; thus the name MAT-file. The
load command reads the arrays from a MAT-file into the MATLAB workspace. Most MATLAB users
do not need to know the internal format of a MAT-file. Even users who must read and write MAT-files
from C and Fortran programs do not need to know the MAT-file format if they use the MATLAB
Application Program Interface (API). This API shields users from dependence on the details of the
MAT-file format. However, if you need to read or write MAT-files on a system for which the
MATLAB API library is not supported, you must write your own read and write routines. The
MATLAB API is only available for platforms on which MATLAB is supported. This document
provides the details about the MAT-file format you will need to read and write MAT-files on these
systems.

T.K.M College Of Engineering

37

CHAPTER 4
APPLICATION DEVELOPMENT
DROWSY DRIVER DETECTION

Driver fatigue is a significant factor in a large number of vehicle accidents. Recent


statistics estimate that annually 1,200 deaths and 76,000 injuries can be attributed to fatigue
related crashes [9]. The development of technologies for detecting or preventing drowsiness
at the wheel is a major challenge in the field of accident avoidance systems. Because of the
hazard that drowsiness presents on the road, methods need to be developed for counteracting
its affects. A prototype drowsiness detection system is developed. The focus is placed on
designing a system that will accurately monitor the open or closed state of the drivers eyes in
real-time. By monitoring the eyes, it is believed that the symptoms of driver fatigue can be
detected early enough to avoid a car accident. Detection of fatigue involves a sequence of
images of a face, and the observation of eye movements and blink patterns.
The analysis of face images is a popular research area with applications such as face
recognition, virtual tools, and human identification security systems. Here main focus is on
the localization of the eyes, which involves looking at the entire image of the face, and
determining the position of the eyes by a self developed image-processing algorithm. Once
the position of the eyes is located, the system is designed to determine whether the eyes are
opened or closed, and detect fatigue.
4.1.

WORKING OF THE SYSYTEM


Inorder to implement the system, the snapshot of the person has been taken

continuously and the successive images are compared with each other to find drowsiness. If
the images shows that the eyes are closed , the software produces an alarm sound to alert the
person.
A set of images with drowsy expression is trained with administrator privileage.
Inorder to do training and classification, Principal component analysis and Support Vector
Machineare used. These images are stored in the system database. The new images captured
are compared with the database and adequate results are produced. The overall working is as
given in flowchart in fig 4.1.
T.K.M College Of Engineering

38

Fig4.1Flowchart for drowsy driver detection

T.K.M College Of Engineering

39

CHAPTER 5
RESULTS AND DISCUSSIONS

The optimally design Principal component analysis

is tested on the training dataset. The results

obtained are excellent. We got 100% recognition for all five principal emotions namely Angry,
Disgusts, Happy, Sad and Surprise along with Neutral. The Test image is input and its equivalent
recognized image is obtained. Recognition rate is around 100% for all principal emotions. The
training data set is as given in the table 5.1.
The rejection and acceptance plots for databases were plotted for their respective training data as
shown in fig 5.1. the si value was varied from 0 to 1 and the plots were made. It was observed that a
value of si near one resulted in very good acceptance, though the tradeoffs being the acceptance of
even unknown expression to the closest one. The higher si value may be attributed to the lesser
number of samples in the database and to the quality of the face images.

5.1. EXAMPLES OF DATABASE


Fig 5.2 shows the examples for databases of two persons. This database is stored in the system .This is
retrieved later and expression is checked.

5.2. EXAMPLES OF EIGEN FACES


Fig 5.3 shows the examples of eigenfaces. This Eigen faces are calculated by the mat lab and stored in
the database of mat lab. This Eigen faces are used for detecting faces by using region of interest. The
structure of the face is detected and marked. This selected portion of the face is used to find the Eigen
value and Eigen vector of the face. This value is stored against the expression in the training phase.
During testing the Eigen value of the face is checked in the range of values. Expression range in
which the value falls is selected.

5.3.

LIMITATIONS OF THE ALGORITHM

Success of a practical face recognition system with images grabbed live depends on its
against the and data variations. Specifically, the important issues involved are
Facial size normalization
Non-frontal view of the face (3D pose, head movement)

T.K.M College Of Engineering

40

TABLE 5.1 Facial Expression Database


TRAIN IMAGE
Image01.jpg
Image02.jpg
Image03.jpg
Image04.jpg
Image05.jpg
Image06.jpg
Image07.jpg
Image08.jpg
Image09.jpg
Image10.jpg
Image11.jpg
Image12.jpg
Image13.jpg
Image14.jpg
Image15.jpg
Image16.jpg
Image17.jpg
Image18.jpg
Image19.jpg
Image20.jpg
Image21.jpg
Image22.jpg
Image23.jpg
Image24.jpg
Image25.jpg
Image26.jpg
Image27.jpg
Image28.jpg
Image29.jpg
Image30.jpg
Image31.jpg
Image32.jpg
Imag33.jpg
Image34.jpg
Image35.jpg
Image36.jpg
Image37.jpg
Image38.jpg
Image39.jpg
Image40.jpg
Image41.jpg
Image42.jpg
Image43.jpg
Image44.jpg
Image45.jpg
Image46.jpg
Image47.jpg
Image48.jpg
Image49.jpg
T.K.M College Of Engineering

EXPRESSION
happy
happy
happy
happy
happy
happy
anger
Anger
Anger
Anger
Anger
Anger
Anger
anger
sad
Sad
Sad
Sad
Sad
Sad
Sad
Sad
happy
happy
happy
happy
happy
happy
happy
happy
happy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
sleepy
41

Fig 5.1 Plot for database stored

T.K.M College Of Engineering

42

Fig 5.2 database of 2 persons

Fig 5.3 Example of Eigen faces


T.K.M College Of Engineering

43

Tolerance to facial expression / appearance (including facial


hair & specs)
Invariance to lighting conditions (including indoor / outdoor)
Facial occlusion (sunglasses, hat, scarf, etc.)
Invariance to aging.
We tried to minimize the data variations by capturing the facial image subjected to the
reasonably constrained environment Frontal view geometry and
Controlled lighting.

T.K.M College Of Engineering

44

CHAPTER 6
CONCLUSION

A facial expression recognition system using Principal component analysis

is

implemented in Microsoft Visual Studio Platform with MATLAB support. This particular
method using Principal component analysis

for face recognition was motivated by

information theory, leading to basing face recognition on a small set of image features that
best approximates the set of known face images,without regarding that they correspond to our
intutive notions of facial parts and features.
The eigenface approach provides a practical solution that is well fitted for the problem
of facial expression recognition. It is fast, relatively simple, and works well in a constrained
environment. Certain issues of robustness to changes in lighting, head size, and head
T.K.M College Of Engineering

45

orientation , the tradeoffs between the number of eigenfaces necessary for unambiguous
classification are matter of concern. The project has been developed in the application side to
implement drowsy driver detector successfully.
6.1 FUTURE ENHANCEMENTS
This project is based on eigen face approach that gives an accuracy maximum of about
92.5%. Adaptive algorithms may be used to obtain an optimum threshold value. There is
scope for future betterment of the algorithm by using Neural Network technique that can give
better results as compared to eigen face approach. With the help of neural network technique
accuracy can be improved. Instead of having a constant threshold, it could be made adaptive,
depending upon the conditions and the database available, so as to maximise the accuracy.
The whole software is dependent on the database and the database is dependent on resolution
of camera. So if good resolution digital camera or good resolution analog camera is used , the
results could be considerably improved.

REFERENCES

[1] Comparative Study of Facial Expression Recognition Techniques, Mandeep Kaur,


Rajeev
Vashisht, International Journal of Computer Applications (0975 8887),Volume 13 No.1, January
2011
[2] Matthew Turk and Alex Pentland "Eigen faces for recognition " vision and Modeling Group ,
Media Laboratory , Massachusetts institute of Technology.
[3]Face Recognition using Principle Component Analysis ,Kyungnam Kim, Department of
Computer Science, University of Maryland, College Park, MD 20742, USA
[4] Stan Z.Li & Anil K. Jain hand book of face recognition Springer publications
[5] http://Wikipedia//Support vector machine .html
[6] Matthew TurkA random walk through eigenspace IEICE Trans Dec 2001
[7] Fernando L. Podio and Jeffrey S. Dunn2Biometric authentication technology
T.K.M College Of Engineering

46

[8] http://www.face-rec.org
[9] http://www.alglib.net
[10] http://math.fullerton.edu/mathews/n2003/JacobiMethodProg.html

T.K.M College Of Engineering

47

You might also like