There are two fundamental problems here:
- Logistic Regression is just not powerful enough to do a very good job on this type of image recognition problem.
- The training dataset is way too small to give a good result that generalizes to arbitrary input images. We’ll use the same dataset in Week 4 with a much more powerful 4 layer Neural Network and it will do much better on the training and test data, but still won’t generalize all that well.
For a real system on this type of recognition task, you would typically have O(10^5) or even O(10^6) training sample images to get a system that works well. It’s actually pretty amazing that it works as well as it does with this small a training set. I think the training and test data is pretty carefully curated to give this good a result.
The other perhaps more minor point to make is that you are showing the full resolution image, but that is not what the algorithm is actually “seeing”. Notice that the algorithm only handles 64 x 64 images. To be fair, you should show us the image after the “downsampling” logic that they provide you in the “Test with Your Own Image” cell. But I grant you that it really doesn’t look anything like a cat.