Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you give me a hint? #1

Closed
newforrestgump001 opened this issue Oct 12, 2021 · 4 comments
Closed

Could you give me a hint? #1

newforrestgump001 opened this issue Oct 12, 2021 · 4 comments

Comments

@newforrestgump001
Copy link

I have samples composed of A,B,C, which are 3 classes. And train classifier using the 3 classes. If I give the classifier the D sample, As far as I know, it will one of the labels, A,B or C. But for D sample, A B or C are all wrong labels. How can I know it is not A,B or C (it is abnormal or novelty.) Thanks a lot!

@arrufat
Copy link
Member

arrufat commented Oct 12, 2021

I am assuming you are training with loss_multiclass_log, right? That loss function uses a softmax, which means, the sum of the three possible outputs has to add to 1 always. So, it can output something like 0.33 for each class when it's not sure, however, if it's slightly more sure that it's one class, it might get overconfident on that class.

For that case, I like to train classifiers with the loss_multibinary_log. Instead of a softmax, it uses a sigmoid for each output independently, so any combination can be possible, even outputting everything to 0 and everything to 1 (that's why it's sometimes called multi label).

You can check an example on how to use it in the tests.

@newforrestgump001
Copy link
Author

It is very helpful, and thanks a lot! BTW, Are you familiar with Anomaly Detection for defect inspection which is unpredictable, it may be everything you can imagine.

@arrufat
Copy link
Member

arrufat commented Oct 13, 2021

I am familiar with it, but just theoretically, I never had the chance to play with it myself. I know dlib has tools for this: http://dlib.net/ml.html#kcentroid

@newforrestgump001
Copy link
Author

@arrufat You are very nice and professional. Thank you guy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants