Te lo leggo in faccia – Il codice sorgente del FACS

Dopo la disamina sulla situazione attuale nella progettazione di sistemi per l’analisi delle espressioni facciali, Midnight affronta il problema da un’ottica puramente statistica, concentrandosi sull’ultimo aspetto del processo, quello del riconoscimento delle espressioni facciali a partire da un

insieme di dati in ingresso, tipicamente le caratteristiche geometriche precedentemente estratte dai fotogrammi in esame.

L’attività di classificazione avviene solitamente identificando le AU coinvolte nell’espressione.

Attraverso un approccio personalizzato, basato sull’analisi diretta delle relazioni esistenti fra punti geometrici del volto e caratterizzazione emozionale, si cerca di superare questa metrica canonica e di riconoscere direttamente un insieme limitato di emozioni, precisamente le 7 emozioni universali – delle quali abbiamo parlato nel primo articolo – e l’espressione neutra, senza condizionare il risultato al rilevamento delle singole AU. Con questo criterio operativo si riduce il numero di variabili in uscita del sistema (da 44 AU combinabili a 8 stati emotivi) con l’auspicio di aumentare la capacità predittiva dei modelli, dal momento che la fase di identificazione delle emozioni viene inclusa nel processo di stima e non assegnato posteriormente attraverso un sistema di codifica.

Di seguito si valutano alcuni tra i più di usi metodi di classificazione per variabili risposta multinomiali, utilizzando come campione di riferimento un sottoinsieme di immagini contenute nell’Extended Cohn-Kanade Dataset.

Il Cohn-Kanade Dataset, il più grande database di emozioni facciali del mondo, include dati registrati su un campione originario di 210 adulti con età compresa fra i 18 e i 50 anni. La composizione è volutamente eterogenea: 69% donne, 31% uomini; 81% Americani di origine europea, 13% Americani di origine africana, 6% di altri gruppi etnici. Le riprese sono avvenute in una sala d’osservazione contenente una sedia dove sono stati fatti sedere i soggetti e 2 fotocamere, ciascuna collegata a un videoregistratore fornito di un time-generator. Una delle fotocamere è stata posizionata frontalmente al soggetto, l’altra con un angolo di 30 gradi a destra. Con circa un terzo dei volontari la luminosità della sala è stata aumentata con una lampada ad alta intensità, mentre il resto degli individui ha usufruito di un sistema di illuminazione uniforme apportata da due di erenti fonti di luce. I soggetti sono stati istruiti da uno sperimentatore a eseguire una serie di 23 pose facciali; tra queste figurano sia singole unità d’azione che combinazioni di AU. Ulteriori dettagli sulla composizione del database sono reperibili nel documento associato alla pubblicazione (Kanade et al., 2000).

All’interno dello studio si considerano le 7 emozioni universali che danno vita alle microespressioni facciali, secondo la teoria sviluppata da Ekman e Friesen nel FACS, a cui viene aggiunta l’espressione neutra, che si unisce alle altre classi e in alcuni metodi funge da riferimento per l’analisi. Il taglio complessivo del lavoro è associabile al lone che si occupa del riconoscimento di espressioni facciali da immagini statiche. Si è tenuto conto della sequenza cronologica originaria esclusivamente per la scelta dei fotogrammi da includere nella campione, dal momento che le riprese rappresentano un’intensità espressiva crescente. Come vedremo, sono state prese in esame solo immagini in cui l’emozione espressa sia definita integralmente.

Di seguito, integrale, riportiamo il codice sorgente dell’applicazione.

Codice Java per l’estrazione delle immagini

import java.io.*;

import

java . util .*;

 

public class Landmarks

 

{

 

public static int somma(int [] v)

 

{

}

int tot=0;

for(int i=0;i<v.length;i++)

t o t+=v [ i ] ;

 

return

tot ;

 

public static void main(String [] argv) throws IOException

 

{

 

FileWriter fw1 = new FileWriter (‘Landmarks.xls ‘);

FileWriter fw2 = new FileWriter (‘Selection.xls ‘);

File root = new File(“C:/Users/…/Landmarks”);

ArrayList<File> lista = new ArrayList<File >();

lista .addAll(Arrays.asList(root. listFiles ()));

int[] subdir = new int [593];

int i=0;

int count = 0;

int index = 0;

int tmp = 0;

while(lista.size() > 0)

 

{

 

File f = lista .remove(0);

if(f.isDirectory())

 

{

 

lista . addAll(Arrays . asList ( f . listFiles ()));

if(i >= 123)

{

subdir[i−123]=(Arrays.asList(f. listFiles ()). size ()); 85

86

Appendice

}

}

}

}

else

{

}

}

}

i ++;

FileReader fr = new FileReader(f );

BufferedReader br = new BufferedReader( fr );

String

s ;

int j=0;

while (( s = br . readLine ()) != null )

{

fw1. close ();

fw2. close ();

if (count == tmp + subdir[index])

{

}

fw2 . w r i t e ( s ) ;

j ++;

if(j%68 == 0)

{

}

fw2. write(“\n”);

tmp += subdir[index];

index++;

fw1 . w r i t e ( s ) ;

fw1. write(“\n”);

count++;

fr . close ();

Analisi dei dati

Caricamento dei dati e Analisi Esplorativa

database <− read.table(file.choose(), header=T) head ( database )
missing <− which(is.na(database$Emotion)==TRUE) data <− database[−c(missing),−c(1 ,2)]

dim(data)

emo <− c(“Neu”,”Ang”,”Con”,”Dis”,”Fea”,”Hap”,”Sad”,”Sur”) # Divisione del data−set in insieme di stima e di verifica

n <− nrow(data)

 

set . seed (100)

ind <− sample(1:n)
trainval <− ceiling (n*.8)
testval <− ceiling (n*.1)
train <− data[ind[1:trainval],]
test <− data[ind[(trainval+1):(trainval+testval)],] valid <− data[ind[(trainval+testval+1):n],]

f1 <− as.formula(paste(“Emotion~”, paste(names(train)[−c(1)] , collapse=”+”), collapse=NULL))

# Analisi preliminare dei dati

plot(sd(data1[,x]), type=”o”, col=1, ylim=c(23,32),pch=19,

ylab=”Standard Deviation”, xlab=”Landmarks”)

abline(h=mean(sd(data1[,x])), lty=6)

abline(h=mean(sd(data1[,y])), lty=2)

points(sd(data1[,y]), type=”o”, pch=”*”, col=1)

identify(sd(data1[,x]), type=”o”, col=1, ylim=c(23,32),pch=19)

identify(sd(data1[,y]), type=”o”, pch=”*”, col=1)

summary( data )

plot(train[,1], xlab=”Emozione”, ylab=”Frequenza Assoluta”,

freq=FALSE, col=8, font=2, col.axis=”black”)

par(mfrow=c(3 ,3))

for(i in 2:9)

{

}

i f ( i s . f a c t o r ( data [ , i ] ) )

boxplot(data[ ,1]~data[ , i ])

else

plot(data[,i]~data[,1], xlab=variable.names(data)[i],

ylab=variable .names(data )[1])

Analisi delle componenti principali

pc.train<−princomp(train[,−1], cor=T)
screeplot(pc.train , main=”Componenti principali”, type=”lines”)

summary ( pc . t r a i n )

pc. train$sd^{2}

sum(pc. train$sd^{2})

# uguale alla varianza totale

pc. train$loadings [1:10 ,1:3]

pc. train$scores [1:10 ,1:3]

# coefficenti comp

biplot(pc.train, choices = 1:2, scale = 1, pc.biplot=TRUE)

library ( plotpc )

plotld(pc.train$loadings ,lty=1, lwd=1:3)

fmod1 <− as.formula(paste(“~”, paste(names(train)[−c(1)] , collapse=”+”), collapse=NULL))

x.stima <− model.matrix(fmod1, train)

87

 

88 Appendice

y . s t i m a <− t r a i n [ , 1 ]
x. verifica <− model.matrix(fmod1, test) y. verifica <− test [ ,1]
x.pc <− model. pcr$scores [ ,1:3] x.stimapc <− data.frame(y.stima ,x.pc)

f.pc <− as.formula(paste(“y.stima~”, paste(names(x.stimapc)[−1], collapse=”+”), collapse=NULL))
pc.load <− model.pcr$loadings[,1:3]
pc.test <− x.verifica[,−1] %*% pc.load

head ( pc . t e s t )

x.testpc <− data.frame(y.verifica ,pc.test) Modello multilogit

library (VGAM)

glm.model <− vglm(f1 , multinomial(refLevel = 1), train) coef(glm.model, matrix=TRUE)

summary(glm.model)

weights(glm.model, type=”prior”, matrix=FALSE)

glm . [email protected]

s t r ( glm . model )

glm . [email protected]$rank

p.glm <− predict(glm.model, newdata=test , type = “response”) p1.glm <− rep(NA, nrow(p.glm))

for ( i

{

in 1:nrow(p.glm))

p1.glm[i] <− which.max(p.glm[i,]) source(“lift−roc1.R”) # funzione personalizzata

tabella .sommario(p1.glm,test$Emotion)

Modello loglineare

l i b r a r y ( nnet )

multi.model<−multinom(f1, data=train, MaxNWts=1200, maxit=300) names(multi .model)

p.log <−predict(multi.model,newdata=test ,type=”class”) tabella .sommario(p.log ,test$Emotion)

Analisi discriminante lineare

library (MASS)

system.time(lda(f1, data=train))

names(d1)

plot(d1, dimen=1, type=”both”)

}

 

p.lda <−predict(d1,newdata=test) tabella.sommario(p.lda$class ,test$Emotion)

Albero di classi cazione

library(tree)

# Crescita dell ‘ albero :

t1<−tree(f1, data=train,
control=tree . control (nobs=nrow( train ) , minsize=2,

mindev =0.0001))

plot ( t1 )

text(t1 ,cex=0.6)

# Potatura dell ‘ albero :

t2 <− prune.tree(t1,newdata=valid) plot ( t2 )

J<−t2$size [ t2$dev==min(t2$dev )] t 3 <− p r u n e . t r e e ( t 1 , b e s t = J )
plot ( t3 )
text(t3 ,cex=0.2)

summary(t3)

# Previsioni

p.tree <−predict(t3,newdata=test, type=”class”) tabella.sommario(p.tree ,test$Emotion)

Classi catori combinati

# Bagging

library ( ipred )

f i t . bag <− bagging ( f1 , data=train , nbagg=50, coob=TRUE) fit .bag

p.bag <− predict(fit.bag, newdata=test) tabella .sommario(p.bag,test$Emotion)

# Random Forest

library (randomForest)

fit.rf <− randomForest(f1, data=train,importance=TRUE, proximity=TRUE)

round(importance( fit . rf ) , 2) # importanza delle variabili

p.rf <− predict(fit.rf, newdata=test, type=”response”)

89

 

90 Appendice

tabella.sommario(p.rf ,test$Emotion)

# Boosting

library (adabag)

stump <− rpart . control (cp=0.01, maxdepth=4, minsplit=0) fit .ada <− boosting(f1 , train , boos = TRUE, mfinal = 100,

coeflearn = ‘Zhu’)

names( fit .ada)

p.ada <− predict.boosting(fit.ada, newdata=test) tabella.sommario(p.ada1$class ,test1$Emotion)

Rete neurale

l i b r a r y ( nnet )

decay<− 10^(seq(−1, −0.7, length=10))
err <− rep (0 ,10)
for(k in 1:10) { n1<− nnet(f1, data=train, decay=decay[k], size=8,

cbind ( err , decay )

maxit=1200, MaxNWts = 1200 , trace=FALSE)

p1n<− predict (n1 , newdata=valid , type=”class “) a<− tabella .sommario(p1n,valid$Emotion)

err [k] <− 1−sum(diag(a))/sum(a) print(c(err[k], decay[k]))

}

n2<− nnet(f1 , data=train ,decay=0.107,size=8,MaxNWts = 1200, maxit =2000)

p.nnet <− predict(n2, newdata=test , type=”class”) plot(p.nnet ,test$Emotion)

summary ( n2 )

tabella .sommario(p.nnet ,test$Emotion)

GAM

library (VGAM)

fg1 <− as.formula(paste(“Emotion ~s(“, paste(names(train[−1]), collapse=”)+s (“) ,”)”))

gam.model <− vgam(fg1 , family=multinomial(refLevel = 1), data=train , trace=TRUE, maxit=30)

p1.gam <− predict(gam.model,newdata=test ,type= “response”)

pgam <− NULL
for (i in 1:nrow(p1.gam))

{

pgam[i] <−which.max(p1.gam[i,])

 

}

t a b e l l a . s o m m a r i o ( pgam , t e s t $ E m o t i o n )

Regressione logistica LASSO

train2 <− model.matrix(f1 , data=train) library (glmnet)

fit .glmnet <− glmnet(train2[,−1],train$Emotion , family=”multinomial”, alpha=1, maxit=200000)

summary( f i t . glmnet )

par(mfrow=c(3 ,3))

plot( fit .glmnet)

names( fit .glmnet)

# cross validation per il lambda

cv . glmnet <− NULL
p.gnet <− NULL
nlambda <− length( fit .glmnet$lambda)

for(i in 1:nlambda) {

p.cv <− predict(fit.glmnet,test2[,−1],s=fit.glmnet$lambda[i], type=”response “)

for(j in 1:nrow(p.cv))

{

}

p.gnet[j] <− which.max(p.cv[j , ,]) }
tab <− table(p.gnet ,test$Emotion) cv.glmnet[i] <− 1−sum(diag(tab))/sum(tab)

# previsione per con il lambda migliore

p.glmnet <− predict(fit.glmnet, test2[,−1], s=fit.glmnet$lambda[77], type=”response “)

for(j in 1:nrow(p.glmnet))

p.gnet[j] <− which.max(p.glmnet[j , ,]) tabella .sommario(p.gnet ,test$Emotion)

MARS

library (

f i t . mars

summary(

p l o t ( f i t

earth )

<− earth ( train2 , train$Emotion ) fit .mars)
. mars )

p.mars <− predict(fit.mars,newdata=test2, type=”response”) summary(p.mars)

pmars <− NULL

91

 

92

for(j in 1:nrow(p.mars)){

pmars[j] <− which.max(p.mars[j,]) } tabella .sommario(pmars,test$Emotion)

SVM

library (e1071)

# cross validation per il parametro di tuning

Appendice

cv.svm<−tune(svm,train2,train$Emotion, ranges=list(cost=2^(−2:4)),

summary(cv .svm)

# scelgo la costante migliore

tunecontrol=tune . control ( sampling=”cross ” ,

cross =20))

fit.svm <− svm(train[,−1],train$Emotion,kernel=”radial”,cost=2) summary( fit .svm)
p.svm <− predict(fit.svm, newdata=test[,−1])

tabella .sommario(p.svm,test$Emotion)

K Nearest-Neighbors

library ( ipred )

fit .nn <− ipredknn(f1 ,data=train ,k=2)
p.nn<− predict.ipredknn(fit.nn, newdata=test, type=”class”)

tabella .sommario(p.nn,test$Emotion)

Selezione delle variabili

# Analisi discriminante lineare

library (klaR)

sel.lda <− stepclass(f1, train, method=”lda”, improvement = 0.01) sel . lda$model

# Regressione LASSO

lasscoef <− coef( fit .glmnet , s=fit .glmnet$lambda[77])
matlass <− cbind(as.matrix(lasscoef$Neu),as.matrix(lasscoef$Ang),

as . matrix ( lasscoef$Con ) , as . matrix ( lasscoefDis ) ,

as . matrix ( lasscoef$Fea ) , as . matrix ( lasscoef$Hap ) ,

as . matrix ( lasscoef$Sad ) , as . matrix ( lasscoef$Sur ))

colnames(matlass) <− c(“Neutral”,”Anger”,”Contempt”,”Disgust”,”Fear”, “Happiness”,”Sadness”, “Surprise”)

round ( matlass , 1)

# Boosting e Random Forest

 

sort(round(fit.ada$importance, 3), decreasing=TRUE)

sort(round(fit.rf$importance, 3), decreasing=TRUE)

Confronto tra i modelli

# Indice AUC

library (pROC)

roc.glm <− multiclass.roc(p1.glm, as.numeric(test$Emotion), percent=TRUE)

ci.glm <− ci(p1.glm, as.numeric(test$Emotion)) # CI roc.lda <− multiclass.roc(as.numeric(p.lda$class),

as . numeric ( test$Emotion ) ,

percent=TRUE)

p.net <− factor(p.nnet, levels=emotions) roc.nnet <− multiclass.roc(as.numeric(p.net),

as . numeric ( test$Emotion ) ,

percent=TRUE)

roc.lasso <− multiclass.roc(p.gnet, as.numeric(test$Emotion), percent=TRUE)

p.boost <− factor(p.ada$class , levels=emotions) roc.ada <− multiclass.roc(as.numeric(p.boost),

as . numeric ( test$Emotion ) ,

percent=TRUE)

roc.rf <− multiclass.roc(as.numeric(p.rf),

as . numeric ( test$Emotion ) ,

K Nearest Neighbors

MCMC per la classi cazione

percent=TRUE)

probknn <− function(data ,bmax,K,tau ,r ,Nsim) {
response <− data [ ,1]

class <− levels(data[,1]) nclass <− length ( class )

n <− nrow(data)
theta=k=beta=log.post=error.rate <− rep(0,Nsim)
theta[1] <− rnorm(1,0,tau)
k[1] <− runif(1,1,K)
beta[1] <− (bmax*exp(theta[1]))/(exp(theta[1])+1)
log.post[1] <− −9999
cond.prob <− array(rep(0,n*nclass*(Nsim−1)),dim=c(n,nclass ,Nsim−1),

dimnames=list (1:n, class ,1:(Nsim−1)))
p.knn<− matrix(rep(0,n*nclass),ncol=nclass, dimnames=list(1:n,class))

# Nearest Neighbours Matrix

distance.matrix <− as.matrix(dist(data[,−1],up=T,diag=T))
nearest <− t(apply(distance.matrix,1,order))[,−1] #nearest neighbours

for ( i

{

in 2:Nsim)

93

 

94 Appendice

theta.til <− rnorm(1,theta[i−1],tau)
k. til <− round(runif(1,max(1,k[i−1]−r),min(k[i−1]+r,K)))
beta. til <− (bmax*exp(theta. til ))/(exp(theta. til)+1)
knn.matrix <− nearest[,1:k.til] # k elements
prop <− matrix(0,n,nclass, dimnames=list(1:n,class)) # proportion

for (j in 1:n)

{

}

{

}

for(j in 1:nclass)

i f ( i s . n u l l ( n c o l ( knn . m a t r i x ) ) )

{ prop[j,] <− response[knn.matrix[j]] } else

{ prop[j ,] <− summary(response[knn.matrix[j ,]])/k. til } for (v in 1:n)

{

}

cond.prob[v,j,i−1] <− (exp(beta.til*prop[v,j])) / sum(exp(beta. til*prop[v,]))

product <− matrix(0,n,1)
log.prior <− log(runif(1,0,beta.til)*runif(1,1,k.til)) for (t in 1:n)
{

product[t] <− cond.prob[t,as.numeric(response)[t],i−1]

}

log.lik <− sum(log(product))
log.post[i] <− log.lik+log.prior
log.rho <− log.post[i]−log.post[i−1]+theta.til−theta[i−1]+

log((1+exp(theta[i−1]))^2)−log((1+exp(theta. til))^2)+ dunif(k.til ,k[i−1]−r,k[i−1]+r)−dunif(k[i−1],k.til−r,k.til+r)

if(runif(1) < exp(log.rho))

{

}

else

{

}

}

beta[i] <− beta.til theta[i] <− theta.til k [ i ] <− k . t i l

beta[i] <− beta[i−1] theta[i] <− theta[i−1] k[i] <− k[i−1]

for(e in 1:n)

p.knn[e,] <− apply(cond.prob[e,,],1,mean) list(pred=data.frame(p.knn),par=data.frame(beta,theta,k, log.post))

}

 

# Matrice di confusione

p.mcmc <− c(rep(0,nrow(data))) for(i in 1:nrow(data))

p.mcmc[i] <− which.max(knn1.mcmc$pred[i,]) tabella <− table(p.mcmc,data$Emotion)
error <− 1−sum( diag ( tabella ))/sum( tabella )

MCMC per selezione delle variabili

var.sel <− function(data,bmax,K,tau,r,Nsim) {
response <− data [ ,1]

class <− levels(data[,1])
nclass <− length ( class )
covariates <− colnames(data[,−1])

n <− nrow(data)
p <− ncol(data[,−1]) k=beta=log . post <− rep (0 ,Nsim) k[1] <− runif(1,1,K)
beta[1] <− exp(rnorm(1,0,tau))

log.post[1] <− −9999 data1 <− data[,−1]

gamma <− matrix(rep(0,Nsim*p),nrow=Nsim,ncol=p) for(j in 1:p)

{

}

for ( i

{

gamma[1 , j ] <− rbinom (1 ,1 ,0.5)

in 2:Nsim)

zero <− which(gamma[i−1,]== 0) # Nearest Neighbours Matrix

distance.matrix <− as.matrix(dist(data1[,−c(zero)],up=T,diag=T)) nearest <− t(apply(distance.matrix,1,order))[,−1] #nearest neighbours beta. til <− exp(rnorm(1,log(beta[i −1]),tau))
k. til <− round(runif(1,max(1,k[i−1]−r),min(k[i−1]+r,K)))
knn.matrix <− nearest[,1:k.til] # k elements
prop <− matrix(0,n,nclass, dimnames=list(1:n,class)) # proportion
for (j in 1:n)
{

}

i f ( i s . n u l l ( n c o l ( knn . m a t r i x ) ) )

{ prop[j,] <− response[knn.matrix[j]] } else

{ prop[j ,] <− summary(response[knn.matrix[j ,]])/k. til }

cond.prob <− matrix(NA,n,nclass, dimnames=list(1:n,class)) for (v in 1:n)

{

95

 

96

}

Appendice

for(j in 1:nclass)

{

cond.prob[v,j] <− (exp(beta.til*prop[v,j])) / sum(exp(beta. til*prop[v,]))

}

product <− matrix(0,n,1) log.prior <− 0
for (t in 1:n)
{

product[t] <− cond.prob[t,as.numeric(response)[t]]

}

log.lik <− sum(log(product)) log.post[i] <− log.lik+log.prior log.rho <− log.post[i]−log.post[i−1]+

pnorm(k.til ,k[i−1])−pnorm(k[i−1],k.til) if(runif(1) <= exp(log.rho))

{

}

else

{

}

beta[i] <− beta.til k [ i ] <− k . t i l

beta[i] <− beta[i−1] k[i] <− k[i−1]

# reversible jump

for(w in 1:p)

{

if(w%in% zero)

{

}

else

{

}

z e r o . p <− c ( z e r o [ ! z e r o == w ] )

z e r o . p <− c ( z e r o , w )

distance.p <− as.matrix(dist(data1[,−c(zero.p)],up=T,diag=T)) nearest.p <− t(apply(distance.p,1,order))[,−1] #nearest neighbours

knnmat.p <− nearest .p[ ,1:k[ i ]]
prop.p<− matrix(0,n,nclass, dimnames=list(1:n,class)) # proportion for (j in 1:n)
{

}

# k elements

  • {  prop.p[j,] <− response[knnmat.p[j]] } else
  • {  prop.p[j ,] <− summary(response[knnmat.p[j ,]])/k[i] }

i f ( i s . n u l l ( n c o l ( knnmat . p ) ) )

 

cond.p<− matrix(NA,n,nclass, dimnames=list(1:n,class)) for (v in 1:n)

{

}

{

}

for(j in 1:nclass)

cond.p[v,j] <− (exp(beta[i]*prop.p[v,j])) /
sum ( e x p ( b e t a [ i ] * p r o p . p [ v , ] ) )

product.p <− rep(0,n) logprior.p <− log(runif(1,0,1)) for (t in 1:n)

{

}

product.p[t] <− cond.p[t,as.numeric(response)[t]]

loglik .p <− sum(log(product.p)) logpost .p <− loglik .p+logprior .p alpha <− logpost.p − log.post[i] if(runif(1) <= exp(alpha))

{

}

else

{

if (w%in%zero)

}

{

}

else

{

}

}

}

zero <− c(zero ,w)

zero <− c(zero [! zero == w])

{

}

else

{

gamma[i,w] <− 1

gamma[i,w] <− 0 log.post[i] <− logpost.p

}

gamma[ i ,w] <− gamma[ i −1,w] if(gamma[i,w] == 0)

d a t a . f r a m e ( b e t a , k , l o g . p o s t , gamma )

}

97

98 Appendice

# Frequenza dei sottomodelli

inc <− matrix(NA,Nsim*Nsim,1) riga=1

 

for ( i

{

}

in

1:Nsim)

 

for ( j in

1:Nsim)

 

{

}

inc[riga] <− (all(simulation[i,]==simulation[j ,])) riga = riga +1

 

riga <− riga +1

match <− matrix(inc[!is.na(inc)],Nsim,Nsim)
diag(match) <− NA
freq <− summary(factor(trunc((which(match==TRUE)/Nsim)+1))) barplot ( freq )

 

 

Riferimenti bibliografici

Ahuja, N., Kriegman, D. e Yang, M. (2002). Detecting faces in images: a

survey. Pattern Analysis and Machine Intelligence. IEEE Transaction

on, 24, 34-58.

Ahn, S. J., Bailenson, J. e Jabon, M. (2008). Facial Expressions as Pre-

dictors of Online Buying Intention. In Proceedings of the 58th Annual

International Communication Association Conference.

Arya, A., Di Paola, S. e Parush, A. (2009). Perceptually Valid Facial Ex-

pressions for Character-Based Applications. International Journal of

Computer Games Technology, ed. 2009, 13 pagine.

Azzalini, A. e Scarpa, B. (2004). Analisi dei dati e data mining. Springer-

Verlag, Milano.

Bartlett, M., Donato, G., Ekman, P., Hager, J. e Sejnowski, T. (1999).

Classifying facial actions. IEEE Transaction on Pattern Analysis and

Machine Intelligence, 21, 974 989.

Bartlett, M.,Fasel, I.,Frank, M., Littlewort, G., Whitehill, J. e Wu, T.

(2011). The Computer Expression Recognition Toolbox. IEEE In-

ternational Conference on Automatic Face, Gesture Recognition and

Workshops, 298 – 305.

Bartlett, M., Fasel, I., Littlewort, G., Movellan, J. e Susskind, J. (2006). Dy-

namics of facial expression extracted automatically from video. Image

and Vision Computing, 24, 615-625.

Bartlett, M., Lee, K. e Littlewort, G. (2009). Automatic coding of Fa-

cial Expressions displayed during Posed and Genuine Pain. Image and

Vision Computing, 27, 1797-1803.

99

100 Riferimenti bibliogra ci

Bartlett, M., Littlewort-Ford, G., Braathen, B., Fasel, I., Hershey, J., Marks,

T., Movellan, J.R., Sejnowski, T. e Smith, E. (2001). Automatic ana-

lysis of spontaneous facial behavior: a nal project report. Technical

Report INC-MPLab-TR.

Bartlett, M. e Whitenill, J. (2010). Automated Facial Expression Measu-

rement: Recent Applications to Basic Research in Human Behavior,

Learning and Education. Oxford University Press, Oxford.

Beauchemin, S.S. e Barron, J.L. (1995). The computation of optical ow.

ACM Computing Surveys, 27, 433-466.

Black, M.J. e Yacoob, Y. (1997). Recognizing Facial Expressions in Ima-

ge Sequences Using Local Parameterized Models of Image Motion.

lnternational Journal of Computer Vision, 25, 23-48.

Breiman, L. (1996). Bagging Predictors. Machine Learning, 24, 123 140.

Breiman, L. (2001). Random Forests. Machine Learning, 45, 5-32.

Breiman, L., Friedman, J. H., Olshen, R. A. e Stone, C. J. (1984). Classi-

cation and Regression Trees. Wadsworth, Belmont, CA.

Cassel, T.D., Cohn, J.F., Messinger, D.S. (2008). The dynamics of infant

smiling and perceived positive emotion. Journal of Nonverbal Behavior,

32, 133-155.

Chen, L. (2000). Joint processing of ausio-visual information for the re-

cognition of emotional expressions in human-computer interaction. In

PhD thesis, University of Illinois.

Cohen, I.,Sebe, N., Cozman, F.G., Cirelo, M.C. e Huang, T. (2003). Lear-

ning Bayesian network classi ers for facial expression recognition using

both labeled and unlabeled data. In Proceedings of the IEEE Int. Conf.

on Computer Vision and Pattern Recognition, 1, 595-601.

Cohn, J.F., Kanade, T., Moriyama, T., Ambadar, Z., Xiao, J., Gao, J.

e Imamura, H. (2001). A comparative study of alternative facs coding

algorithms. Robotics Institute, Carnegie Mellon University, Pittsburgh.

Cootes, T. F., Edwards, G. J. e Taylor, C. J. (1998). Active Appearance

Models. Lecture Notes in Computer Science, 1407, 484-498.

101

Cootes, T. F., Edwards, G. J. e Taylor, C. J. (2001). Active Appearance Mo-

dels. IEEE Transactions on Pattern Analysis and Machine Intelligence,

23, 681-685.

Cootes, T. F., Taylor, C. J., Cooper, H. e Graham, J. (1995). Active shape

models-their training and application. Computer Vision and Image

Understanding, 61, 38-59.

Cortes, C. e Vapnik, V. (1995). Support-vector networks. Machine Lear-

ning, 20, 273-297.

Darwin, C. (1872). The Expression of Emotions in Man and Animals. D.

Appleton, New York.

Dasarathy, B. V. (1991). Nearest Neighbour (NN) Norms: NN Pattern

Classi cation Techniques. IEEE Computer Society Press, Los Alami-

tos.

Daugman, J. G. (1985). Uncertainty relation for resolution in space, spatial

frequency, and orientation optimized by two-dimensional visual cortical

lters. Journal of the Optical Society of America A, 2, 1160 1169.

Dellaportas, P., Forster, J.J. e Ntzoufras, I. (2002). On Bayesian model and

variable selection using MCMC. Statistics and Computing, 12, 27-36.

Dinges, D. F., Rider, R. L., Dorrian, J., McGlinchey, E. L. e Rogers, N. L.

(2005). Optical computer recognition of facial expressions associated

with stress induced by performance demands. Aviation, Space, and

Environmental Medicine, 76, 172-182.

Ekman, P. e Frank, M. (1997). The ability to detect deceit generalizes across

di erent types of high-stake lies. Personality and Social Psychology,

72,1429 1439.

Ekman, P. e Friesen, W. V. (1971). Constants across cultures in the face and

emotion. Journal of Personality and Social Psychology, 17, 124-129.

Ekman, P. e Friesen, W. V. (1978). Facial Action Coding System: A Techni-

que for the Measurement of Facial Movement. Consulting Psychologists

Press, Palo Alto.

Ekman, P. e Friesen, W. V. (1982). Rationale and reliability for EMFACS

Coders. University of California, San Francisco.

102 Riferimenti bibliogra ci

Ekman, P. Friesen, W. V. e Tomkins, S. S. (1971). Facial A ect Scoring

Technique. A rst validity study. Semiotica, 3, 37-58.

Ekman, P., Hager, J., Irwin, W. e Methvin, C. (1969). Ekman-Hager Fa-

cial Action Exemplars. Human Interaction Laboratory, University of

California, San Francisco.

Essa, I.A. e Pentland, A. P. (1997). Coding, analysis, interpretation, and

recognition of facial expressions. Pattern Analysis and Machine Intel-

ligence. IEEE Transactions on, 19, 757-763.

Fasel, B. e Luettin, J. (2003). Automatic facial expression analysis: Survey.

Pattern Recognition, 36, 259 275.

Feldt, K.S., Hamamoto, D.T., Hodges, J.S., Hsu, K.T. e Shuman, S.K.

(2007). The application of facial expressions to the assessment of oro-

facial pain in cognitively impaired older adults. Department of Primary

Dental Care, University of Minnesota.

Ford, G. (2002). Fully automatic coding of basic expressions from video.

Technical Report INC-MPLab.

Freund, Y. e Schapire, R.E. (1996). Experiments with a new boosting

algorithm. In Proceedings of the Thirteenth International Conference

on Machine Learning, 148 156.

Fridlund, A. J. (1994). Human facial expression: An evolutionary view.

Academic Press, San Diego.

Fridlund, A. J., Oster, H. e Ekman, P. (1987). Facial Expressions of

Emotion. Nonverbal behavior and communication, 2nd ed., 143-223.

Friedman, J. (1991). Multivariate Adaptive Regression Splines. Annals of

Statistics, 19, 1 141.

Friedman, J., Hastie, T. e Tibshirani, R. (2008). Regularization Paths

for Generalized Linear Models via Coordinate Descent. Journal of

Statistical Software, 33, 1-22.

Friesen, W. V e Ekman, P. (1992). Changes in FACS Scoring: Instruction

manual. Human Interaction Lab., San Francisco.

Frijda, N. H., Kuipers, P. e Schure, E. (1989). Relations among emotion,

appraisal, and emotional action readiness. Journal of Personality and

Social Psychology, 57, 212-228.

103

Gross, R., Jain, K. e Li, S.Z. (2005). Face Databases, Handbook of Face

Recognition. Springer-Verlag, New York.

Hand D. J. e Till, R. J. (2001). A Simple Generalisation of the Area Under

the ROC Curve for Multiple Class Classi cation Problems. Machine

Learning, 45, 171-186.

Hastie, T., Tibshirani, R e Friedman, J. (2009).The Elements of Statistical

Learning. Data Mining, Inference, and Prediction. Second Edition.

Springer-Verlag, New York.

Hastings, W.K. (1970). Monte Carlo sampling methods using Markov

chains and their applications. Biometrika, 57, 97-109.

Heisele, B., Serre, T., Poggio, T. e Pontil, M. (2001). Component-based

face detection. Proc. IEEE Conf. on Computer Vision and Pattern

Recognition, 1, 657-662.

Hjortsjö, C. H. (1969). Man’s Face and Mimic Language. Nordens Boktrye-

keri, Malmö.

Huang, C.-L. e Huang, Y.-M. (1997). Facial Expression Recognition Using

Model-Based Feature Extraction and Action Parameters Classi cation.

Journal of Visual Communication and Image Representation, 8, 278-

290.

Izard, C. E. (1977). Human Emotions. Springer, New York.

Izard, C.E. (1979). The maximally discriminative facial movement co-

ding system (MAX). Instructional Technology Center, University of

Delaware.

Izard, C.E. e Dougherty, L.M. (1980). System for identifying a ect expres-

sions by holistic judgments (A ex). Instructional Resources Center,

University of Delaware.

Jones, M. e Viola, P. (2001). Robust real-time object detection. In Inter-

national Workshop on Statistical and Computational Theories of Vi-

sion – Modeling, Learning, Computing, and Sampling, CRL-2001-1,

24 pagine.

Kanade, T., Cohn, J.F. e Tian, Y. (2000). Comprehensive database for

facial expression analysis. Automatic Face and Gesture Recognition.

Proceedings. Fourth IEEE International Conference on, 46-53.

104 Riferimenti bibliogra ci

Kanade, T. e Tian, Y. (2005). Facial Expression Analysis. University of

Pittsburgh, Pittsburgh.

Li, S. e Gu, L. (2001). Real-time multi-view face detection, tracking, pose

estimation, alignment, and recognition. In IEEE Conf. on Computer

Vision and Pattern Recognition Demo Summary.

Li, S. Z. e Jain, A. K. (2005). Handbook of Face Recognition. Springer

Science Business Media, New York.

Lien, J.J., Kanade, T., Cohn, J. F. e Li, C.C. (1998). Automated Facial Ex-

pression Recognition Based on FACS Action Units. Conf. Automatic

Face and Gesture Recognition. Proceedings. Third IEEE International

Conference on, 390-395.

Lucey, P., Cohn, J.F., Kanade, T., Saragih, J., Ambadar, Z. e Matthews,

I. (2010). The Extended Cohn-Kanade Dataset (CK+): A comple-

te dataset for action unit and emotion-speci ed expression.Computer

Vision and Pattern Recognition Workshops. IEEE Computer Society

Conference on., 94-101.

Mardia, K. V., Kent, J.T. e Bibby J.M. (1979). Multivariate Analysis.

Academic Press, Londra.

Marin, J.M. e Robert, C.P. (2007). Bayesian core: a practical approach to

computational Bayesian statistics. Springer Science+Business Media,

New York.

Matthews, I e Baker, S. (2004). Active Appearance Models Revisited.

International Journal of Computer Vision 60, 135-164.

Osgood, C.H., Hastorf, A. H. e Ono, H. (1966). The Semantics of Facial Ex-

pressions and the Prediction of the Meanings of Stereoscopically Fused

Facial Expressions. Scandinavian Journal of Psychology, 7, 179 188.

Pantic, M. e Rothkrantz, L. J. M. (2000). Expert System for Automa-

tic Analysis of Facial Expressions. Image and Vision Computing, 18,

881 905.

Pentland, A., B. Moghaddam, B. e Starner, T. (1994). View-based and

modular eigenspaces for face recognition. Proc. IEEE Conf. Computer

Vision and Pattern Recognition, 84 91.

105

R Development Core Team (2012). R: A language and environment for

statistical computing. R Foundation for Statistical Computing, Vienna,

Austria.

Ripley, B. D. (1996). Pattern Recognition and Neural Networks. Cambridge

University Press, Cambridge.

Robert, C.P. e Casella, G. (2004) .Monte Carlo statistical methods. Springer-

Verlag, New York.

Robert, C.P. e Casella, G. (2010) .Introducing Monte Carlo Methods with

R.. Springer-Verlag, New York.

Rowley, H.A., Baluja, S. e Kanade, T. (1998). Neural network-based face

detection. Pattern Analysis and Machine Intelligence, IEEE Transac-

tions on., 20, 23-38.

Schneiderman, H. e Kanade, T. (2000). A statistical method for 3d object

detection applied to faces and cars. In IEEE Conference on Computer

Vision and Pattern Recognition, 1, 746-751.

Stone, C. J, Kooperberg, C. e Bose, S. (1997). Polychotomous regression.

Journal of the American Statistical Association, 92, 117 127.

Tian, Y.-L., Brown, L., Hampapur, A., Pankanti, S., Senior, A. e Bolle,

R. (2003). Real world real-time automatic recognition of facial expres-

sions. Proceedings of IEEE Workshop on performance evaluation of

tracking and surveillance, 9-16.

Tian, Y., Kanade, T. e Cohn, J. F. (2001). Recognizing action units

for facial expression analysis. IEEE Trans. on Pattern Analysis and

Machine Intelligence, 23, 97-115.

Tian, Y., Kanade, T. e Cohn, J. F. (2002). Evaluation of Gabor-wavelet-

based facial action unit recognition in image sequences of increasing

complexity. Proceedings of the 5th IEEE International Conference on,

ed. 2002, 229 – 234.

Wang, P., Barrett, F., Martin, E., Milonova, M., Gurd, R. E., Gurb, R. C.,

Kohler, C. e Verma, R. (2008). Automated video- based facial expres-

sion analysis of neuropsychiatric disorders. Journal of Neuroscience

Methods, 168, 224 238.

Wen, Z e Huang, T. (2003). Capturing subtle facial motions in 3d face

tracking. Proc. of Int. Conf. On Computer Vision, 2, 1343 – 1350.

106 Riferimenti bibliogra ci

Whitehill, J., Bartlett, M. e Movellan, J. (2008). Automatic facial expres-

sion recognition for intelligent tutoring systems. IEEE Conference on

Computer Vision and Pattern Recognition, 1-6.

Woodworth, R. S. (1938). Experimental psychology. Holt, Oxford.

Yacoob, Y. e Davis, L.S. (1996). Recognizing human facial expressions from

long image sequences using optical ow. Pattern Analysis and Machine

Intelligence, IEEE Transactions on., 18, 636 – 642.

Yee, T. W. e Wild, C. J. (1996). Vector generalized additive models.

Journal of the Royal Statistical Society, Series B, Methodological, 58,

481 493.

Zhang, Z., Lyons, M., Schuster, M. e Akamatsu, S. (1998). Comparison

Between Geometry-Based and Gabor-Wavelets-Based Facial Expres-

sion Recognition Using Multi-layer Perceptron. In Proceedings of the

Third IEEE International Conference on Automatic Face and Gesture

Recognition, ed. 2008, 454 – 459.

Zhu, J., Rosset, S., Zou, H. e Hastie, T. (2009). Multi-class AdaBoost.

Statistics and Its Interface, 2, 349 360.

Michele Laurelli

Nato nel 1991 ad Albenga (SV), mi definisco curioso, ambizioso, creativo e passionale. Appassionato di comunicazione. Perfezionista ed ossessionato dal controllo. Incorreggibilmente romatico. Instancabile viaggiatore.

Leave a Reply

%d bloggers like this: