Skip to main content

Posts

Showing posts from June, 2022

FastAI Deep Learning Journey Part 9: Building Simple Recommender Systems using collaborative filtering with fastAI

The following post is a modest yet solid start to the topic of recommender systems. In the following notebook collaborative filtering repo , we show how to recommend movies that users are likely to like. What I find very interesting of the method used, in our case collaborative filtering, is that we do not need to know any metadata from the consumer and the items/products, only a metric of interaction with users and items (such as ratings, clicks, purchase, visualization). That goes at the price of data sparsity (many items without sufficient interactions), cold start problem  (how to make recommendations on totally new users or items) and representation bias (we do not have a balanced sample of items/users interactions).  At the end of the post I will make some suggestion for how to overcome those issues. Let's start explaining collaborating filtering in a nutsell. Collaborative filtering Taking our film example will be of use here. Imagine that I am keen to watch sci-fi space

FastAI Deep Learning Journey Part 8: How to implement SOTA models for image classification with fastAI

In the following post, we will explore some of the tricks to achieve the best possible performance for a given data set and architecture. We will learn some additional important steps on data augmentations on training and test time, which is essential to generalize well. Our analysis shows that we go from 81% of accuracy on the baseline model to 92% applying a combination of mixup augmentation (random linear combination of images) and augmentation at test time, after 50 epochs.  Using a baseline data set When testing and idea or understanding  certain technique, it is good to test them on common data sets such as ImageNet, CIFAR or MNIST. The first one is the most common data set used for benchmarks, and it is rightfully so, due to the variety and complexity of the image repository (>1M images and 1000 classes of very different sizes, rotation, objects...). The problem of that dataset is due to the size, training would likely going to take several days with common hardware settin

FastAI Deep Learning Journey Part 7: Calculating crowd size using image regression, a potential application for train use

In the previous post we show how to use a more general approach for the case when images may have one, multiple or any label at all. In this post, we will show how very little changes are required to implement computer vision deep learning methods for regression problems. To make things less theoretical, we picked a very interesting data set, containing 2000 images from people in a shooping mall. Each picture has been carefully labeled, where we can find between 12 to 60 people. This could be a very interesting application for example for public transport usage, as the extension of monthly tickets may very hard to track the usage of each train/bus or other service in real life. We will show that with only 3 epochs /1GPU we managed to get ~2 MAE (mean absolute error) or in order words, get the counting wrong 2+/- person, which is really not a lot considering we can have 60 people in the image. Let see in detail what needs to be changed and explain a potential usage for public transport

FastAI Deep Learning Journey Part 6: Protecting the Amazon rain forest with a multilabel image classifier

 So far, we have been able to classify very accurately a range of multiclass problems, in the last post we cover with 85% validation set accuracy the detection of wild animals in very challenging conditions (movement, light, low quality). In this post we will show how is we can leverage fastai for problems where each image have multiple or no label, in the real case study of Amazon Satellite artifact detection we achieve 96% accuracy with only 3 epochs, 1GPU and 1 hour of training for 17 possible classes. One of the first relevant messages to share is that multilabel classifiers are very generic, as they are not force to give us a class prediction for images which have a new class or none at all , making very appealing for production applications.  Other important point is that turning fastai learners from multiclass to multilabel just requires a change in the loss function and our metrics , making it very straighforward to use. This section show some additional details about the follo