I am trying to train a classifier on a set of classes.
I then want to use the classifier to generate a loss such that given a sample, the loss will only be high if the classifier returns a specific unwanted class. It is preferable that the classifier predicts another class with high “probability”/“confidence”, but it does not matter what the class is, as long as it is not the specified unwanted class.
In my initial attempt I used CELoss to train the classifier and attempted to use negative of that loss -CELoss to achieve my goal. But this seems to give the lowest possible loss when all classification scores are at 0.5.
Any ideas on how this can be achieved?