A neural network doesn't know when it doesn't know.
If you think about it, recognizing when a data point is absolutely unlike any other previously seen is a problem rarely dealt with.
However, it is essential.
In this thread, I'll explain how and why!
🧵 👇🏽
Suppose that this is your training data.
The situation looks fairly straightforward: a simple logistic regression solves the problem.
The model is deployed to production without a second thought.
Now comes the surprise!
We start receiving new data for prediction when we see the following pattern emerge.
The new instances are confidently classified, incorrectly.
Situations like these happen all the time.
For instance, you are building an image-based tool for retailers to detect products on a shelf. One day, some manufacturer comes out with a new product, in new packaging.
How do you prepare your system for that?
One answer is open set recognition: detecting the unknowns.
Instead of looking at the class probabilities given by our network, we take a single step back and analyze the distribution of the resulting feature vector.
For a single feature, it may look something like this.
The method called OpenMax (which is just one among the many, but was one of the first algorithms) detects these anomalies by fitting a particular distribution to the features and checks if new values fit.
In the paper Towards Open Set Deep Networks by Abhijit Bendale and Terrance E. Boult, the authors demonstrate how revealing the activation distributions are.
In their illustration below, you can see that new examples do indeed have different distributions.
This method works if you don't have any control over the training.
Can we perform better if we can modify the training? What if we train the network to be prepared for open set recognition tasks from the start?
Turns out, we can do this.
In their paper Reducing Network Agnostophobia, the authors Akshay Raj Dhamija, Manuel Günther, and Terrance E. Boult came up with a method that can do this.
They observed that the activation of unknown examples tends to cluster around the origin.
You ask me so often for free online resources about deep learning that I decided to collect my favorite courses!
These topics interest you the most:
🟩 practical deep learning,
🟩 deep learning theory,
🟩 math resources to understand the two above.
Let's see them!
🧵 👇🏽
1️⃣ Practical deep learning.
If you want to take a deep dive straight into the field and want to start training your models right away, hands down the best course for you out there is Practical Deep Learning for Coders by fast.ai. (course.fast.ai)
To move beyond training models and learn about tooling and infrastructure, IMO the best course for you is the Full Stack Deep Learning course by @full_stack_dl.
Have you ever thought about why neural networks are so powerful?
Why is it that no matter the task, you can find an architecture that knocks the problem out of the park?
One answer is that they can approximate any function with arbitrary precision!
Let's see how!
🧵 👇🏽
From a mathematical viewpoint, machine learning is function approximation.
If you are given data points 𝑥 with observations 𝑦, learning essentially means finding a function 𝑓 such that 𝑓(𝑥) approximates the given 𝑦-s as accurately as possible.
Approximation is a very natural idea in mathematics.
Let's see a simple example!
You probably know the exponential function well. Do you also know how to calculate it?
The definition itself doesn't really help you. Calculating the powers where 𝑥 is not an integer is tough.