Chapter 2 - HealthySnacks.mlmodel seems to have hot dog classified as "healthy"

Hi. In chapter 2, the binary classifier version of the HealthySnacks.mlmodel seems to have hot dog classified as “healthy”. The multi-class classifier correctly identifies the same photos with a high confidence as a “hot dog”. According to the image in the beginning of the chapter, “hot dog” should be classified as “unhealthy”.

Thanks!

Which specific image of a hot dog did you try this on? Note that the classifier that we use (and train) in the book is only 85% correct on the test set of images, which means that we can expect it to be correct only 85% of the time, or 15 out of 100 times it will be wrong. (I don’t recall the exact number but I think it was close to 85%.)

Hi Matthijs! Here are the images I used to test. There were originally only two, so I see how both of them could have been incorrectly identified as “healthy”. However, when I used the same images with the multi-class classifier, they both had a very high confidence as a “hot dog”. So my sample set was too small. I added the third image, and it properly identified as “unhealthy” with a high confidence score. I learned a lot from my assumptions and from how the training set affects outcomes. Thanks!

HotDog1 HotDog2 HotDog3

I should point out that the healthy/unhealthy classifier and the multi-class classifier are really two completely different models. They have the same architecture (except for the final layer) but they were trained totally separate from each other.

So you can’t really draw conclusions of how well the healthy/unhealthy classifier works by looking at the predictions from the multi-class classifier.