Share your V2 projects here

Nice work! image

2 Likes

@lukew Much appreciated! I should give credit to the awesome dataset I found on Kaggle. I had to use resnet101 to get much above 92%… I accidently deleted the notebook, but fastai made this so much more compact than the pure pytorch one I had built earlier. My kids have been testing pictures of politicians, pokemon, and themselves. It seems to guess starmie or machamp for most people.

1 Like

Did you try with the other resnet depths, and did they perform better or worse?

What happens when there is no result? Have you considered having a null class?! image

Also – how would you get it to work on multiple positive predictions? image

Hi all,
Inspired by this, I made a sample notebook that shows you how to train raw Pytorch models with pytorch datasets and dataloaders on multi core TPUs on Colab using fastai and the fastai_xla_extensions packages to provide the training loop.

Check out the notebook here: https://colab.research.google.com/github/butchland/fastai_xla_extensions/blob/master/samples/minimal_fastai_pytorch_tpu_sample.ipynb
Best regards,
Butch

6 Likes

Yes, Tried 18, 34 and 50 and wasn’t happy with the accuracy of them. 101 got me above 91%. I’ve considered the null category – especially when I passed in a picture of a certain senate minority leader and it delivered the result of a Chancey. Just need some time. I’m doing this mostly at night and my youngest hasn’t always been cooperative!

I’d like to also test thresholds for determination and do an AUC for that.

1 Like

I have worked on implementing FixMatch for semi-supervised learning as a callback.

FixMatch Callback

A complete example can be found here

Next step is to see how it performs on Imagewang. Hope it can make it to the leaderboard :crossed_fingers:

Currently, rand_augment_transform from timm is being used.

Any suggestions on how to integrate batch augmentations on the gpu?

Thanks,

7 Likes

I went down the rabbit hole of implementing landmark/keypoint regression using heatmaps with fastai v2, and ended up writing it up in a notebook-powered blog post. It covers the Heatmap Regression via Randomized Rounding paper (or at least, what I think that paper is doing - they’ve only posted inference code so the rest is my interpretation), with a HRNet backbone. Hope it’s useful to someone, suggestions / comments always welcome!

Link in case that first one wasn’t obvious: https://elte.me/2021-03-10-keypoint-regression-fastai

9 Likes

This is absolutely amazing!!! I tried doing this moons ago, and I’m so glad someone got it implemented. This is seriously an amazing implementation. Very well done!

4 Likes

Thanks, I’m happy to hear that :slight_smile:.

wow! cool project

1 Like

Very cool project.

I was wondering if you could post the distribution of your training data in the sense of the species. The reason why I’m curious is that I’m getting a lot of hits for Jacks that are actually yellowfin tuna and I’m wondering if things have been skewed. We worked on a project with pelagic fish and the problem was that more than 70% of our data was of albacore tuna so it seemed like when the model was to guess, it guessed albacore as that was the most probable to get correct. But there were yellowfin and bigeye tunas, Ono (or Spanish mackerel), sharks, sickle pomfret, Opah or moonfish, and a few others.

We had a difficult time getting around this.

I put a bunch of pictures that I have from the fishing we do here on Oahu with images of mostly yellowfin tuna (ahi) and mackerel (ono). As mentioned, lots of the ahi was guessed as Jacks.

Also, where did you get your images from? In the past when we were pulling images from google image searches such as ‘yellowfin’ we found a lot were mislabeled.

Thanks for sharing your model.

I`m glad to read that you liked the project, thanks for your comments!.

The truth is that the dataset is unbalanced and probably mislabeled too, it has many categories and while I’ve been careful to be consistent in the labeling while downloading the images, I’ve not been completely rigorous. This has been a project to do in my spare time, and I did it because I am in love with the sea and just for fun and learn.

I’ve obtained the images in various ways and from various sources (I do not share them because of copyright issues). I’ve tried at various times automatic downloads by scraping from google mainly, but those codes no longer work for me. First of all, I took fish classification list from the internet, I think from wikipedia, I don’t remember right now where I took it from, then I made a code to do web scraping from that list. The vast majority of the data came from these downloads. I have also searched in the browser cache, for example I search for a specific tag, load the images in the browser and then copy them from the cache to another folder and then the browser doesn’t block the IP address :).

Now I prefer to download them manually, even if it seems silly and counterintuitive, but I have more control of what I do. Because, the scraped images contain a lot of garbage, for example, the search engines bring a lot of drawings, cooked fish, mislabeled fish, or extreme things like what happened to me downloading triggerfish images, many of the downloaded images were of gun parts, and the cleaning process has been quite tedious and unfinished.

There is one important thing, and that is that I am not a marine biologist, so I could have made many unintentional mistakes in the way I have grouped the species, this could also influence, I think, in the labeling errors.

As you, I’ve also encountered problems with some of my own dive images, and the classification is not the right one, although I’ve increased the number of images to balance the labels, I have not yet been able to solve it. The underwater images are quite complex, as you may have noticed.

Another thing is that, I have grouped as jacks three sub species according to the list I made at the beginning in a single category (175 images), and with the tuna (90 images) I have done the same, this may be the explanation to what is happening to you, and as both can be silvered, the algorithm must have learned that these characteristics correspond to a jack. In the future I would like to do a better disaggregation in species labeling, but this is something I have not done yet.

Lately, I have been thinking that to improve the models and deal with lack of data and labeling issues, self-supervised learning could be a good alternative.

I hope this has answered your questions.

1 Like

This is a project I did applying collaborative filtering to a books dataset. The blog is mainly non-technical as I wanted it to be readable so no notebooks or code, but it has the results and in particular looks at latent factors in more detail. Naturally my blog is built using fast pages!

3 Likes

I woke up today and decided to open my language model to see what it is actually learning. My model was trained to generate molecules in the SMILES format.

Here’s some results :slight_smile:

Cell number 4 means the fourth neuron of the last LSTM layer. As you can see, it fires when it sees a lower case “c”, which is an aromatic carbon.

7 Likes

fastai enables the implementation of CovidXrayNet. [Paper] [Code]

With only 30 epochs of training, CovidXrayNet achieves 95.82% accuracy on the COVIDx dataset in the three-class classification task (COVID-19, normal or pneumonia).

4 Likes

How to Deploy Fast.ai Models? (Voilà , Binder and Heroku)

Medium article:

code:

I hope this may help.

3 Likes

Car Type Classification

Classifies 4 types of cars.

  • Convertible
  • Pickup
  • Sedan
  • Station Wagon

Medium:

https://medium.com/unpackai/creating-a-fastai-car-type-classification-model-using-a-custom-dataset-653457b26056

1 Like

I use fast.ai to play with the Lung Sound dataset in Kaggle https://www.kaggle.com/vbookshelf/respiratory-sound-database .

In my kernel you can find how to use WeightDataLoader in fastai to oversampling sample and train_test_split to equally distribute classes between train/validation set.
https://www.kaggle.com/dienhoa/healthy-lung-classification-spectrogram-fast-ai

I think this topic is very interesting that anyone can have a cheap stethoscope and use it to monitor their heart or lung states. Then we can send it to the doctor if find something anomaly.

I will go further in this subject and try making an application to classify health’s state of lung/heart with stethoscope which I found it’s very helpful (Especially in the pandemic when we need to limit the contact as much as possible)

8 Likes

Once again, a new competition was announced on Kaggle, and I made a fastai starter notebook :slightly_smiling_face:

https://www.kaggle.com/tanlikesmath/seti-et-signal-detection-a-simple-cnn-starter

7 Likes

This is my work on the lecture 2 Bear classifier that uses Duck duck go. I know that this is nothing original, but I am a newbie to github and development coding and this was pretty challenging for me. Something like this would have helped me a lot. So I just wanted to share the whole thing just in case there are others too who are finding it hard and need something to cling to and boost their confidence.

4 Likes