Using Principal Component Analysis on Images
blog.thehackerati.com
blog.thehackerati.com
Nonlinear methods would require much more data, unfortunately.
Actually, I'd be even more interested in an NMF decomposition of the data, the weights for the 10-component approximation are [-17541.81, -12749.33, -3766.29, 2005.28, 4193.08, 6832.55, -6704.90, -2135.51, 1112.27, 7627.80]. and I wonder if a purely-additive approach will work better.
That statement sounds informative. Do you have a good non-specialist's reference?
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/
Visualizing MNIST: An Exploration of Dimensionality Reduction: https://colah.github.io/posts/2014-10-Visualizing-MNIST/
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.
It even works for dresses that were not in the training set:
Yes, that first dress is in the training data, but she did do reconstructions on dresses not used to build the PCA basis. They look decent, but they aren't as good as that first example. And, as she points out, they can't reproduce patterns that are not in the initial data very well, and can't reproduce accessories that were not in the initial data at all.Note since this is a linear approach, the choice of the colorspace can have a large impact on the results. You didn't mention the colorspace, my best bet is that you used sRGB. Maybe you can try it on a linear colorspace too.
Edit: According to the source you use PIL.Image.getdata(), which according to the doc returns "pixel values", then they have an RGB->XYZ conversion example that only works for linear colorspace. So it suggests that they already return linear RGB values, but many software mess these things up so I'm not 100% sure.
[1] https://en.wikipedia.org/wiki/Cross-validation_(statistics)
> 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.
EDIT: All of the data was used in forming the PCA basis, but that isn't (necessarily) an error, depending on the use-case. And the logistic regression model was evaluated on held-out data.
[1]https://github.com/graceavery/Eigenstyle/blob/master/visuals...
See e.g. http://www.quantumblah.org/?p=428 or http://scikit-learn.org/stable/auto_examples/decomposition/p... (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.
Would it be possible to use the like/dislike system to make/suggest the minor changes to the dresses?
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
Its pretty clear that this is PCA on raw pixels of the images, so no, there is no hand-tagging or anything else. The eigendresses are just the eigenvectors from PCA projected back into the original, image-scale, basis.