Classfcaton of Face Images Based on Gender usng Dmensonalty Reducton Technques and SVM Fahm Mannan 260 266 294 School of Computer Scence McGll Unversty Abstract Ths report presents gender classfcaton based on facal mages usng dmensonalty reducton technques such as Prncpal Component Analyss (PCA) and Independent Component Analyss (ICA) along wth Support Vector Machne (SVM). The nput dataset s dvded nto tranng and testng dataset and experments are performed by varyng dataset sze. The effect of performng mage ntensty normalzaton, hstogram equalzaton, and nput scalng are observed. The outcomes of the experments are analogous to publshed works that apply smlar technques. 1. Introducton Gender classfcaton usng facal mages has been of nterest for qute some tme. Early works were mostly related to psychologcal research where the process by whch humans determne gender from faces s studed. Humans are very good at determnng gender from facal mages. Even f the face s cropped to remove all gender cues, we can dentfy gender wth very hgh accuracy ([1]).More recently automated gender classfcaton from facal mages has ganed much nterest n the computer vson and machne learnng communty. Ths s because of ts extreme mportance n Human Computer Interacton, demographc research, and securty and survellance applcatons. It can also augment other mportant areas lke face recognton, age and ethncty determnaton. Several approaches have been taken to classfy facal mages based on gender. Ths report addresses one partcular approach usng dmensonalty reducton (ICA and PCA) and Support Vector Machne (SVM). One of the challenges of automatc gender classfcaton s to account for the effects of pose, llumnaton and background clutter. Practcal systems have to be robust enough to take these ssues nto consderaton. Most of the work n gender classfcaton assumes that the frontal vews of faces, whch are pre-algned and free of dstractng background clutters, are avalable. Towes et al.[2] provdes a framework that s free of these assumptons and can classfy faces by frst automatcally detectng, then localzng and fnally extractng features from arbtrary vewponts. But n ths project, only the facal mages wth full frontal vews are consdered. The report s organzed as follows - secton 2 presents an overvew of related research. Secton 3, looks at the general approach and explans dmensonalty reducton technques as well as SVMs. Experments are llustrated n secton 4 and the results are dscussed n secton 5. Secton 6 concludes wth a dscusson of possble future works.
2. Related Work Almost all of the works n gender classfcaton nvolves extractng features from faces and classfyng those features usng labeled data. They mostly dffer n the way these two steps are performed. Therefore gender classfcaton approaches can be categorzed based on the feature extracton and classfcaton methods. Feature extracton can be broadly categorzed nto a) Appearance-base methods, and b) Geometry-based methods. In appearance-based methods the whole mage s consdered rather than local features that are present n dfferent parts of the face. On the other hand n geometry-based approaches, the geometrc features (e.g. dstance between eyes, face wdth, length, thckness of nose, etc.) of a face are consdered. In ths secton, only the works related to appearance-based approaches are dscussed. For the case of classfcaton, most of the works use neural networks, dscrmnant analyss, nearest neghbors, and SVMs. Early works n gender classfcaton mostly used neural networks wth face mage as raw nput. Some of these are Golomb et al. s two-layer network called SEXNET [3], Tamura et al. s multlayer neural network [4], etc. Gutta et al. n [5] takes a hybrd approach usng neural network and decson trees. Moghaddam et al. n [6] uses non-lnear SVMs to classfy faces from low-resoluton thumbnal mages of sze 21-by-12. The authors also expermented wth other types of classfers ncludng dfferent types of RBFs, Fsher s lnear dscrmnant, Nearest Neghbor, and Lnear classfer. For SVM they looked at Gaussan RBF kernel and cubc polynomal kernels. They used a total of 1,755 thumbnals (1,044 males and 711 females) and reported the error rate of performng fve fold cross-valdaton. The best result was obtaned for SVM wth Gaussan RBF kernel whch had an overall error rate of 3.38%, for males and females error rates were 2.05% and 4.79% respectvely. Jan et al. n [7] presents an approach usng ICA and SVM. They studed the performance of dfferent classfers namely- cosne classfer that fnds the dstance between two features lyng on an hyper-sphere surface, lnear dscrmnant classfer that fnds the projecton of the nput mage maxmzng the rato of the between-class scatter and wthn class scatter, and SVM whch fnds the maxmal separatng hyper-plane between the male and female features. A tranng set of 200 mages out of a database of sze 500 was used n ther work. Usng ICA 200 ndependent components were determned from the tranng set. They also expermented wth dfferent szes of tranng set. In there work, SVM performed constantly well wth respect to the other classfers. The best performance they got was 95.67% usng ICA and SVM for a tranng set of sze 200. 3. Approach In general, gender classfcaton n supervsed learnng settng requres extracton of features from face mages, tranng classfers usng those features and fnally performng classfcaton of new faces. Ths work uses appearance-based approach wth dmensonalty reducton technques for feature extracton. The features extracted from
the tranng set are used for tranng an SVM classfer. And fnally mages n the test set are classfed usng the classfer. The general approach taken n gender classfcaton s summarzed n fgure 1. Frst preprocessng operatons on the nput face mage. These operatons are face normalzaton, mage ntensty normalzaton and hstogram equalzaton. In the face normalzaton step faces are cropped and algned so that parts of the face (e.g. eyes, nose and mouth) fall nto predefned locatons. Then mage ntensty normalzaton and hstogram equalzaton are performed to account for varyng lghtng condtons. Fnally usng PCA or ICA a set of bass vectors n a lower dmensonal space s determned and the face mages are projected onto the subspace spanned by those bass vectors. These bass vectors encode the dscrmnatory features of a human face. A tranng set s then formed by takng a set of labeled faces and extractng the features usng the above approach. Then a classfer s traned wth the labeled data and feature set par. For a query mage, the features are extracted n the same way. The classfer uses these features to determne the gender from a persons facal mage. Tranng Image Pre-processng Dmensonalty Reducton Feature Extracton Query Image Tran Classfer Pre-processng Feature Extracton Model Classfy Fgure 1. General Approach for Gender Based Face Classfcaton usng Dmensonalty Reducton Technques and SVM 3.1 Feature Extracton As was descrbed before feature extracton s done by projectng the face mage onto a lower dmensonal subspace. Dmensonalty reducton technques PCA and ICA are used for ths approach. One of the objectves of ths project was to see how the two technques perform for gender classfcaton. The motvaton behnd dong dmensonalty reducton s to work wth the most useful components of an mage. Ths mproves both the computaton tme and performance of the method that s used. In the followng, the two dmensonalty reducton methods are dscussed.
3.1.1 Prncpal Component Analyss Prncpal Components Analyss s a very well known approach for reducng the dmensonalty of data. For applyng PCA to mages, the mage s frst represented as a column of vectors. A matrx s formed by concatenatng the column of tranng set mages. Let ths matrx be X, X = [x 1 x 2 x n ], where x s the th column vector representng the th tranng mage. Then the mean s subtracted from each column and the covarance matrx s computed. Let the mean mage be n 1 x = x n = 1 And Y = [ x1 x x n x ] The covarance matrx Q = cov(y) = YY T Fnally, egenvalue decomposton s performed to fnd the hghest rankng (based on egenvalues) egenvectors. These vectors, known as prncpal components span the low dmensonal subspace. Out of these egenvectors m most sgnfcant vectors are chosen, let these vectors be e 1, e 2,,e m. The value of m s chosen by consderng the cumulatve sum of the egenvalues. The features of an mage x s then computed by projectng t onto the space spanned by the egenvectors as follows g = [e 1 e 2 e m ] T ( x x ), where g s an m dmensonal vector of features. Ths feature vector g s used durng tranng and classfcaton. 3.1.2 Independent Component Analyss Independent Component Analyss s another well known approach for blnd sgnal separaton where a sgnal s consdered to be a lnear combnaton of ndependent sources. If s s the vector representng the unknown sources, and A s the mxng matrx then the observed sgnal x s represented as x = As ICA tres to fnd a separatng matrx W such that u = WAs, where u s an estmaton of s. In [8], an algorthm s gven that fnds an estmate of W by teratvely refnng the columns of W. For the case of mages, X s the matrx whose columns are mages n column vector form and S s the matrx whose columns are the ndependent components.
3.2 Classfcaton usng Support Vector Machne Support vector machnes are classfers that construct a maxmal separatng hyperplane between two classes so that the classfcaton error s mnmzed. For lnearly nonseparable data the nput s mapped to hgh-dmensonal feature space where they can be separated by a hyperplane. Ths projecton nto hgh-dmensonal feature space s n effcently performed by usng kernels. For nstance-label par x, y ) wth x R, ( y { 1,1} for 1 n where n s the number of nstances, the followng optmzaton problem needs to be solved for SVMs 1 T mn w w + C w, b, ξ 2 subject to 0 ξ n = 1 T ξ y ( w φ( x ) + b) 1 ξ, In the above equaton, C s the penalty parameter for error term and φ maps a tranng nstance x to hgher dmensonal space. The kernel K s defned as T K( x, x j ) = φ( x ) φ( x j ) For ths project, a Radal Bass Functon (RBF) kernel was used whch s defned as K( x, x j ) = exp( γ x x j ) where γ 0 2 The parameter γ controls the spread of a Gaussan cluster. Therefore n the above formulaton there are two parameters, C and γ to control the performance of the classfer. 4. Experments Experments were carred out wth varyng sze of the tranng dataset, ntensty normalzaton, hstogram equalzaton, scalng tranng and testng dataset. Image database from [9] was used for ths purpose. The database conssts of full frontal face photos of 100 ndvduals (50 females and 50 males). The mages were cropped by removng har and background. The two tranng sets were of szes 40 (20 females and 20 males) and 60 (30 females and 30 males). The rest of the mages were used for testng. Same varatons were made on both ICA and PCA approaches to observe the effects of dfferent choces. In the pre-processng step, mage ntenstes are normalzed (f applcable) and the mages are reduced to 48x48 pxels. Hstogram equalzaton s then performed (f applcable) on these mages. In PCA, the frst 40 and 60 components were chosen for the tranng dataset of sze 40 and 60 respectvely. The plots n fgure 2 show the percentage of the cumulatve sum of
the egenvalues. The frst three egenfaces are shown n Fgure 3 (a-c). These faces were obtaned from the frst three egenvectors. For the case of ICA, the FastICA [10] algorthm found 40 and 60 components respectvely for the two szes of tranng set. The top three ICA faces are shown n Fgure 3(d-f). (a) (b) Fgure 2. Percentage of Cumulatve Sum vs. Number of Egenvalues for dataset of sze a) 40 and b) 60 (a) (b) (c) (d) (e) (f) Fgure 3. a) Frst three Egenfaces for dataset of sze 60 b) Frst three ICA faces for dataset of sze 60 For SVM classfcaton LIBSVM [11] was used. The choce of optmal C and γ was made by performng a grd search wth values rangng from 2 -n to 2 n and dong fve fold cross-valdaton for each choce. In the followng table, the results for varyng varous parameters wth the optmal values of C and γ are gven. Some of the msclassfed mages are shown n fgure 4.
Table 1:Results usng ICA Tranng Intensty Hst. Gaussan Kernel Parameters CV Set Sze Norm. Scalng Eq. C γ Accuracy Accuracy 40 N N N 0.03125 0.0078125 50.00% 50.00% 40 N N Y 8192.0 0.0001221 92.50% 80.00% 40 N Y N 0.03125 0.0078125 50.00% 50.00% 40 N Y Y 32.0 0.000488 90.00% 81.67% 40 Y N N 0.5 0.000488 72.50% 58.33% 40 Y N Y 32.0 0.0078125 77.50% 75.00% 40 Y Y N 0.03125 0.000488 80.00% 70.00% 40 Y Y Y 32.0 0.000488 90.00% 81.67% 60 N N N 0.03125 0.0078125 50.00% 50.00% 60 N N Y 2048.0 0.0001221 88.33% 85.00% 60 N Y N 0.03125 0.0078125 50.00% 50.00% 60 N Y Y 32.0 0.000488 86.67% 92.50% 60 Y N N 0.03125 0.0019531 68.33% 57.50% 60 Y N Y 128.0 0.0078125 93.33% 90.00% 60 Y Y N 0.03125 0.000488 85.00% 85.00% 60 Y Y Y 3.0 0.0078125 86.67% 92.50% Table 2:Results usng PCA Tranng Intensty Hst. Gaussan Kernel Parameters CV Accuracy Scalng Set Sze Norm. Eq. C γ Accuracy 40 N N N 0.03125 0.000122 90.00% 68.33% 40 N N Y 32.0 0.0078125 75.00% 73.33% 40 N Y N 0.03125 0.0000305175 80.00% 70.00% 40 N Y Y 0.03125 0.0078125 90.00% 78.33% 40 Y N N 0.03125 0.0078125 90.00% 71.67% 40 Y N Y 1.0 0.00078125 77.50% 70.00% 40 Y Y N 0.5 0.0078125 90.00% 81.67% 40 Y Y Y 0.03125 0.0078125 90.00% 78.33% 60 N N N 0.03125 0.00003052 81.67% 65.00% 60 N N Y 2.0 0.03125 85.00% 90.00% 60 N Y N 0.03125 0.00003052 85.00% 85.00% 60 N Y Y 0.03125 0.5 68.33% 77.50% 60 Y N N 8.0 0.0078125 90.00% 97.50% 60 Y N Y 8.0 0.0078125 86.67% 92.50% 60 Y Y N 0.5 0.0078125 88.33% 92.50% 60 Y Y Y 32.0 0.0078125 63.33% 95.00% Fgure 4. A sample set of msclassfed faces. The frst three are of females and the last two males.
5. Dscusson The effect of usng larger tranng set can be seen from Table 1 and 2. In general the results obtaned for larger tranng set are better. In both PCA and ICA, for some cases accuracy was more than 90%. Smlar trend was shown n [7] where usng large tranng set gave an accuracy of 95.67%. Image ntensty normalzaton plays an mportant role n the performance of feature extracton and classfcaton. Keepng all other confguratons (dataset sze, hstogram equalzaton, and scalng) same, performng ntensty normalzaton mproved performance n most cases for both ICA and PCA. For example 1 st and 5 th, 3 rd and 7 th,9 th and 13 th, 11 th and 15 th rows of both ICA and PCA show mprovement for performng ntensty normalzaton. On an average for ICA there s ~14% ncrease n performance and for PCA the mprovement s ~13%. The results n rows 1 and 3, 2 and 4, 5 and 7, 6 and 8, 9 and 11, 10 and 12, 13 and 15, 14 and 16 of both ICA and PCA shows the effects of hstogram equalzaton whle all other confguratons are fxed. Wth the excepton of two cases n PCA (10 and 12, 13 and 15) n all other cases there was mprovement. The average mprovement for ICA was ~7% and PCA ~6%.However, n some cases good accuracy ( 90%) was acheved even wthout usng hstogram equalzaton. Ths mght be because of some loss of nformaton due to down samplng and hstogram equalzaton. Also the nput mages dd not have enough llumnaton varaton to affect the performance of classfcaton. [7] also apples hstogram equalzaton after face normalzaton. However, they used a slghtly larger mage (64x96). Scalng seems to have more mpact on the performance of ICA. For ICA, accuracy due to scalng mproved by about 47% on average. Input scalng does not seem to mprove the performance of PCA especally when ntensty normalzaton or hstogram equalzaton s performed. 6. Concluson In ths report, gender classfcaton usng dmensonalty reducton technques namely ICA and PCA along wth SVM s presented. Appearance-based approach s taken wth the assumpton that the nput mages are algned and free of background clutter. Features are extracted after performng dmensonalty reducton and classfcaton s performed usng SVM wth Gaussan RBF kernel. Results for varyng dataset sze, mage ntensty normalzaton, hstogram equalzaton, and nput scalng are also presented. Both ICA and PCA can acheve very good accuracy wth dfferent combnatons of the above parameters. The results that were obtaned are smlar to some of the works dscussed n Secton 2. In the current work, the database sze was small. The performance of the approach can be better understood by usng a larger database. It would also be nterestng to see how the accuracy vares for people of dfferent ethncty. For ths work all the hghest rankng
vectors found by PCA and ICA were used. For large tranng set t would be computatonally effcent to choose a subset of these components. One possble research drecton would be to determne the mportance of the components for gender classfcaton. Currently a naïve grd search s performed for fndng optmal values for C and γ, a more sophstcated search wll defntely mprove the performance of gender classfcaton. References [1] Alessandro Cellerno, Davde Borghett and Ferdnando Sartucc, Sex dfferences n face gender recognton n humans, Bran Research BulletnVolume 63, Issue 6,, 15 July 2004, Pages 443-449. [2] M. Toews and T. Arbel, Detectng, localzng and classfyng vsual trats from arbtrary vewponts usng probablstc local feature modelng, Proceedngs of the IEEE Internatonal Workshop on Analyss and Modelng of Faces and Gestures, pp. 154-167, Ro de Janero, Brazl, Oct. 2007. [3] B.A.Golomb,D.T.Lawrence,andT.J.Sejnowsk. SEXNET:A neural network dentfes sex from human faces. In Advances n Neural Informaton Processng Systems, pages 572--577, 1991. [4] Shnch Tamura, Hdeo Kawa, and Hrosh Mtsumoto. Male/female dentfcaton from 8 6 very low resoluton face mages by neural network. Pattern Recognton, vol. 29, no 2,pp 331-335, 1996. [5] Gutta, S.; Wechsler, H.; Phllps, P.J., Gender and ethnc classfcaton of face mages, Automatc Face and Gesture Recognton, 1998. Proceedngs. Thrd IEEE Internatonal Conference on, vol., no., pp.194-199, 14-16 Apr 1998 [6] Moghaddam, B.; Mng-Hsuan Yang, Learnng gender wth support faces, Transactons on Pattern Analyss and Machne Intellgence, vol.24, no.5, pp.707-711, May 2002 [7] Amt Jan, Jeffrey Huang, Integratng Independent Components and Support Vector Machnes for Gender Classfcaton,ICPR, pp. 558-561, 2004. [8] A. Hyvärnen. Fast and Robust Fxed-Pont Algorthms for Independent Component Analyss. IEEE Transactons on Neural Networks 10(3):626-634, 1999. [9] The Psychologcal Image Collecton at Strlng (PICS) repostory. http://pcs.str.ac.uk/cg-bn/pics/new/pcs.cg [10] The FastICA Package for Matlab. http://www.cs.hut.f/projects/ca/fastca/ [11] Chh-Chung Chang and Chh-Jen Ln, LIBSVM : a lbrary for support vector machnes, 2001. Software avalable at http://www.cse.ntu.edu.tw/~cjln/lbsvm