Ask Your Question
0

which machine learning should I use? [closed]

asked 2020-01-13 03:08:38 -0500

HelloWorld gravatar image

updated 2020-01-13 03:09:10 -0500

I have 200 images and 200 classes and I try to use opencv cv :: ml :: Boost cv :: ml :: KNearest . But the results are not accurate.

so ,which machine learning should I use?

Create vocabulary:

cv::BOWKMeansTrainer bowtrainer(10);
bowtrainer.add(trainingDescriptors);
vocabulary = bowtrainer.cluster();

Recoginze:

cv::BOWImgDescriptorExtractor bowide(extractor, matcher);
bowide.setVocabulary(vocabulary);
std::vector<cv::KeyPoint> keypoints;
detector->detect(trainingMat, keypoints);
if (keypoints.empty()) {
    return -1;
}
cv::Mat imgDescriptor;
bowide.compute(trainingMat, keypoints, imgDescriptor);

if (imgDescriptor.empty()) {
    return -1;
}
Mat testResponse;
kclassifier->predict(imgDescriptor, testResponse, 0);

Some Images:

train Image : https://drive.google.com/file/d/1n2eh...

test Image : https://drive.google.com/file/d/1Txxo...

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by HelloWorld
close date 2020-01-17 01:35:29.186333

Comments

can you explain the context, what are you trying to achieve ? using what kind of data ? why the BOW approach ?

I have 200 images and 200 classes

boost can only handle 2 classes (binary classifier)

berak gravatar imageberak ( 2020-01-13 03:21:21 -0500 )edit

A picture is a class, and I want to combine it with the recognition of AR. thank you!

HelloWorld gravatar imageHelloWorld ( 2020-01-13 03:36:16 -0500 )edit

A picture is a class,

you will need much more than a single sample per class to train any ml algorithm successfully.

cv::BOWKMeansTrainer bowtrainer(10);

10 clusters / features won't be enough to seperate 200 classes (try like 1000)

berak gravatar imageberak ( 2020-01-13 03:45:49 -0500 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2020-01-13 23:51:57 -0500

Which computer studying algorithm need to I use? 1 — Linear Regression. ... 2 — Logistic Regression. ... 3 — Linear Discriminant Analysis. ... 4 — Classification and Regression Trees. ... 5 — Naive Bayes. ... 6 — K-Nearest Neighbors. ... 7 — Learning Vector Quantization. ... 8 — Support Vector Machines.

edit flag offensive delete link more

Comments

It depends on your problem different algorithms produce different results. If you understand linear regression and classification - you are fine to go usually. .

holger gravatar imageholger ( 2020-01-14 03:33:28 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-01-13 03:08:38 -0500

Seen: 54 times

Last updated: Jan 13