PCA可能是一个正确的选择(但不是唯一的一个)。虽然,您应该意识到,PCA不会自动减少输入数据功能的数量。我建议你阅读本教程:http://arxiv.org/pdf/1404.1100v1.pdf - 这是我用来了解PCA和它对初学者非常好的一个。
回到你的问题。图像是324维空间中的矢量。在这个空间中,第一个基矢量是在左上角有一个白色像素的矢量,下一个像素是白色,另一个是黑色 - 以此类推。它可能不是代表这个图像数据的最佳基矢量。 PCA计算新的基向量(COEFF矩阵 - 新向量表示为旧向量空间中的值)和新图像向量值(SCORE矩阵)。此时,您还没有丢失任何数据(不减少功能数量)。但是,你可以停止使用一些新的基本向量,因为它们可能与噪声连接,而不是数据本身。在教程中详细介绍了这些内容。
images = rand(10,324);
[COEFF, SCORE] = princomp(images);
reconstructed_images = SCORE/COEFF + repmat(mean(images,1), 10, 1);
images - reconstructed_images
%as you see there are almost only zeros - the non-zero values are effects of small numerical errors
%its possible because you are only switching between the sets of base vectors used to represent the data
for i=100:324
SCORE(:,i) = zeros(10,1);
end
%we remove the features 100 to 324, leaving only first 99
%obviously, you could take only the non-zero part of the matrix and use it
%somewhere else, like for your neural network
reconstructed_images_with_reduced_features = SCORE/COEFF + repmat(mean(images,1), 10, 1);
images - reconstructed_images_with_reduced_features
%there are less features, but reconstruction is still pretty good
你提到的Thee tutorial paper is not available。你有任何其他网址吗? –
我编辑了我的文章并提供了一个工作链接,取自作者的页面:http://shlens.wordpress.com/tutorials/。 –