Upgrade your fastai version to v1.0.57
!pip install fastai==1.0.57
Upgrade your fastai version to v1.0.57
!pip install fastai==1.0.57
Good news… I re-ran the scripts to install pytorch and fastai, and everything is working perfectly now. Working through lesson 1. Thanks everyone for you quick support!
I have recently started Fast.ai and have been interested in Machine Learning for a while now. My lesson two project aimed to tell the difference between two celebrities: Stormzy (Grime Musician) and Romelu Lukaku (Footballer). The two were famously mixed up on the front page of a UK newspaper (much to the annoyance of Stormzy).
I built a classifier on images from google images of the two and got an error of 2.6% with the confusion matrix shown below:
The real test however, was to see how the classifier performed on the image used on the front cover of the newspaper. Despite wearing a Manchester United track suit (the team Lukaku used to play for) the algorithm correctly identified this was in fact Stormzy as shown below:
Really enjoying the course so far!
So rather than doing something interesting as required in lesson 3 (like image segmentation), I thought I would put lesson 1’s resnet50 model on my iphone. I can say it does the inference on my Iphone SE pretty much instantaneously. It is a really fun task to get the pytorch model into coreml. I spent about 2 days doing it because there is lots of learning to do (and some trade offs).
I got a really good error rate as well…
I’m really new to the whole deep learning (and coding for that matter) thing. Thank you @jeremy for teaching in such a clear and concise way.
After playing with the Mnist dataset and getting to 99.571 accuracy on Kaggle, I decided to try my hand at making dark images brighter.
After working on this for a while and sort of getting it to work, I saw this: https://www.youtube.com/watch?v=bcZFQ3f26pA
My approach is a bit different though. I used a crappify function to darken the images randomly to 10-30% of their original brigthness and a Unet to reconstruct the images.
A big thank you to sgugger (sorry, I’m only allowd two mentions) and @kcturgutlu for discussing gradient accumulation, I gladly integrated your code
Also I used the new RAdam optimizer (https://medium.com/@lessw/new-state-of-the-art-ai-optimizer-rectified-adam-radam-5d854730807b) for training.
Long story short, here’s my project:
I was playing around with the Idea of adding a Gan to the end, to generate better results, so other than making the code a lot neater, that’s my next step.
I’m more than happy to listen to sugestions on making this better
Have a great day!
I did an attempt to apply Lesson 1 and 2 to the RESISC45 ( RESISC45 (Northwestern Polytechnical University NWPU, Mar 2017) dataset and compare the results to the paper for the dataset - Remote Sensing Image Scene Classification: Benchmark and State of the Art (Cheng et al. 2017).
Link for the paper: https://arxiv.org/abs/1703.00121
The results table in the paper says that highest accuracy achieved at that time was 90.36% (there is a possibility that I have misread it and actual highest accuracy is greater).
Attempted to apply ResNet 34 with bs of 64first, and the final error rate after unfreezing and retraining earlier layers was around 0.079 which suggests accuracy of 92.01% .
Then attempted to apply ResNet 50 with bs of 32 and got error rate of around 0.073 which suggests accuracy of 92.7% .
Cases that confused the model seem difficult enough.
One curious thing was the fact that the number of times when some of the most confusing pairs “fooled” the model is greater for Resent 50 compared to Resnet 34. Was wondering if this is due to the smaller bs used in Resnet 50 or just Resnet 34 is more suitable for this kind of problem?
Resnet 34 most confused:
Resnet 50 most confused:
Was thinking to write something on Medium (a first for me), together with some more text related to the data and with sharing the notebook too (as soon as I figure out how to do this). Thought to share the above with people, open for any suggestions/opinions.
I am a beginner of the deeplearning from Japan.
I made a webapp ‘Ramen Checker’.
This checker can classify 4 type of ramens, shoyu, miso, tonkotsu, and shio.
Let’s have fun and enjoy eating ramens!!
Many thanks to Jeremy and the fastai team.
I trained a network to classify empty of occupied car parking space for GovHavk2019:
Thanks so much for this library. It made on-boarding a breeze
If you want a challenge, try transferring the FastAI dogs and cats model (pytorch/resnet50) into TensorRT in c++. For the great unwashed, TensorRT is Nvidia’s high performance inference engine that would be used in production both in GPU farms and on edge devices. The screen shot is the dogs and cats trained network (as per lesson 1). I’m a great believer in learning through effort, so I’m going to leave it up to someone else to make the money and write a medium article on exactly how to do this in this exact specific case
Here is a demo running on the Jetson Nano.
this is what is looks like from the raspberry pi camera (on the nano)…
Figured I should share my work here. I built a Chinese calligraphy classifier to train a model that can tell which calligraphy style certain calligraphy piece is. After spent some time cleaning the downloaded data and getting more data, my model reaches 90% accuracy rate. Not bad to me considering the efforts I put in to get the images and how many lines of code to get the results. Medium article link here:
Any comments will be greatly appreciated. I’m still very green on ML/DL so please be gentle.
Also great thanks to @jeremy and @rachel on bringing this fantastic course to us. Really shed lights on where my ML journey should go. Will report back once I finished more lessons!
Did another attempt to apply Lesson 1 and 2, this time to the EuroSAT ( EuroSAT (DFK, Aug 2017)) dataset and compare the results to the paper for the dataset - EuroSAT: A Novel Dataset and Deep Learning Benchmark for Land Use and Land Cover Classification (Helber et al. 2017)
Link for the paper: https://arxiv.org/pdf/1709.00029.pdf
The results table in the paper says that highest accuracy achieved at that time was 98.57% with ResNet 50 applied to the RGB dataset.
Attempted to apply ResNet 34 with bs of 64 and 80/20 Train/Valid split, and the final error rate after unfreezing and retraining earlier layers was around 0.0139 which suggests accuracy of 98.61% . Aware that 0.04% is not really a major improvement, to say it outperformed the paper, believe retrained ResNet 34 matches the ResNet 50 results.
One thing that was worrying is the big difference between the Training and the Validation loss. In Lesson 2, Jeremy says that “Any model that is trained correctly will always have a lower training loss than validation loss”. However, wonder if such big difference between the two is acceptable.
Below is the confusion matrix:
I put my entrepreneur hat on and I went out stalking with my dogs and cats IOS app. I came up behind people and politely asked if I could take a picture of their dog. Then I showed my results and explained my app.
My first observation is that people like you taking a picture of your dog. So if you are doing an entrepreneur course and one of the tasks is to shop your dummy product idea around with real people, this is quite easy. Maybe you could segue into your “urber app” after talking to them for a bit I did have to assure one person that I was not a ranger.
My second observation is that there are many more breeds of dogs out there. So you would need to find and train many more breeds. Further more there are many cross bred dogs out there and I’m not sure what to do about that.
Obviously I’m not planing on putting the app on the store, but still it was an interesting experience. It kind of makes it fun for a non-people person like myself.
I tweaked the existing bear model to make a soccer player classifier (https://kawazoi.onrender.com/). I actually didn’t spend too much time on it (maybe a few hours), but I’m really amazed on how you made the content so accessible! It makes me want to LEARN lot more and HELP others!
You (the whole fastai team) are a true inspiration!
Thank you so much!
And that’s just the beginning…!
do we need to use the images limited to the classes to test the classification? I tried the soccer player classifier above https://kawazoi.onrender.com/ and input an image of an Apple and it said “neymar”. While I dont really like neymar for his histronics, I do want to follow up to see how a classifier can deal with an image that does not belong to any of the classes? It will be considered as noise and hence randomized to any of the classes?
@kawazoi It doesn’t recognize Santa Neymar . Is it because most of your images have him with a black beard?
By the way what was the size of your training set, your error rate after training and is this with a resnet34?
Hi, I made a model that classifies painting as either having been Picasso or Monet with 97% accuracy. https://picasso-or-monet.onrender.com/
A study trained pigeons to classify Picasso vs. Monet with 90% accuracy, so I’d set myself a goal to beat the pigeons. Can Deep Learning Perform Better Than Pigeons?
Thanks to @mrfabulous1 for the help with Render!
Yes, this very simple model only handles these three players. I think an option for dealing with noisy images would be to add a threshold to the classifier, so it only returns the most likely option that surpasses the threshold.
hahaha that’s a funny photo!
Answering your questions… I’ve trained a resnet34, with ~200 images for each class. The error rate was ~10%, which in my opinion is really high.
Also, I trained the model with different types of photos (face only, full body, standing on a soccer field, etc…) so it is not ideal for face recognition. Making some tests, I realized the color of the uniform contributes a lot to the prediction, probably because the training set has this obvious pattern.
I believe the model would greatly improve if I trained it only on faces, rather than on entire bodies. And in order to do that, I think I would have to add a first layer of face detection to crop the input images, and than make the prediction on the cropped image. I’m still advancing in the course material, so I’m not sure if or when I will do that. Anyways, if you have any advice, I would appreciate! Thanks!
Just recently joined Fast AI and this community has been extremely rewarding to me, thanks to @jeremy and all other members. Since this forum is about sharing individual projects, I am glad to showcase my research project where I designed a novel activation function called Mish which beats other SOTA activation functions. Mish was also used to beat several leaderboard scores on Fast AI ImageNette and ImageWoof leaderboards. There is a dedicated Fast AI forum on Mish - Meet Mish: New Activation function, possible successor to ReLU?
The link to the GitHub repository - https://github.com/digantamisra98/Mish
The repository also contains the link to the paper. Feel free to try it out and provide any feedback. Thanks!
I just recently started the FastAI course and its been so fun! I finished the first lesson and took the advice of building my own Image Classifier. I looked around and found a Chest X-Ray Dataset originally published by the U.S. National Library of Medicine. It contained basically images labelled as either Normal or Abnormal(diagnosed with Pulmonary TB).
The Classifier I built basically lets you know whether a given Chest X-Ray has TB or not. The Resnet34 architecture gives an accuracy of 91.8%, while the Resnet50 gives only 90%.
Here’s the medium article, Using Neural Networks to discover Tuberculosis
Please do let me know. Feedback is appreciated
Here’s the Github Repo, if anyone needs it.