I'm training a MLP classifier with a softmax output that outputs 4 classes.
For my particular application I'd like the classifier to output a fifth 'other' class when the input don't belong to any of the 4 classes.
I've seen several discussions on the topic here and elsewhere, but couldn't get to a final solution.
I can think of two main approaches
Add examples outside of the four classes to the training data. I can get realistic examples of these (which I believe is better than just feeding random noise, which I will never see in a real situation)
Perform per-class thresholding on the softmax output. If none of the classes reaches threshold them output 'other', otherwise output the class with highest score.
Approach 1 is easier, but to work well I would need to cover the vast majority of 'other'cases my classifier might encounter, and I can't be sure of that. Also, the 'other' class will be much more heterogeneous and probably much more difficult to learn.
I've seen examples of approach 2 for binary classification, where the 'best' threshold is chosen by building an ROC curve or by looking at some metric of choice. My understanding is that to extend this to multiple classes I should transform my problem into several binary classifications where I look at class 1 Vs the rest, then class 2 vs the rest and so on. I can then find a threshold for each class.
So my questions:
Are these viable approaches, and which is better? Or, is there any better solution?
Do you have recommendations for choosing a metric to establish the best threshold?
If someone could provide links to relevant literature that would be fantastic