Jane
Jane

Reputation: 65

Extracting features in fastICA (Matlab)

I am a machine learning beginner and I would really appreciate your help.

I'm trying to use the FastICA MATLAB toolbox and after epic amount of googling and reading documentation about it I am just getting more and more confused.

I am using the Car Data Set and I am using 1000 100x40 images (500 car, 500 not-car). I am using fastica to find the independent components (I will use them to build a car detection system later).

I am running the following code on my train data set:

[icasig, A, W] = fastica(Training_Set);

A and W are 1000x1000 matrices and icasig is 1000x4000 matrix and as I understand icasig's rows contain the independent components and A is the mixing matrix.

How can I plot the independent components? Can someone explain to me in simple English what is W?

Also another thing that is confusing me is, if I delete some rows in icasig and get for example 300x4000 matrix am I doing feature compression?

If I use a classification algorithm (for example SVM) how can I vary the number of independent components that I am using to train it? I think that rica is perfect for this but unfortunately I don't have the Statistics and Machine Learning Toolbox.

Upvotes: 0

Views: 887

Answers (1)

Anthony
Anthony

Reputation: 3793

Can someone explain to me in simple English what is W?

w in ICA usually represents a separating matrix. Given a mixed image, X, one can get independent components by calculating wX. The result, S, will usually be another matrix whose size is identical to X. Each row of S contains data that represent one independent component.

One of the major purposes of using ICA algorithm is to find the separating matrix, w. If you have no idea about it, I would suggest you read more literature before carrying on. Even fast ICA's Wikipedia page tells you about w.

How can I plot the independent components?

If icasig is S, you can try the following:

icasig = abs(icasig) % take the absolute

% you can add a for loop here to plot all components
component=icasig(1,:) % take the first component
im = reshape(component,[h,w,3]); % h being the height of the image of the component and w being the width
im=uint8 (round(im)); 
figure; imshow(im); 
% end of the for loop. Be prepared to have a lot of pictures poping up.

if I delete some rows in icasig and get for example 300x4000 matrix am I doing feature compression?

If deleting some individual components means feature compression, then yes.

Upvotes: 1

Related Questions