I want to train a deep neural network to classify images. In every implementation I have seen, multiclass training uses only the positive examples for each class.

Is there any way to utilize negative samples for the N image classes, without resorting to training N binary - classification networks?

By negative samples, I mean that all the images annotated with label x are negative samples for the class y (in the case when the class x is not a subset of y, and vice versa). We can use these negatives in binary classification, so is there a way to be used in a multiclass NN?

  • $\begingroup$ What did you mean when say "Negative samples"? Can you give some example? $\endgroup$
    – itdxer
    Feb 17, 2015 at 13:33
  • $\begingroup$ Appended question with the response. $\endgroup$
    – npit
    Feb 17, 2015 at 14:52
  • 2
    $\begingroup$ Well, if your negative example belongs to some class X, then softmax (usual multiclass loss) automatically understands that it's a negative examples for every other class. $\endgroup$ Feb 17, 2015 at 15:28

1 Answer 1


If each sample can only belong to one class, then the usual cross-entropy loss understands that a positive example for class $2$ is a negative example of classes $1, 3, ... k$. That is, for any class $k$, all samples in each other class are "negatives" with respect to $k$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.