adil asked . 2021-06-30

Extracting Corner Features with PCA and feeding it to neural network

I am doing a project on vehicle type classification with Neural Networks( classification basis is => sedan,pick up,hatchback,etc type vehicles.)
I am doing  image processing for the first time and I have detected about 40 corners using Harris Edge Detection and thus I got a matrix A[40x2].
I am using only this feature as for classification.
Now I want to know how can I use PCA to extract features from it.I know what PCA is and what pca(A) or princomp(A)in matlab will return but I dont get how to use the output of pca function as a feature matrix.
1.Does a feature matrix need to be 1-D array.
2.Should I use principle components array which is the 2nd matrix returned by pca function as a feature matrix (its a 2-D matrix)
3.How can I train Neural Network for 3 classes(hatchback,sedan and pickup).
4.Lastly suppose I have N images for each class to train so do I need to train on each image individually or do I have to create a feature matrix that has a extra dimension = N.

principal componen... , neural network , class , classification , training , pca, digital image pro

Expert Answer

Neeta Dsouza answered . 2024-12-21 17:15:28

% Extracting Corner Features with PCA and feeding it to neural network
% Asked by Adil about 2 hours ago
% I am doing a project on vehicle type classification with Neural Networks( % classification basis is => sedan,pick up,hatchback,etc type vehicles.) % % I am doing image processing for the first time and I have detected about % 40 corners using Harris Edge Detection and thus I got a matrix A[40x2].
 
A = A(:); % Convert to an 80 dim column
%I am using only this feature as for classification.
%Now I want to know how can I use PCA to extract features from it.I know what PCA is and what %pca(A) or princomp(A)in matlab will return but I dont get how to use the output of pca function %as a feature matrix.
 
You are on the wrong track
 
1. Use PCA on all of the data to determine the ranking of orthogonal directions in which the data has the most spread. This is very useful for regression/curve-fitting but not necessarily for classification/pattern-recognition where the importance is on ranking directions of class separation, not total mixture spread.
2. The function PLS is the feature ranking function which is more appropo. I am struggling with it's use because I have not found an explanation which I fully understand. So, I do use PCA even though I know better.
3. I prefer using STEPWISEFIT, the linear model variable reduction function. It's suboptimal but does a great job of ranking the original variables (not orthogonal tranformed ones) for a linear model.
4. So, currently I use STEPWISEFIT However, if the dimensionality is huge,I may use PCA to get rid of obvious losers before using STEPWISEFIT.
5. It is not too hard to code a poor man's stepwise procedure where, for I input variables, performance is obtained when one of the variables is fixed at it's mean value. The variable associated with the best performance is deleted , the net is retrained, and the process is repeated. The procedure is ad hoc and has many variations. Nevertheless, variations are being used, satisfactorily, in real world situations.
 
% 1.Does a feature matrix need to be 1-D array.
Yes. A feature vector.
%2.Should I use principle components array which is the 2nd matrix returned by pca function as a feature matrix (its a 2-D matrix)
It would not be my first choice. See above.
 
% 3.How can I train Neural Network for 3 classes(hatchback,sedan and pickup).
Generate many feature vectors for each class (e.g. add noise to the ideal template). Use unit vector columns with a single 1 as targets.
help patternnet
practice on MATLAB classification/pattern-recognition datasets
help nndatasets
Search in NEWSGROUP and ANSWERS
greg patternnet
% 4.Lastly suppose I have N images for each class to train so do I need to train on each image % individually or do I have to create a feature matrix that has a extra dimension = N.


Not satisfied with the answer ?? ASK NOW

Frequently Asked Questions

MATLAB offers tools for real-time AI applications, including Simulink for modeling and simulation. It can be used for developing algorithms and control systems for autonomous vehicles, robots, and other real-time AI systems.

MATLAB Online™ provides access to MATLAB® from your web browser. With MATLAB Online, your files are stored on MATLAB Drive™ and are available wherever you go. MATLAB Drive Connector synchronizes your files between your computers and MATLAB Online, providing offline access and eliminating the need to manually upload or download files. You can also run your files from the convenience of your smartphone or tablet by connecting to MathWorks® Cloud through the MATLAB Mobile™ app.

Yes, MATLAB provides tools and frameworks for deep learning, including the Deep Learning Toolbox. You can use MATLAB for tasks like building and training neural networks, image classification, and natural language processing.

MATLAB and Python are both popular choices for AI development. MATLAB is known for its ease of use in mathematical computations and its extensive toolbox for AI and machine learning. Python, on the other hand, has a vast ecosystem of libraries like TensorFlow and PyTorch. The choice depends on your preferences and project requirements.

You can find support, discussion forums, and a community of MATLAB users on the MATLAB website, Matlansolutions forums, and other AI-related online communities. Remember that MATLAB's capabilities in AI and machine learning continue to evolve, so staying updated with the latest features and resources is essential for effective AI development using MATLAB.

Without any hesitation the answer to this question is NO. The service we offer is 100% legal, legitimate and won't make you a cheater. Read and discover exactly what an essay writing service is and how when used correctly, is a valuable teaching aid and no more akin to cheating than a tutor's 'model essay' or the many published essay guides available from your local book shop. You should use the work as a reference and should not hand over the exact copy of it.

Matlabsolutions.com provides guaranteed satisfaction with a commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been empanelled after extensive research and quality check.

Matlabsolutions.com provides undivided attention to each Matlab assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work done at the best price in industry.