Search code examples
tensorflowdeep-learningkerastensorboardubuntu-17.04

Image classification with Keras on Tensorflow: how to find which images are misclassified during training?


I use Keras 2.0 (TensorFlow backend) on Ubuntu 17.04 to do binary image classification. Everything works great except I'd like to see which images are misclassified. How do I do that?

Also, unsure if it'd answer my problem, but in TensorBoard I can't get the image tab to work, so don't know if that'd help.

I've done a lot of googling, of course, but I just can't find an answer.


Solution

  • Simply predict the classifications and compare with your true values...

    predicted = model.predict(trainingImages)    
    

    Subtracting and removing the sign should result in near zero results for the right ones and high results for the wrong ones:

    result = numpy.absolute(trainingClasses-predicted)