I'm sure you've used data augmentation before.
Most people think of data augmentation as a technique to improve their model during training.
This is true, but they are missing something.
Here's a brilliant approach to improve the predictions of your model:
Let's start with a quick definition of data augmentation:
Starting from an initial dataset, you can generate synthetic copies of each sample that will make a model resilient to variations in the data.
This is awesome. But there's more we can do with it.
Imagine you are building a multi-class classification model.
When testing it, you do this:
• Take every sample
• Run it through the model
• Determine the correct class from the result
You have one opportunity to make the correct prediction.
But you can do better:
You can take advantage of data augmentation to give you a better opportunity to make the correct prediction.
Introducing "Test-time augmentation."
You can augment samples before running them through the model, then average the prediction results.
Imagine you are ready to make a prediction.
Instead of running that sample through the model, you generate three versions of it by changing the image's contrast, rotating it slightly, and cropping it a bit.
You now have four different samples.
Run all four images through the model, average the softmax vectors you get back, and determine the final class from the result.
By augmenting the original image, you give the model more opportunities to "see" something different and compute the correct prediction.
The success of Test-time augmentation depends on how good are your augmented samples.
That's where most of your time will go.
Every augmented image will have a lot of influence on the final result. You don't want sloppy variations!
I've found a lot of success using a few slight modifications to the initial picture.
"Less is more" in this process.
The best part: It's a relatively easy way to improve your predictions.
Every week, I break down machine learning concepts to give you ideas on applying them in real-life situations.
Follow me @svpino to ensure you don't miss what's coming next.