Can please someone tell me how to use multiclass svm image datatset in matlab?

Can please someone tell me how to use multiclass svm image datatset in matlab? how to get started ,the flow and outline of the code as i am a beginner.thank you

 Accepted Answer

13 Comments

[1 10; 20 20; 3 30 ...]
would create the 2D array
1 10
2 20
3 30
...
What classes of items did you hope to be able to identify?
Minimum three and may be more than this but how would I convert my image dataset to this notation:
TrainingSet=[ 1 10;2 20;3 30;4 40;5 50;6 66;3 30;4.1 42];
TestSet=[3 34; 1 14; 2.2 25; 6.2 63];
GroupTrain=[1;1;2;2;3;3;2;2];
"Three" would be how many classes. What are the characteristics of the classes? Brightness of pixels? Squareness of blobs that appear in the image?
svm works with vectors of attributes, one vector per object, except that the vectors get packed together into an array.
See for example the famous Fisher Iris dataset, which measured several different characteristics for each flower and recorded the characteristics in a table. One attribute might represent petal length; one attribute might represent eccentricity of the leaves; one attribute might represent number of petals. The attributes do not, in other words, need to be all of the same "kind" of thing, and do not need to have the same units, and some attributes can be continuous while other attributes are discrete. The order the attributes are stored in the table is not important. Just a sequence of measurements of something that characterizes some aspect of what is to be classified.
Thank you so much but since I am a beginner I really am not getting n unable to follow actually. I am lost how to answer your questions i.e.What are the characteristics of the classes? Brightness of pixels? Squareness of blobs that appear in the image? Can you please do something about it?
also not getting how to pack into array and pack what?
Training Matrix of training data, where each row corresponds to an observation or replicate, and each column corresponds to a feature or variable.
So store each vector of attributes as a row in a matrix.
With regards to the classes: I am getting the distinct impression that what you want is clustering rather than classifying. Do you want to essentially just enter the image and tell it a number such as "3" and have it figure out from the image how to divide the image into three visual groups? If so that is clustering.
For classifying (which is what SVM does) you need to be able to give it some information about parts of the image and say specifically "This point belongs in group 1, this point belongs in group 2, this point here belongs in group 1 as well", and so on. Then after you have given it a representative sample of points and associated groups, svm figures out where the dividing line goes. Afterward that has been done, you can input new points that you do not know the group of and svm will tell you which group they belong to.
Thank you.No its classification.This is what I want t know that how would I specify things in image dataset which later on is used as training set values ,test set and group set etc.
Please post an example image, and please indicate what you want in the image to be considered to be part of each of the classes.
For example , an image of a patient with skin disease now I want to classify the diseased skin ,non-diseased and background.
Can an individual pixel be classified as being diseased or non-diseased or background just by looking at the RGB (or grayscale) level of that one pixel? Or does it need to be considered along with the pixels that surround it? If you are looking at a group of pixels instead of at individual pixels, then what is it about the group that you can examine to determine whether it is diseased or not? Are you looking for patterns of skin pixels, such as in
If you are looking for patterns of skin pixels, then you need to do "texture analysis". The output of your texture analysis would be "feature vectors", and it is "feature vectors" that would become the attributes to submit to svm.
To construct the target class information for an image, you need someone knowledgeable about skin diseases to look at your available images and to tell you for each one whether there is skin disease present or not. Mark all of the images with no skin at all (showing only background) as being group 1; mark all of the images that show skin but have no skin disease as being group 2; mark all of the images that show skin disease as being group 3.
Now for training purposes, take a random subset of the images whose outcome is known, and train on those images and the known class number. Take a different random subset of the images whose outcome is known, and run the classification on the attributes without telling svm which group each one belongs to. Take the group that SVM predicts for each of the test images and compare it to the known classification of those images, calculating the correct classifications, the false positives, and false negatives, to give you an indication of how well svm did.
If there is some parameter that is adjustable in your feature determination, then you can adjust the parameter to a new value, and go through training and testing again, calculate the score, and determine which of the parameter values was better. You can do this over and over to find the optimal parameter value for classification purposes.
Yes I am doing texture analysis using svm. I guess segmentation would be needed to separate background,diseased and no disease?I need more guidance regarding coding specialy how to construct matrix of these image regions?
No, the way you described it before, you would have an image that had no skin in it anywhere at all and so should be considered background, or you have an image that has skin disease in it somewhere and so should be classed as diseased, or the image has skin in it somewhere but none of the skin is diseased. You do not separate background, disease and no disease by segmentation, as that would imply that you are looking to break the image up into pieces and classify each of the pieces. Any one feature extraction or any one texture analysis is feed the entire image to work with. The internals of the analysis might choose to ignore most of the image, but that should be transparent to the rest of your processing. All the rest of your program needs to know is that it applied algorithm #17 to the entire image and got back this list of 38 double precision numbers in response.

Sign in to comment.

More Answers (1)

Thank you. Can you please tell me what does the following code shows like what is meant by [1 10;.....] etc
TrainingSet=[ 1 10;2 20;3 30;4 40;5 50;6 66;3 30;4.1 42];
TestSet=[3 34; 1 14; 2.2 25; 6.2 63];
GroupTrain=[1;1;2;2;3;3;2;2];
And how can multiclass svm be applied on image dataset?

Categories

Find more on Agriculture 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!