Hello,
How can reduce a feature vector of dimension K*N to a feature vectore of dimension K*M with M<N (image classification task)?
I read about PCA but I am not understanding how can I use it to get the K*M vector.
Appreciate your help!

4 件のコメント

J. Alex Lee
J. Alex Lee 2021 年 6 月 9 日
i don't think your question makes sense...if you have just one point in your N-space, there's no information to help you decide anything
Andrea Daou
Andrea Daou 2021 年 6 月 9 日
Sorry I edited my question it is a K*N feature (K depends on the number of images in the classification task when training the system)
Andrea Daou
Andrea Daou 2021 年 6 月 9 日
編集済み: Andrea Daou 2021 年 6 月 9 日
I read about [coeff, score] = pca(features) but for example if I have a dimesion equal to 1340*5435 and I want to pass to 1340*M, is new_features = score(:,1:M) a good solution ?
This solution has a limitation: M cannot take a value > 1340
Thank you in advance,
J. Alex Lee
J. Alex Lee 2021 年 6 月 9 日
I'm not sure what is returned by pca(), but presumably coeff is KxN (the rotated coefficents)? Then is your question how to decide M? Is score a vector 1xN?

サインインしてコメントする。

 採用された回答

the cyclist
the cyclist 2021 年 6 月 9 日

0 投票

I have written an answer to this question that explains in detail how to use MATLAB's pca function, including how to do dimensional reduction. I suggest that you read that question, answer, comments from other users, and my responses. I expect this will answer your question.

4 件のコメント

Andrea Daou
Andrea Daou 2021 年 6 月 10 日
Thank you for this very detailed and helpful explanation!
Andrea Daou
Andrea Daou 2021 年 6 月 11 日
I have one more question, if you can help me please.
I reduced the dimension of the features to train an image classifier. Suppose that the feature that trained the classifier are of dimension K*M now (features extracted from K samples using CNN).
Now I want to use this classifier to classify a new image. First I adopted the same approach of feature extraction so before any dimension reduction the features of this image are of dimension 1*N. But if I want to use the classifier I need to give it a 1*M features dimension so it can accept it as it was trained on K*M dimension.
It is not logic to use PCA for a 1D vector and cannot be done also. So how can I reduce the dimension of the new image feature so it can be classified ?
Sorry for this long paragraph! Thank you in advance!
the cyclist
the cyclist 2021 年 6 月 11 日
Use the coeff matrix from the PCA you did previously, to transform the 1xN vector in the original space into a 1xN vector in the PC space, then use the first M columns. That 1xM vector is the feature-reduced vector in the new space.
Andrea Daou
Andrea Daou 2021 年 6 月 11 日
Okay, Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Dimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by