reading images from file
3 views (last 30 days)
Show older comments
I'm new in using MATLAB and I want to use it to classify galaxies, i need to read images from file, extract features using PCA then feed the features to SVM to be classified, as a begining I have three types of images to be classified what should i do, shall i create three files for each type or what?
0 Comments
Accepted Answer
Walter Roberson
on 9 Nov 2013
Use a portion of your files as training data, and another portion as validation data. You might need to play with the parameters or algorithms to get good fitting results. After you get good results, run predictions on the remaining portion of the images.
Ideally you would have at least 20 images of each type in your training data, but in any event you should ensure that you have at least 5 images of each type in the training data.
You do not need three files for each type.
What you might want to do is create a file that lists the images you want to use for your training run, and lists the images you want to use for your validation run, and then read from that file to get the names of the images to load and work with.
3 Comments
Walter Roberson
on 16 Nov 2013
You should be using the same features for all three kinds of images. If a particular feature cannot be found at all in a particular kind of image, you can assign zeroes for the feature in that kind of image.
When you are analyzing an image to determine what class it is, the program will not know ahead of time that a particular feature is not present, so it will need to do all the kinds of feature analysis and report on them all (possibly reporting zeros for items it can find no trace of.) Let the NN handle deciding which class of image any particular input image is "most like". For example if one class of image has the Moon in the picture and the others do not, then let the NN figure out what to do if you feed it an image that has both the cat and the Moon.
More Answers (1)
Image Analyst
on 11 Nov 2013
Why SVM, since SVM is primarily a two class classifier and you need complicated tricks like https://en.wikipedia.org/wiki/Support_vector_machine#Multiclass_SVM? Why not use something like k-means or fuzzy c-means or something, especially since you know that you will have 3 classes (types of galaxies)?
0 Comments
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!