Learn faster with smarter data labeling
By: Nikolai Liubimov
Tags: Artificial Intelligence, Machine Learning, Active Learning, Data Science, Towards Data Science

Learning smarter

So, besides what transfer learning offers, can we further reduce the amount of labeling work? Actually, the answer is yes, and there are a couple of techniques that exist. One of the most well studied is active learning. The principle is straightforward: only label what is useful for your current model. Formally, the active learning algorithm could be summarized in the following steps:

Train initial model Pick one most useful sample (one that model is uncertain about, based on it’s predicted class probabilities) Label this sample and add it to a training set Retrain model on a new training set Repeat from step 2

This heuristic works pretty well with old-school machine learning models (e.g. linear classifiers like logistic regression, SVM, etc.), but empirical studies suggest that it becomes non effective in deep learning setting. Another rarely mentioned drawback is that classical active learning requires retraining the model after each new labeled sample, which is a time-consuming process.

So, summarizing, to enable a quick training of a new classifier without any labeled data, with minimal human efforts, we have to deal with the following:

Make use of the feature space produced by some high-quality pre-trained models Select only the most informative samples to be labelled by human annotators Quickly update our current machine learning state

The first step is very well studied in many research papers and reviews, and even large enterprise companies share nowadays their pre-trained neural networks, that could be very easily plugged into feature extraction pipeline in the manner vectorized_examples = pretrained_model(raw_examples). The ideal starting point is to look at TensorflowHub

Next steps are a tricky art of machine learning. Though intuition behind the informativeness of the sample is clear, it’s unclear how to calculate it accurately. Therefore there exist many different measures based on class probabilities p₁(x), p₂(x), …, pᵢ(x),…, sorted in descending order:

Uncertainty

Margin

Entropy

Which are all subjected to be maximized over seekable example set x ∈ X. Once we found such ambiguous example x, we hopefully see the model be much more confident in the neighborhood of x after retraining. But what if there are no items in the neighborhood of x? Actually this example, despite its model uncertainty, doesn’t give us enough information for faster model convergence, so we have to exclude such outliers from our search space. This can be done by maximizing:

Informational Density

also called the informational density of an example. By maximizing i(x), we pick only those points that are densely surrounded by other points in our feature space.

Uncertainty measures coupled with informational density allow us to pick points which are excellent representatives and still gives new knowledge to the model. But if there are two representative points where model is unconfident, how do you choose one? One way is to choose the most dissimilar example to those already picked. The last ingredient informative measure is diversity:

that promotes to pick as many diverse points as possible.

To combine these 3 measures in one scoring function, it is possible to use the product of theirs corresponding cumulative distribution functions (CDFs) (otherwise you should deal with numbers at the different scales or even negative numbers):

Scoring Function

where each capital letter function denotes CDF, e.g. U(x) = P(u < u(x))