Share your work here ✅

Excellent!

mrfabulous1 :smiley: :smiley:

I wanted to share my work on lesson 2. I built a squash classifier (for 5 varieties). Here it is:

Lesson 2 HW on GitHub

I can’t figure out how to get it into production, but it took a lot of work to get my model to have a reasonable degree of accuracy, so I’m pretty happy.

Lessons Learned:

  1. Image scraping pumpkins from Google Images is really hard. No matter how much you use -keyword to get rid of fluff, there just aren’t many great photos of pumpkins. Lot’s of jack-o-lantern carving ideas though

  2. You can’t necessarily trust that your top losses portray all the noise in your data. After running ImageCleaner and still getting really bad results, I finally dove into my image files head first. I had to clean out about 70 percent of pumpkin photos and about 30-50 percent of the other squash types.

  3. I learned how to create an ImageDataBunch from csv, specifically using the ‘cleaned.csv’ file.

Outstanding Questions:

  1. How many images per class is enough for your model to be robust when faced with new images? I read 1,000 per class in several places online. In the video Jeremy says something to the effect of “less than you would think”. After cleaning my dataset, I had anywhere between 25 and 50 good images per class.

  2. After cleaning the data, why keep the parameters from the run on uncleaned data? This is what ended up working for me:

  • Create combined DataBunch, no splits
  • Train a model and get its top losses
  • Use top losses to clean up noisy photos
  • use ‘cleaned.csv’ to create a brand new DataBunch with appropriate train/valid/test split
  • Start new model with new, clean DataBunch that it has never seen before.

Am I missing something there?

  1. After enough epochs, I noticed that sometimes training and validation loss continue to drop while error_rate begins to creep up. From my understanding of loss, I thought it was directly tied to error rate. For example in linear regression, I thought loss and mean squared error are actually the same thing, and gradient descent is used to minimize loss, and thereby also minimizing error. So, it appears that I have made a conceptual error. What am I missing?

Thanks!

1 Like

Can you share the Twitter link, please? I would like to post Twitter likes)

@subhadityamukherjee amazing! Can you please share a link to the dataset? I would like to work on it too, for another project.

@PalaashAgrawal Thank you! Here is the dataset https://data.vision.ee.ethz.ch/cvl/ntire19//dense-haze/.
Best of luck for your project :slight_smile:

2 Likes

I created a thin wrapper of the source code of First Order Motion Model for Image Animation by Aliaksandr Siarohin et al., to write a console script using nbdev. Now it is really easy to play with your own DeepFakes. I compiled a brief tutorial on Medium.

3 Likes

Awesome job!!

I wanted to share my small success. This is something I started working on from lesson 1, but finally got to a level I felt was worthy of sharing after lesson 3.

https://which-captain-of-the-enterprise.onrender.com/

captains_lr_image

How I did this:

I followed the “Progressive Resizing” method that Jeremey demonstrated in lesson 3. I started with resnet34, on size 64 images. Trained, unfroze, trained. Did the same on size 128 images, and finally size 256 images. I got an error rate of about 8%. Then I repeated the same process with a resnet50, which got the results shared above.

Things I learned/observed:

  • I am getting a better sense how to look at the learning rate graphs.
  • The image set needs to be cleaned a lot. I pulled so many junk images.

Questions I still have:

  • How the heck can you make .from_csv() work? I ended up importing my cleaned csv into pandas and running ImageDataBunch from there.
  • I’m still confused on how many epochs to run.

I have very little formal education in programming. It’s incredible that the tools have reached a level where someone with my background can actually run an image classifier and reach these kinds of results.

1 Like

This is an awesome course, and I’m excited to be learning about AI. I’ve started with the first couple of video lessons and notebooks.

I’m using fastai on my own gaming PC, in Debian with an NVIDIA 2060 Super. It wasn’t too difficult to set up, and it’s working well.

I put together a download script to get image sets from Google image search, and a simple image classifier script, to sort images into folders using an exported model, when the probability exceeds a certain confidence level.

I downloaded 25GB of different animal images, 263 different types of animal. I noticed that “chicken” gives mostly cooked meals, “crane” gives large machinery, and “cricket” gives that boring ball game! So I fetched those sets again with more specific queries. I trained a resnet34 model on these images, it’s working pretty well, but not great… perhaps because many of the images are misclassified or otherwise dodgy.

There are too many images for me to clean up by hand in a reasonable amount of time. So now I’m working on a model or series of models to automatically clean up the image sets, and remove “bad” images.

For starters, I want to get rid of any image containing text, so I’ve made a model to classify supposed animal images as “with text” or “without text”. It’s working pretty well, and it seems to filter out certain other “garbage images” too, which is a bonus.

After wrapping up Lesson 1, I decided to classify DBZ characters, shout-out to any DBZ fans out there. Given that I don’t know a ton about DL (why I am taking the course haha) I was pretty happy that with lesson 1 under my belt I was able to get 82% accuracy. Some of the misses were images where the heads were cut-off and the image quality wasn’t the greatest (had about 30-40 on avg per class)

I did two types of classification

Version 1
Goku
Vegeta
Trunks
Krillin
Tien
Super Saiyan Goku
Super Saiyan Vegeta

This ended up being easier and higher accuracy than the second cut where I just did Goku and Vegeta (and included their transformations in the class)

Version 2
Goku
Vegeta
Trunks
Krillin
Tien

I saw more goku and vegeta misses in this second step because their character now had a wider variety of looks.

One last thing, I am sure I could have boosted the score if I did more characters. Piccolo a green character would have boosted accuracy, I chose characters that look fairly alike on purpose to see how the algo would do

but overall fun exercise!

Here are sample sample cases from version 1

Update: Went back to this after lesson 2 and did two things:

  1. Got rid of bad photos poor quality, didn’t quite fit, some photos has Goku and Vegeta threw those out.
  2. Got rid of duplicates.

Accuracy went from 80% to 93%. I followed notes from lecture where I fit the model and then looked at learning rates and then unfroze and it’s cool to see that cleaning up the training data had this effect.

Here were top 2 misses. I thought about getting rid of these in the data quality clean up since image 1 the head is missing (decided against it since you can still tell it’s Goku) and image 2 since quality is bad (but again you can tell it’s Super saiyan Goku) so I’m okay with these being the top 2 missed given that they are kind of ambigous.

I started with around 330 images, then cleaned up bad images to around 290 then eliminating dupes got me down to 275

3 Likes

Hello everyone,
I have started a repository where I try to implement as many papers as I can (fastai+pytorch) along with identifying tricks from the papers and noting them down.
It is a work in progress but I thought I would share :slight_smile: Please do have a look.

I think it would be a great start for those slightly advanced among you.

On a side note. I have implemented some papers that arent in the fastai library as of yet. (MobileNet, STN and others on the way)
Would they be of any help? @jeremy @sgugger

7 Likes

Let me be honest to you. I feel your project is wonderful. Keep it up. I suggest to put your dataset on kaggle to share it to everyone.

2 Likes

Hello everyone,
For those who are into Kaggle COVID-19 Global Forecasting Competition
or simply want to play around with prediction of confirmed coronavirus cases in the future, I wanted to share my baseline fast.ai V1 tabular model: Kaggle Notebook here which I created based on this course. As for tabular data we cannot expect fireworks, but the score one can get with a pretty vanilla model isn’t that bad. I tried to add many countrywise metadata features such as population, number of tests conducted, GDP but they don’t help much with getting a better score, if any.

These are sample predictions of a vanilla model (without metadata features) for a short time window between 26.03 and 04.04:


This is the time where model performs pretty well (if you notice any leakage, it wasn’t intended, please let me know :grinning:), but obviously it falls short for long-term predictions, like forecasting 300k cases (who knows?) for Poland on 07.05 (the last date to predict in the test set) which has about 4k now…

As I mentioned before, adding basically any metadata (mostly continuous variables) apparently doesn’t help the model (commit 3 vs commit 4 on Kaggle). I couldn’t manage to find any categorical variables which could be useful (maybe lockdown dates as categoricals?), maybe they would do a better job with embeddings. Why these seemingly important numerical features don’t help, this is another issue I don’t know how to explain.

Maybe we can’t go any further with a simple MLP architecture and one needs a RNN to make more sensible predictions (if you’ve heard about some RNN modules for fast.ai tabular data, let me know) or TabNet, which exists for fast.ai V2 but I have no clue about its performance on such time series. If you have any hints about what kind of neural network architecture should be used for this type of problem, I would appreciate any suggestions.

1 Like

I’m looking to build a Deep-voice-converter using the fast.ai library but I’m not sure where to start. any suggestions?

I finished lesson1 few days ago and I have been struggling with formats, functions and the untar_data functions. I have done a few things differently, and used a CIFAR_10 dataset which I downloaded in my colab machine and untared it using tarfile functions available in python. I finally got a few things straight and here is the project Ive done for week one.

Nice work. In relation to your open questions:

You can get good results with limited images, but it will depend on how similar, different your objects are. In deep learning the more images the better (accuracy increases with more ‘interesting/good/different’ iamges). It’s important to have a representative dataset (training and validation), that represents the input data your model will see in production…

So you can get good results with 20-50 images, and start adding more of the images your model predicts when deployed to retrain your model…

Did you also check duplicates? They might end up being in both your training and validation set, skewing your results…

But indeed, no real need to keep those weights. Another cool trick to improve your model:

A first hunch, percentage of total errors goes up, but for the ones it predicts correctly, the loss is very low…

If you need help deploying your model, you might want to check out our Quick Guide for SeeMe.ai: https://github.com/zerotosingularity/seeme-quick-guides/blob/master/seeme-quick-guide-fastai-v1.ipynb

1 Like

Hi Folk, Just completed Lesson 3 homework with a genre classification using IMDB posters.
The code works like a charm.

Here is a link to my notebook.

10 Likes

That’s really innovative. Great work!

Hi Folks,

I’ve just finished the first lesson and watching the second lesson video and was trying to experiment with different data like google images etc. etc. One dataset I came across was of x-ray images of covid-19 patients: https://github.com/ieee8023/covid-chestxray-dataset

I tried to train a resnet50 model on this dataset. I’ve created a fastpages post on this here: https://impactech.github.io/fastpages/deeplearning/fastai/jupyter/2020/04/08/covid_predictor.html

Here is the notebook: https://colab.research.google.com/drive/1GAn7BOlrcaMnZeDIb3Z6AV-j5giFGCHn

I would really appreciate ideas and inputs on how can I improve the accuracy and PR of this model. What are the things I can try out?
How can I split the initial dataset into train, valid and test sets. I guess by default Imagedatabunch splits the data into train and valid only
How can I then run my trained model on the test set and print out the metrics like PR and accuracy
What effect does batch size have on training, overfitting etc.

1 Like

@Nitron Cool work! I’m wondering how your custom loss function differs from the default loss implemented in fastai when using ResNet regression and PointsItemList dataloader?