Plug and Play Active Learning for Object Detection
- Publication
- CVPR 2024Conference
- First submitted to arXiv
- arXiv:2211.11612
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{objectdetectionppal2022,
title = {{Plug and Play Active Learning for Object Detection}},
author = {Chenhongyi Yang and Lichao Huang and Elliot J. Crowley},
year = {2022},
eprint = {2211.11612},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2211.11612}
}
Annotating detection data is expensive. A single street photo may have twenty objects, each needing a box and a class, so one image takes several minutes.
You have a hundred thousand unlabeled photos and a budget for only five thousand. Which five thousand do you pick?
You could pick at random, of course, but many of them may show things the model already knows, and labeling them teaches it little. This is the question active learning (AL) tries to answer, by letting the current model point out which images would help it most once labeled.
The paper comes from Chenhongyi Yang and Elliot J. Crowley of the University of Edinburgh and Lichao Huang of Horizon Robotics. The "plug and play" in the title is the paper's main point. Many active learning methods designed for detection have to modify the detector's architecture or training pipeline; PPAL touches neither, so it plugs straight into any detector.
Problem Definition
Active learning works in rounds. Label a small portion of the data and train a detector; run that detector over all the unlabeled images and pick of them for annotation; add them to the training set, retrain, and pick the next batch. After several rounds, compare how much the model's mAP has improved; the larger the improvement, the better the selection strategy.
Selection strategies fall roughly into two camps:
- Uncertainty. Pick the images the model is least sure about. In classification, the most common approach is the entropy of the predicted probabilities; the higher the entropy, the more undecided the model.
- Diversity. Pick a set of images that represents the whole data distribution, as unlike each other as possible, so you don't end up with a pile of nearly identical photos.
Both camps work well for image classification, but each runs into problems in object detection.
On the uncertainty side, detection has two tasks at once, classification and localization. An object may be easy to box but hard to classify, or the other way around, so how do you combine the two into one score?
On the diversity side, classification images usually have a single subject, so averaging the features of the whole image and comparing similarity works fine. Detection images often contain many objects; after averaging, the features of large objects drown out the small ones, and the resulting similarity is inaccurate.
Earlier methods designed specifically for detection, such as MIAL and DivProto, modified the detector's architecture or training to estimate uncertainty, so switching to another detector means redoing the modifications.
Solution

PPAL connects the two camps in two stages. The first stage uses uncertainty to filter a candidate pool, times the size of the budget, out of the many unlabeled images; the second stage picks the most mutually dissimilar images from the candidate pool. Each stage has a new design, one for each of the two problems above.
Stage 1: Different Categories, Different Difficulty
The most direct image uncertainty is the sum of the classification entropies of every detected object in the image:
is the number of objects detected in the image, and is the probability that the -th object belongs to class .
This score looks only at classification and ignores localization; it also treats every category alike. But the model's grasp of different categories varies a lot. The authors split the Pascal VOC categories into three groups by difficulty; in the first round, the hardest 30% of categories are at only around 25 AP, while the easiest 40% are already close to 60. It stands to reason that more images containing hard categories should be picked.
The authors' method is called DCUS (Difficulty Calibrated Uncertainty Sampling), which multiplies the entropy by a per-category difficulty coefficient.
First, how hard each object is. During training, every predicted box assigned to a ground-truth box gets a difficulty:
is the predicted probability of the correct class, and is how much the boxes overlap. If the classification is confident and the box is accurate, the difficulty is close to 0; if either one is poor, the difficulty rises. sets how much weight classification and localization each get, 0.6 by default. This way, both classification and localization count.
Then, how hard each category is. Each category keeps a difficulty , initialized to 1 and updated during training by an exponential moving average (EMA) toward the mean difficulty of that category's objects, with momentum . If a batch contains no objects of a category, that category's momentum is multiplied by once more; the next time the category shows up, the update gives more weight to the new difficulty, so rare categories can keep up.
Finally, turn it into a coefficient. After each round of training, the category difficulty is converted into a coefficient:
The formula looks odd, so let's plug in the defaults and . . At difficulty , ; at difficulty , , so . The coefficient therefore lies between 1 and 1.2, with setting the upper limit. The logarithm shapes the middle; at it's already 1.08, and at it's 1.16, so as soon as difficulty starts to rise, the coefficient climbs a good part of the way.
Multiplying the coefficient into the entropy gives the final image uncertainty:
Images are sorted by , and the most uncertain ones form the candidate pool, with set to 4 by default.
Stage 2: Compare Object by Object
The images in the candidate pool are all ones the model is unsure about, but they may resemble each other. Take a pile of blurry night-time street scenes; picking five of them does about as much as picking one. The second stage picks a diverse set of images from the candidate pool.
Diversity needs a similarity measure. The authors propose CCMS (Category Conditioned Matching Similarity), which compares objects instead.

The right side of the figure shows how CCMS works. The detector finds a set of objects in each image, each with a feature , a detection score and a predicted class . Each object in image A looks only at objects of the same class in image B and takes the most similar one:
Adding 1 puts the score between 0 and 2; if image B has no object of the same class, the score is 0. In the figure's example, A's dog is compared with B's dog by their features, and A's person finds no person in B and scores 0.
The similarity of A to B is the average of the scores of all objects in A, weighted by detection score; averaging the two directions, A to B and B to A, makes the similarity symmetric. Objects with low detection scores may be outright false positives, so they get less weight.
A similarity computed this way reflects both whether the two images contain the same things and whether those things look alike.
Picking a Set of Images by Similarity
With pairwise similarities in hand, the next task is to pick images so that the largest similarity among them is as small as possible. This is NP-hard, so the authors follow Core-set and use the k-Center-Greedy algorithm to find an approximate solution.
But chasing diversity alone tends to pick odd outliers. So the authors use the k-Center-Greedy result as the initial centers and run k-means++, so that the selected images are representative as well. Since there are only pairwise similarities and no real feature vectors to average, each cluster's new center is the image in the cluster with the highest total similarity to the others. The final centers are the images sent for annotation.
The whole process uses only the detector's outputs, namely class probabilities, detection scores, boxes and object features. Neither the detector itself nor the training pipeline needs any change.
Discussion
Experimental Setup
The datasets are COCO and Pascal VOC. Comparisons with earlier work follow the data splits of MIAL and DivProto. All ablations use RetinaNet on Pascal VOC, starting with 5% of the training data labeled at random, then running six rounds that each label another 2.5%, ending at 20%; each setting is run three times with three different initial sets and averaged. The default backbone is ResNet-50, each round trains for 26 epochs, and the implementation uses MMDetection on 8 2080Ti GPUs.
Against Earlier Work
The authors compare against earlier work in three settings, RetinaNet on COCO, RetinaNet on Pascal VOC, and Faster R-CNN on COCO. PPAL leads in every round. The gap is largest in the early rounds; over the first three rounds PPAL is 3.4 AP above MIAL on COCO and 2.8 mAP above it on Pascal VOC, and after that the gap narrows, though PPAL stays ahead.
The authors also play fair here. For the entropy baseline, they use the sum of all objects' entropies as the image uncertainty rather than the mean or maximum common in earlier work, and this baseline turns out stronger than the ones earlier papers reported.
Plugged into three other detectors, FCOS, ATSS and DDOD, PPAL also beats the three baselines of random selection, entropy and Core-set. With SSD, whose detection heads use different convolution kernels at different levels, object features can't be compared directly, so the authors compute similarity with the KL divergence between classification probability vectors instead, and it still works.
What Each Stage Handles

The chart picks out five combinations. The dashed gray line at the bottom is random selection; the other four sit well above it, already seven to just over nine points ahead at 7.5%, so active learning does help.
First compare the purple and green lines. Neither uses diversity; the only difference is whether stage 1 uses plain entropy or DCUS. At 7.5%, DCUS is 2.0 higher; by 20%, the gap is down to 0.7.
Then compare the green and blue lines. Both use DCUS in stage 1; with CCMS added in stage 2, the blue line pulls away from 10% on and ends at 72.6.
From the full ablation table, the authors conclude that uncertainty matters more in the early rounds and diversity matters more in the later ones. Keeping CCMS in stage 2 but switching stage 1 to random selection gives only 56.6 at 7.5%, 4.2 below DCUS, with the gap narrowing to 2.3 by 20%. Conversely, keeping DCUS in stage 1 but switching stage 2 to random selection is only 0.5 below CCMS at 7.5%, and the gap afterward ranges from 0.6 to 2.1.
Now the orange line. Switching stage 2 to global similarity, that is, comparing whole-image averaged features, does worse than a fully random stage 2 in five of the six rounds. Earlier work almost always used global similarity for diversity, and on multi-object detection data, that's as good as useless. Two other alternatives, averaging features across the FPN levels or the Jaccard similarity of the two images' category sets, perform about as well as random selection, both below CCMS.
The authors also tried replacing the difficulty coefficient with one minus the category frequency, giving rare categories more weight. It did worse than DCUS. They found that per-category AP doesn't strictly track how often a category appears in the training data, so measuring the model's performance on each category directly is more accurate.
Hyperparameters
Varying the four hyperparameters , , and within normal ranges gives about the same results, and the authors say they didn't tune them carefully.
What matters more is the candidate pool size . At , stage 1 decides everything; it does fine early on but falls behind later for lack of diversity. At and above, the candidate pool takes in too many images the model is actually sure about, and the early rounds suffer. Around 4 is best.
Other Backbones
| Backbone | Method | 7.5% | 12.5% | 20% |
|---|---|---|---|---|
| ResNet-101 | Random | 59.3 | 68.4 | 72.3 |
| ResNet-101 | PPAL | 64.3 | 71.1 | 75.0 |
| MobileNetV2 | Random | 31.2 | 39.7 | 44.7 |
| MobileNetV2 | PPAL | 35.7 | 45.6 | 50.7 |
| Swin-T | Random | 63.8 | 70.0 | 73.3 |
| Swin-T | PPAL | 68.4 | 72.7 | 76.2 |
Compiled from Table 4 of the paper, Pascal VOC, RetinaNet.
From a larger backbone to a lightweight one to a Transformer, PPAL stays consistently above random selection; the gap in the last round ranges from 2.7 to 6.0, largest for the lightweight MobileNetV2.
What CCMS Actually Measures
The authors ran a retrieval experiment on COCO. For each image, they used global similarity and CCMS separately to retrieve the 20 most similar images, then checked how much the retrieved images' category sets overlapped with the original's. The higher the CCMS, the closer the category sets; global similarity shows no such relationship and often gets pulled toward the main object in the scene, ignoring the others.
Conclusion
Active learning for detection has two difficulties. Uncertainty has to account for both classification and localization, and similarity has to cope with the many objects in one image. PPAL offers a fix for each. DCUS weights the entropy by category difficulty accumulated during training, and CCMS compares each object only with objects of the same class. Both use only the detector's outputs, with no changes to the architecture.
When putting it into your own annotation workflow, get uncertainty right in the early rounds, then rely on diversity to pull ahead in the later ones. Make the candidate pool about 4 times the budget; too small and you pick a pile of similar images, too large and images the model already handles slip in.
As for averaging the whole image before comparing similarity, on multi-object detection data it loses even to random selection in most rounds, and that is what almost all earlier work did.