Lesson 2 - Official Topic

The tyre image classification results are depicted below in the image and it is poor as compared to the bears classification.

image

I execute the plot top losses command and it seems to be an issue with the images that were retrieved from bing i.e. labeling issues. It seems the bus folder has images of car tyre or cycle has images of car. The model is predicting correctly whereas the labeling is the root cause of the lower accuracy.

interp.plot_top_losses(20, nrows = 4)

Is my understand right? How can the images be pulled such that it is easier to verify (manually verifying 150 images is a tall ask) and also that it is a JPG?

Regards
Ganesh Bhat

Hi sinsji hope you are having fantastic day.
I found your post extremely informative and objective.

Cheers mrfabulous1 :smiley: :smiley:

Hi ganesh.bhat hope you are having a marvelous day.

I think you will find, that when your classes contain images that look very similar, you will experience these issues, added to the problem of mislabeled images, makes the situation more problematic.

The problem you describe, is why there are not more pretrained models, as models like Resnet34 and others have been checked and curated by hand.

I trained a wrist watch classifier and experienced the same issues as you have here.

I have found in my experience if a human would have difficulty classifying some images so can an AI.

For example If a human where to look at images of a car tyre and a bus tyre and the images were the same size it would be difficult to identify which is which especially if you couldn’t see the writing on the side of the tyre’s.

I didn’t improve the performance of the wrist watch classifier because I ran out of time, I felt I would need to add text classification to read the name on the wrist watch face.
Also every time I added more than 3 classes the accuracy went down.
Almost every watch maker, makes a model that looks like a famous watch such as a specific Cartier or a Rolex.
Lastly as I said earlier when I compared some watches of different brands they had the same watch face, hands, numerals, strap, body and buttons and knobs. therefore I could see no difference in the features a model could detect.

Also in the teddy bear classifier, a teddy bear looks very different to a black or brown bear and there are enough differences between the brown bear and black to classify.

In fastai V1 Jeremy talks about the difficulties of classifying a certain breed of cat as online you can find experts arguing the differences between these cats as they look so similar.

One other thing. I have seen a classifier that can recognize which city a piece of land belongs to from a satellite image. Though this is difficult for a human to tell which bit of land is from which city in the world. There are hundreds of differences that a model can detect.

Hope this helps
Cheers mrfabulous1 :smiley: :smiley:

3 Likes

Thanks!!

Don’t know if you solved this or not. But you need to use Git Large File Storage (Git LFS). The easiest way is to start with a clean repo, tell git-lfs to track pkl files. git lfs track "*.pkl" Then add the .pkl file to the repo.

3 Likes

I saw this error while running ImageClassifierCleaner. Filed it here:
https://github.com/fastai/fastbook/issues/73
Anyone else seen this? @sgugger

Hi,
I had the same problem :frowning_face: on Paperspace. I had to do Kernel-> Restart & Clear Output
and then run again.

1 Like

btw i used shutil.move(str(cleaner.fns[idx]), str(path/cat)) and it worked

2 Likes

This is fixed now.

1 Like

Thanks @mrfabulous1 for the detailed post and explaining the issues with the models.

Would also request help on the below error:

/usr/local/lib/python3.6/dist-packages/PIL/Image.py:932: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
"Palette images with Transparency expressed in bytes should be "

Good morning!

I haven’t experienced this particular error, but it looks like PIL doesn’t recognise the Transparency in the image.

Maybe converting it something like below could help.

import Image
im = Image.open("image1.png")
im.show()
print im.mode
im.convert("RGBA").save("image2.png")

Also check this post https://stackoverflow.com/questions/1233772/pil-does-not-save-transparency

Hope this helps

Cheers mrfabulous1 :smiley: :smiley:

1 Like

On Colab, the following code block

!pip install voila
!jupyter serverextension enable voila --sys-prefix

from 02_production.ipynb throws this error:

Enabling: voila Writing config: /usr/etc/jupyter Validating... Error loading server extension voila X is voila importable?

Has anyone seen this, and/or knows how to fix it?

2 Likes

I adapted the bears classifier to build a bird classifier that distinguished between cardinals, crows, falcons, orioles and ravens. As I expected, the classifier did very well except that it was not good a differentiating between crows and ravens. I doubt that I would be able to tell the difference, either. This confusion matrix was the best result before over-fitting kicked in:
image

On the plus side, it was not fooled by a red-headed falcon:

Select your bird!

Upload (1)Classify

Prediction: falcon; Probability: 0.9937

2 Likes

is there an easy way to work just on a subset of the data? I am using get_items=get_files and want to use just one or two batches of data to debug the transforms etc …

With all the data show_batch takes some minutes and I like to speed that up.

There’s a RandomSubsetSplitter which takes a train pct and valid pct.

https://dev.fast.ai/data.transforms#RandomSubsetSplitter

2 Likes

I am unable to run the Lesson 2 notebook on papersource. Any suggestions?

Were you able to install bing search and get the key?

Problem deploying bear_classifier notebook on binder.

On clicking the binder launch link, instead of getting the bear classifier app with the widgets, I got the docker image of my notebook. Executing the code block threw a ModuleNotFoundError: No module named 'fastai2'

Anyone have a clue what went wrong, how to fix?

1 Like

Thanks @DanielLam

Make sure to have this requirement file inside your repo.

3 Likes