【发布时间】:2013-11-28 00:00:53
【问题描述】:
我目前正在尝试使用 PCA 和 ICA 算法。我现在使用 PCA 来创建特征脸集、选择最佳特征脸并重建图像非常舒服,而且我还能够使用 PCA 来执行面部幻觉。我希望对 ICA 做同样的事情,但我不确定如何做到这一点。
到目前为止我采取的步骤是这样的,执行 PCA,找到代表特征面的正交特征向量。目前正在耶鲁大学 ORL 和 PIE 数据库上进行实验
然后我像这样对这些特征向量执行 fastica
%Perform ICA on eigenvectors transposed
%icasig = source matrix
%A denotes unknown mixing matrix
%W denotes unmixing matrix - inverse of A
%Variable R are the orthogonal eigenvectors
[icasig A W] = fastica(R');
然后我实现了 ICA 架构 1 来查找 ICA 系数。 ICA架构1的算法可以在这里找到
http://www.sciencedirect.com/science/article/pii/S1077314203000778
只需向下滚动到第 2.3.1 节
%centeredMatrix is the image matrix of my training set minus the mean so here
%I take out one of the mean centered images
x = centeredMatrix(:,1);
%Calculate Independent basis images
U = W * R';
%Calculate PCA Coefficients
C = x' * R;
%Calculate ICA Coefficients
B = C * inv(W);
% plot first 16 PCA faces
figure; hold on;
for i=1:16
subplot(4,4,i);
comp = reshape(R(:,i), width, height);
imagesc(comp),colormap('gray')
title(sprintf('PCAFace #%i', i));
end
% plot first 16 ICAFaces
figure; hold on;
for i=1:16
subplot(4,4,i);
comp = reshape(U(i,:), width, height);
imshow(comp);
title(sprintf('ICAFace #%i', i));
end
我知道我可以由此进行 PCA 重建
%-----------------PCA Reconstruction----------
%Eigenvectors * pcaCoefficients + mean image
pcaRecon = (R * C') + mu;
pcaRecon = uint8(pcaRecon);
pcaRecon = reshape(pcaRecon,width,height);
figure, imshow(pcaRecon), title('PCA Recon');
但我不确定我将如何进行 ICA 重建。通过实现 ICA 架构 1,我已经能够通过这样做来执行重建
%-----------------ICA Reconstruction----------
icaRecon = (icasig' * B') + mu;
icaRecon = uint8(icaRecon);
icaRecon = reshape(icaRecon,width,height);
figure, imshow(icaRecon), title('ICA Recon');
但我不确定这是否是一种很好的重建方法,与 PCA 相比,它似乎不是很有效。上面的代码是在有 165 张图像的耶鲁数据库上测试的。使用 PCA,我可以使用大约 80 个特征脸,并且仍然可以获得非常高质量的图像 而在这里使用 ICA 方法,我必须使用大约 105 - 110 才能获得类似质量的图像。与 ORL 数据库相同,它包含 400 张图像,可以执行 PCA,gen eigenfaces,然后使用大约 120 个特征面进行重建并获得非常高质量的图像,而使用 ICA,需要大约 380 个组件才能获得类似质量的重建
我还是 ICA 的新手,所以还有很多东西要学,但如果可能的话,我想回答几个问题
1:我用来重建的这个ICA方法是不是一个好方法?或者有没有更好的方法可以推荐。我有
2:为什么我需要用这么多的组件和ICA来做重构,我猜这是我的方法有问题?
如果有人能给我指出正确的方向或向我解释一种更好的重建方法,我将不胜感激。
提前致谢
编辑:
来自 ORL 数据库的示例结果,将原始结果与 PCA 和 ICA 重建进行比较。使用 200 个特征面完成 PCA 重建,使用 200 个 IC 完成 ICA 重建。如您所见,ICA 重建相比之下相当差
【问题讨论】: