
Using Principal Component Analysis on Images - geb
http://blog.thehackerati.com/post/126701202241/eigenstyle
======
TTPrograms
PCA typically implies that the high dimensional data (images) lie on a low
dimensional linear manifold (the principal components). In this case the data
of interest (images of people in dresses) likely lies in a very non-linear
manifold, so non-linear methods would likely result in much more appropriate
models. This is part of why deep learning and tensor methods work so well on
image classification tasks.

Nonlinear methods would require much more data, unfortunately.

~~~
delhanty
> This is part of why deep learning and tensor methods work so well on image
> classification tasks.

That statement sounds informative. Do you have a good non-specialist's
reference?

~~~
jamessb
You might be interested by colah's (Christopher Olah's) blog:
[https://colah.github.io/](https://colah.github.io/)

Two articles in particular are good introductions to looking at neural
networks in terms of higher dimensional data lying on lower-dimesnional
manifolds:

Neural Networks, Manifolds, and Topology:
[https://colah.github.io/posts/2014-03-NN-Manifolds-
Topology/](https://colah.github.io/posts/2014-03-NN-Manifolds-Topology/)

Visualizing MNIST: An Exploration of Dimensionality Reduction:
[https://colah.github.io/posts/2014-10-Visualizing-
MNIST/](https://colah.github.io/posts/2014-10-Visualizing-MNIST/)

~~~
delhanty
Thank you for the useful links.

------
leni536
> Using components to recreate image

Well, it seems like to me that the recreated image is in the "training
dataset", otherwise the recreation seems too accurate. I would be interested
how it handles recreating new, but similar images.

~~~
astrosi
Likewise with the "predictions" of the authors likes/dislikes. Testing how the
model will perform on an independent data-set (or at least cross validation
[1]) would be much more interesting.

[1] [https://en.wikipedia.org/wiki/Cross-
validation_(statistics)](https://en.wikipedia.org/wiki/Cross-
validation_\(statistics\))

~~~
gwern
The other thing I wondered about the predictions: she apparently rated all of
the dresses, and the top/bottom matched the ratings. Fair enough. But what
about the residuals, the missclassified ones - the ones where the logistic
regression predicts a high or low score and her rating was actually the
opposite? That might be interesting to look at.

~~~
dspeyer
That's there. Search for:

> The misclassifications are interesting too

One problem seems to be that it concluded she'd dislike anything the exact
opposite color from her favorite shade of red. A common flaw in linear models.

------
animefan
PCA implicitly uses a quadratic form on a vector space. When done the usual
way, this is just the identity matrix. But for image data, I think you would
get better results using a quadratic form based on a kernel, so that Q_ijkl
where (i,j) and (k,l) are pixel coordinates, is given by Q_ijkl = t((i-k)^2 +
(j,l)^2) for some kernel function t.

------
stared
Nice to see it (especially on other image data than just faces). But typically
non-negative matrix decomposition creates less ghostly images, with an easier
interpretation.

See e.g.
[http://www.quantumblah.org/?p=428](http://www.quantumblah.org/?p=428) or
[http://scikit-
learn.org/stable/auto_examples/decomposition/p...](http://scikit-
learn.org/stable/auto_examples/decomposition/plot_faces_decomposition.html)
(comparison of PCA and non-negative matrix factorization).

Of course, the non-negative factorization comes at some cost (mostly: much
higher computational complexity), but it may be worth trying.

------
ucaetano
"These aren’t that bad. I do kinda like them, but think they’d be nicer with
some minor adjustments (slightly less form-fitting, slightly less loud
pattern, slightly brighter color)."

Would it be possible to use the like/dislike system to make/suggest the minor
changes to the dresses?

------
dthal
Is this dataset available anywhere? I see the code on github, but I don't see
the data anywhere.

------
got2surf
Really interesting, does anyone know more information on how the initial
eigendresses were computed? Was there image processing to distill the dress
into major components, hand tagging of variables (like short/long, color,
etc), or just raw pixel data processed?

~~~
thisjepisje
You might wanna do a search for "eigenfaces" (as opposed to "eigendresses" :P)

[https://en.wikipedia.org/wiki/Eigenface](https://en.wikipedia.org/wiki/Eigenface)

~~~
afarrell
Reading that, I can't help but wonder how similar a machine-learned eigenface
is to an infant-learned one.
[http://lawcomic.net/guide/?p=3273](http://lawcomic.net/guide/?p=3273)

I wonder if there is some way to simulate the effect of growing up among
people of different races on eyewitness identification and test if it matches
what this lawyer is saying at
[http://lawcomic.net/guide/?p=3282](http://lawcomic.net/guide/?p=3282)

