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/。 –