The chapter argues that the best way to begin a human-in-the-loop machine learning project is with a simple, workable minimum viable system that you can improve through iteration. Using a disaster-related news headline classification task as the running example, it emphasizes that real-world datasets are usually not truly random or representative, because they have already been shaped by prior sampling and filtering decisions. Rather than trusting existing datasets as-is, the chapter encourages making assumptions explicit, starting with a small but functional pipeline, and learning from the data as you build.
A central idea is that active learning should guide which items humans review next. The chapter explains two practical signals for selecting useful examples: low model confidence, which highlights items the model is uncertain about, and outliers, which surface novel or unusual items that may be missing from the current training set. It describes an iterative workflow in which a random evaluation set is collected first, an initial training set is labeled, and then new items are chosen by a mix of low-confidence sampling, random sampling, and outlier detection. This strategy helps improve model performance while also increasing dataset diversity and guarding against blind spots.
The chapter also covers the supporting machinery needed to make the loop work: a simple annotation interface, basic data management practices, and a lightweight text classifier implemented in PyTorch. It stresses that the interface should be efficient for annotators, with clear instructions, hotkeys, and a back option, while the data should be stored carefully, redundantly, and without overwriting original files. For evaluation, it recommends using held-out data collected early, and judging progress with F-score and AUC rather than raw accuracy, since the labels are imbalanced. Overall, the chapter’s message is that in early human-in-the-loop systems, getting the data, annotation flow, and iteration process right matters more than optimizing the model architecture first.
The architecture of your first human-in-the-loop machine learning system
The iterative process in your first human-in-the-loop machine learning system. Initially (top), you are annotating a random sample of unlabeled items to set aside as your evaluation data. Then you are labeling the first items to be used for training data (middle), also starting with a random selection. After this point, you start using active learning (bottom) to sample items that are low-confidence or outliers.
The command-line interface annotation tool for the example in this chapter
Summary
- A simple human-in-the-loop machine learning system can cover the entire cycle, from sampling unlabeled data to updating the model. This approach lets you get started quickly with a complete MVP system that you can build out as needed.
- Two simple active learning strategies are easy to implement: sampling the least most confident items from predictions and sampling outliers. Understanding the basic goals of each of these strategies will help you dive deeper into uncertainty and diversity sampling later in this book.
- A simple command-line interface can allow humans to annotate data efficiently. Even a simple text-only interface can be efficient if it is built according to general human–computer interaction principles.
- Good data management, such as creating evaluation data as the first task, is important to get right. If you don’t get your evaluation data right, you may never know how accurate your model is.
- Retraining a machine learning model with newly annotated data at regular iterations shows that your model gets more accurate over time. If designed correctly, the active learning iterations are naturally self-correcting, with overfitting in one iteration corrected by the sampling strategy in the following iterations.
Human-in-the-Loop Machine Learning ebook for free