Overview

5 Advanced active learning

The chapter extends active learning from single-method selection into practical combinations that better balance model uncertainty, sample diversity, and domain representativeness. It shows that a simple but powerful workflow is to first collect a broad set of uncertain items and then refine that pool with clustering or outlier filtering, so the final labels are both informative and varied. The text emphasizes that many of these combinations can be implemented in only a few lines of code, and that in real systems the simplest effective method is often preferable to a more elaborate algorithm.

Several hybrid strategies are explored in detail, including pairing least-confidence sampling with clustering, uncertainty sampling with model-based outliers, representative sampling with clustering, and sampling from the cluster with the highest average entropy. Each method is designed to focus annotation effort on items that are either near the decision boundary, unlike the current model’s training data, or concentrated in parts of the feature space where the model is most confused. The chapter also discusses broader ways to combine active learning scores, such as averaging scores, converting them to percentiles, or taking unions and intersections of candidate sets, and it introduces expected error reduction as a theoretically appealing but often impractical approach because of retraining costs and sensitivity to noise.

The second half of the chapter shifts to active transfer learning, where transfer learning is used not just to adapt a model but to build a model that predicts where it is uncertain, wrong, or out of domain. It explains how to train a small classifier on hidden representations so the system can predict its own errors, then use those predictions to choose the most valuable unlabeled items. This idea is extended to representative sampling and to an adaptive approach that repeatedly samples, relabels, and retrains within a single cycle. The chapter closes by weighing the strengths and limitations of these methods: they can be fast, label-efficient, and flexible across architectures, but they can also overfit, underrepresent parts of the feature space, and require careful tuning when data are noisy or highly ambiguous.

One possible result of combining uncertainty sampling and diversity sampling. When these strategies are combined, items near diverse sections of the decision boundary are selected. Therefore, we are optimizing the chance of finding items that are likely to result in a changed decision boundary when they’re added to the training data.
An example combining least confidence and clustering-based sampling. First, uncertainty sampling finds items near the decision boundary; then clustering ensures diversity within that selection. In this figure, the centroids from each cluster are sampled. Alternatively, or in addition, you could select random members of outliers.
This example of combining uncertainty sampling with model-based outliers selects items that are near the decision boundary but that are different from the current training data items and, therefore, different from the model.
An example (bottom) of combining representative sampling and cluster-based sampling. This method samples items that are most like your application domain relative to your current training data and also different from one another. By comparison, the simpler representative sampling method in chapter 4 treats each distribution as a single distribution.
This example of combining cluster-based sampling with entropy (bottom) samples items within the cluster that show the most confusion. You might think of this cluster as being the one that straddles the decision boundary most closely. In this example, random items are sampled in the cluster, but you could experiment by sampling the centroid, outliers, and/or oversampling items within the cluster that have the highest entropy. By comparison, simple clustering (top) samples items from every cluster.
We have a model that predicts a label as “A,” “B,” “C,” or “D” and a separate dataset with the labels “W,” “X,” “Y,” and “Z.” When we retrain only the last layer of the model, the model is able to predict labels “W,” “X,” “Y,” and “Z,” using far fewer human-labeled items than if we were training a model from scratch.
Validation items are predicted by the model and bucketed as “Correct” or “Incorrect” according to whether they were classified correctly. Then the last layer of the model is retrained to predict whether items are “Correct” or “Incorrect,” effectively turning the two buckets into new labels.
More-complicated active transfer learning architectures, using active transfer learning to create a prediction. The top example has a single neuron in the new output layer. The bottom example is a more-complicated architecture, with a new hidden layer that connects with multiple existing hidden layers.
We can build a model to sample the items that are most unlike the current training data. To begin, we take validation data from the same distribution as the training data and give it a “Training” label. Then we take unlabeled data from our target domain and give it an “Application” label. We train a new output layer to predict the “Training” and “Application” labels, giving it access to all layers of the model. We apply the new model to the unlabeled data (ignoring the unlabeled items that we trained on), and sample the items that are most confidently predicted as “Application.”
Because our sampled items will get a human label later, we can assume that they become part of the training data without needing to know what the label is. To begin, we take validation data from the same distribution as the training data and give it a “Training” label. We take unlabeled data from our target domain and give it an “Application” label. We train a new output layer to predict the “Training” and “Application” labels, giving it access to all layers of the model. We apply the new model to the unlabeled data (ignoring the unlabeled items that we trained on) and sample the items that are most confidently predicted as “Application.” We can assume that those items will later get labels and become part of the training data. So we can take those sampled items, change their label from “Application” to “Training,” and retrain our final layer(s) on the new dataset.
Because our sampled items will later get a human label and become part of the training data, we can assume that the model will later predict those items correctly, because models are typically the most accurate on the actual items on which they trained. To begin, validation items are predicted by the model and bucketed as “Correct” or “Incorrect,” according to whether they were classified correctly. The last layer of the model is retrained to predict whether items are “Correct” or “Incorrect,” effectively turning the two buckets into new labels. We apply the new model to the unlabeled data, predicting whether each item will be “Correct” or “Incorrect.” We can sample the most likely to be “Incorrect.” Then we can assume that those items will get labels later and become part of the training data, which will be labeled correctly by a model that predicted on that same data. So we can take those sampled items, change their label from “Incorrect” to “Correct,” and retrain our final layer(s) on the new dataset.
Advanced active learning cheat sheet
Active transfer learning cheat sheet

Summary

  • You have many ways to combine uncertainty sampling and diversity sampling. These techniques will help you optimize your active learning strategy to sample the items for annotation that will most help your model’s accuracy.
  • Combining uncertainty sampling and clustering is the most common active learning technique and is relatively easy to implement after everything that you have learned in this book so far, so it is a good starting point for exploring advanced active learning strategies.
  • Active transfer learning for uncertainty sampling allows you to build a model to predict whether unlabeled items will be labeled correctly, using your existing model as the starting point for the uncertainty-predicting model. This approach allows you to use machine learning within the uncertainty sampling process.
  • Active transfer learning for representative sampling allows you to build a model to predict whether unlabeled items are more like your target domain than your existing training data. This approach allows you to use machine learning within the representative sampling process.
  • ATLAS allows you to extend active transfer learning for uncertainty sampling so that you are not oversampling items from one area of your feature space, combining aspects of uncertainty sampling and diversity sampling into a single machine learning model.

FAQ

What is the main goal of advanced active learning in chapter 5?To combine earlier active learning techniques into more effective sampling strategies, especially by blending uncertainty sampling with diversity or representative sampling, and by using transfer learning to predict which items to sample next.
How can uncertainty sampling and diversity sampling be combined in practice?A common practical approach is to first take a large set of uncertain items and then refine that set with a diversity method such as clustering, so the final samples are both near the decision boundary and spread across different regions of the feature space.
What does least confidence sampling with cluster-based sampling achieve?It selects the most uncertain items first, then clusters them to ensure the final sample is diverse. This helps find items that are both informative and not overly similar to one another.
Why combine uncertainty sampling with model-based outliers?This combination focuses on items that the model is confused about and that also look unusual to the model, maximizing the chance of selecting examples that could significantly improve model knowledge and accuracy.
Why might you add clustering after model-based outlier sampling?Because model-based outlier sampling can return many similar items, clustering helps filter those results into a more diverse set, reducing redundancy in the sampled batch.
What is representative sampling with clustering used for?It is used for domain adaptation by finding unlabeled items that are most representative of the target domain while also ensuring diversity across multiple clusters, rather than treating the data as one single cluster.
What is sampling from the highest-entropy cluster?It means finding the cluster whose items have the greatest average uncertainty, then sampling from that cluster because it is likely to contain the most confusing or decision-boundary-crossing examples.
What is expected error reduction sampling?It is an advanced strategy that estimates how much the model’s error would decrease if a given unlabeled item were labeled. It is meant to combine uncertainty and diversity, but it can be expensive and is not commonly used in real-world systems.
What is active transfer learning for uncertainty sampling?It is a method that trains a new model to predict whether the main model’s predictions are correct or incorrect, and then uses that model to sample items most likely to be incorrect and therefore most valuable for labeling.
What is ATLAS in chapter 5?ATLAS stands for active transfer learning for adaptive sampling. It extends active transfer learning by iteratively sampling items predicted to be incorrect, then treating those sampled items as if they will later become correctly labeled training data in future iterations.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Human-in-the-Loop Machine Learning Human-in-the-Loop Machine Learning ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Human-in-the-Loop Machine Learning Human-in-the-Loop Machine Learning ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Human-in-the-Loop Machine Learning Human-in-the-Loop Machine Learning ebook for free