My CNN model outputs prediction as [1.0,0.8 e-35,0.0] even when i give images containing both class the prediction is this confident, where 1 class gets 1.0 as probability. But in case of multiple objects in image, I want the model to give probability for each class example[0.4,0.7,0.0]. How can I tune my model to get the desired output and does this prediction flaw created because of over fitting ? I am using Softmax for final prediction. I am using vgg16 transfer learning to classify images out of three classes. I acquired images from google searches.

  • $\begingroup$ Could you at least post some details about what your CNN model is and what it was trained on? $\endgroup$ – Alex R. Mar 21 '18 at 19:26
  • $\begingroup$ have updated the question $\endgroup$ – Unbanned Mar 21 '18 at 19:32

The softmax activation is designed to output a vector which can be interpreted as a categorical distribution -- it must always sum to 1, so it's not appropriate for the case where you have multiple objects.

You should apply sigmoid activation instead, so that each class can vary independently from 0 to 1.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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