Share your work here ✅

Often I find myself feeling burdened by the slow progress I’m making in my Deep Learning journey… but I kept that aside for a bit to write up some thoughts, insights, handy todos and setup guides for the non-geeks trying to do Deep Learning:

Special thanks to @jeremy and @rachel - your positive influence made this possible.
Also thanks to @wgpubs, @hiromi and @rob for their posts on vim setup for fastai. I built on their inputs to get my setup guide going.

5 Likes

I’ve created a surname language classifier with 67% accuracy over 16 languages based on the PyTorch example using fast.ai.

I treat the activations from late in the network as an embedding for the names and use it to find “similar” names using the distance in this embedding space. It doesn’t perform fantastically, but is a useful proof of concept for better performing models on more complex tasks.

> closest('Thomas')

Manus (Irish): 49.601768493652344
Jemaitis (Russian): 56.250274658203125
Horos (Russian): 63.35132598876953
Klimes (Czech): 73.13825225830078
Bertsimas (Greek): 73.65045166015625
Tsogas (Greek): 79.87809753417969
Simonis (Dutch): 85.69441223144531
Honjas (Greek): 86.7238998413086
Mihelyus (Russian): 87.06715393066406
Grotus (Russian): 88.79036712646484

Highlights:

  • We can create our own character level Tokenizer, wrap it in a TokenizeProcessor and pass it to a text list as a processor
  • Using a balanced training set (which means including objects from rare cases multiple times) gives a much better result on a balanced validation set (with an equal number from each class). The full training set gives ~30-40% accuracy where the balanced set gives ~60-70%.
  • The default fast.ai text classification model works really well in this context without tuning. This is pretty astounding given it was tuned for word-level tokens.
  • Embeddings give much better results than one-hot encoding the inputs (the fast.ai text classification does this for you)
4 Likes

I’ve created this tool Code with AI which tries to solve a problem I used to face, that is while taking part in a competitive programming competition I sometimes wished for something which would tell me (or give hints) as to which competitive programming concept will be used to solve that problem!
Thanks to @jeremy and fast.ai, I have been able to solve this problem!

Here’s a Demo

Some details about the current model: It solves this multi-classification problem, with >80 different classes of problems, with an unbalanced factor of ~100 and uses pretrained wikitext103.

The current model has an F1 score of ~49 and I’m thinking of improving it further by using bidirectional RNN and an approach similar to DeViSE paper, i.e instead of training the model to predict O or 1, train the model to go closer towards the embedding vector representation of labels - the intuition behind this is that labels in competitive programming like graph, dfs, bfs etc aren’t disjoint. Will share the results I get with that approach.

6 Likes

Hello everyone,

I had never participated in any machine learning hackathons, with fastai tabular and i made an attempt and participated in 2 hackathons where i secured rank 152 and rank 31 respectively, although first hackathon i did’nt include all the tables of training data.

https://github.com/PrajwalPrashanth/GenpactMlHackathon/blob/master/all3weekmod.1500200(1).ipynb , This is the link to the notebook for the second hackathon. I tried to change embeddings, different no. of neurons for continuous data… but did’nt help to imporve the score.

I wanted to know what more could have been done like any data manipulation steps or different architecture of NN or any other suggestions about going on with tabular data.

3 Likes

very cool!

Hey Dave, just to let you know that your project is awesome and the published notebooks super helpful to learn from. Thank you!

I was able to deploy my model (resnet-34 trained on Plant Village dataset) on render, it’s super fast and super easy like fastai. all thanks to @anurag

Notebook : https://nbviewer.jupyter.org/github/shubhajitml/crop-disease-detector/blob/master/notebook/plant_village.ipynb

Demo : https://which-crop-disease.app.render.com/

Any suggestion for improvement is appreciated.

6 Likes

I have implemented semantic segmentation for Pascal VOC dataset using fastai v1.0.34 library. I have made a GitHub repository:
https://github.com/keyurparalkar/Semantic-Segmentation-with-UNETs.

Feedback and suggestions for improvement are appreciated.

3 Likes

Does your dataset contain questions from codechef only?

The dataset has questions from codechef and codeforces. I tested the tool from questions from hackerrank as well, it seemed to work. Also, I’d put up a blog post on codeforces to see how it goes, and have received positive response from the community.

1 Like

Thanks Jeremy, that makes sense, so I went back and read more text samples, since I recalled seeing some where the source was mentioned. There’s no field for the article source, and the model only sees the article text, so I looked for the news source (or something related) showing up in the text. Turns out there aren’t many of those - maybe 5%. Most are “clean” in not having any markers that I could see.

But I looked deeper into the dataset heritage and it was (in my opinion) a bit flawed, partly because it was labelled based on the article source (website) and not on the actual content. McIntire used a Kaggle fake news dataset (https://www.kaggle.com/mrisdal/fake-news) from 2016 for his ‘fake’ records and AllSides (https://www.allsides.com/unbiased-balanced-news) to scrape articles for ‘real’ records. The Kaggle ds was in turn based on a Chrome add-in, BS Detector (https://bsdetector.tech/) which in turn was based on classification of online sources by OpenSources (http://www.opensources.co/) which actually has 12 classes. The Kaggle ds used the most ‘fake’ websites to collect articles with 8 classes, and McIntire simplified the labelling into just FAKE, which I think is a bit misleading (e.g., that includes the ones labeled ‘satire’).

I think it’s misleading to judge that an article is fake strictly because of its source, and reading some ds samples bears that out: there are quite a few records where the article content seemed fine to me (and I’m pretty skeptical in general) but it was classified as fake.

But all that said, it still looks to me like the model works amazingly well at classifying McIntire’s dataset. Because I consider the labeling to be biased and too simplistic, I don’t think this should be used for a real-world application, but it was a good learning experience, and I’m planning to move on to trying the full Kaggle ds. But I would appreciate any other feedback or suggestions!

9 Likes

Hi,
I have started writing a small blog after reading couple of deep learning related papers.(More on its way :grinning:)

https://jithinjk.github.io/blog

I have only tried to summarize important points from relevant papers. Just like a bookmark, if you want to refer a certain paper in the future, but instead of reading it through its entirety, you could come here and go over the summarized version.

Please do let me know what you think and also mention other relevant papers that you would like to see here.

5 Likes

Update on this. I made some modifications to the model and deployed it to AWS. The main thing I changed about the model was the dataset used. It turns out when you train an image generation model on images of pets, it starts to make everything look a little furry. Instead I used a subset of the Open Images dataset.

I got the model up and running on AWS. @pankymathur’s code was helpful in figuring out returning an image. Although I still manage the process by saving the model output as an image and serving it with html, which I am not sure is optimal. I’m planning on doing a write up of the whole process at some point.

Anyway you can check out the web app here:

http://www.deepenhance.im/

4 Likes

I made a couple of text generators following the model of lesson 3 IMDB – one is trained on the complete works of Jane Austen and the other on Trump’s tweets from 2009-2018. :stuck_out_tongue: They are both online, the first at https://deepjane.now.sh/ and the second at https://deepdonald.appspot.com/. The second is powered by Google App Engine. In case it helps anyone in the future, I had a lot of trouble getting the app working on GAE (I ran into errors even with the starter code) but ended up able to deploy successfully after building the Docker image locally (and trying over and over a bunch of times).

They are also on twitter! Jane is @AutoAusten and Donald is @RNN_DonaldTrump. They tweet periodically by themselves, but you can also @ message them a few words and they’ll (hopefully) respond with a tweet beginning with your message. If you try them and don’t get a response, please let me know! I’ve been working out the bugs but fear there are still some lurking around.

Currently working on a Medium post about the experience. :slight_smile:

7 Likes

Create an infinity of images to train your Neural Networks :slight_smile:
My article on “Data Augmentation by fastai v1”. All comments welcome! Thanks.

3 Likes

Good one Karl, just tried uploading few thumbnails and output resolution images were great, IMHO App and website look great :slight_smile: . you can surely enhance and optimize it in future, depending upon traffic and heavy production loads, so keep up the good work

I trained a facial attribute multi-label classification model which finds 40 attributes using CelebA dataset. I have also used OpenCV to combine it with the webcam for live detection. The code is on Github.
I also wrote a blog on medium - https://towardsdatascience.com/real-time-multi-facial-attribute-detection-using-transfer-learning-and-haar-cascades-with-fastai-47ff59e36df0

Check the output -

I did an object detection problem that finds the center of a phone in an image using Fastai v1 and the Datablock api. The link to it on my github is here.

One of the challenges I had was making a custom collate function for single image points, as Fastai only has one function for bboxes in the vision library. Having it work though made a huge difference in my accuracy as I only had ~115 images to work with.

4 Likes

I made a basic snake classifier as a small project. The first and only goal of the initial part was to prove if it could readily distinguish between a very common confusion of copperhead (venomous) and corn snake (harmless). Result was it could do so rather easily and got to 100% quickly with all three models (resnet, vgg, etc). I wrote an article on it to help promote FastAI here:

Now I’m working on adding a number of other snakes (garter, rattlesnake, etc) to try and expand it into a fuller snake classifier where people could just easily upload a photo and get a classification for most snakes in the US and ideally other countries over time.

2 Likes

Did you check the image regression (keypoints) lesson notebook? IIRC I had something there that was doing single image points and worked OK…