Computer Vision / case study
Annotation QA and Automated Dataset Cleaning
Bad labels hurt object detectors, and checking thousands of images by hand does not scale. This project finds suspicious labels automatically, cleans the dataset, and measures the accuracy the cleaning wins back.
- Python
- PyTorch
- YOLOv8
- 53.6%
- of the mAP50 loss from synthetic noise recovered
- YOLOv8n, 3 training seeds
- 96.73%
- mAP50 on the untouched original dataset
- against 95.26% noisy and 96.05% cleaned
- 1,504
- images across 4 classes
- African Wildlife dataset
- 71.8-82.9%
- detection recall across every error type
- scored against corruption_manifest.json
The experiment corrupts a clean dataset on purpose and keeps a record of every change. That makes two questions answerable with real numbers: how many of the planted errors the detector found, and how much of the lost accuracy cleaning recovered.
Detection is out-of-fold. Images are split into folds, and for each fold a YOLO model trains on the other folds and predicts only the held-out one, so no image is judged by a model that has already seen its labels.
How it works
- Analyze: rule-based checks on the labels for invalid coordinates, tiny or oversized boxes, odd aspect ratios, duplicate boxes and class counts.
- Corrupt: a noisy copy of the training labels deletes boxes, flips classes, shifts and resizes boxes, and adds duplicates, writing every change to corruption_manifest.json. The validation set is never touched.
- Detect: out-of-fold YOLO models predict only the images they never trained on, and confident disagreement with a label is recorded with its line number and box coordinates.
- Score: the detector's flags are compared with the manifest for recall and precision.
- Clean: exact duplicates are removed; in model_assisted mode boxes are also relabelled, moved and added where the model is confident.
- Train and compare: YOLO trains on Original, Noisy and Cleaned data, three seeds each, all evaluated on the same untouched validation set, reported as mean plus or minus standard deviation.
Benchmark summary
Mean results across three training seeds (42, 43, 44).
| Metric | Original | Noisy | Cleaned |
|---|---|---|---|
| mAP50 | 96.73% | 95.26% | 96.05% |
| mAP50-95 | 82.17% | 79.21% | 80.68% |
| Precision | 95.14% | 92.78% | 95.09% |
| Recall | 92.51% | 90.49% | 91.08% |
Annotation error detection
| Error type | Detection recall |
|---|---|
| Missing annotations | 81.6% |
| Incorrect class labels | 74.1% |
| Localization errors | 71.8% |
| Duplicate annotations | 82.9% |
Key findings
Cleaning improved performance over the noisy baseline but did not fully recover the original model's performance. Results are based on synthetic corruption and should not be read as proof that the original annotations are error-free.
- Recovered 53.6% of the mAP50 performance loss introduced by synthetic annotation noise.
- Improved mAP50 from 95.26% (Noisy) to 96.05% (Cleaned).
- Improved on the Noisy condition across all three training seeds.
- Correctly restored 127 deleted annotations and diagnosed 125 class-flipped annotations with the correct class.
Cleaning modes
The confidence a prediction needs before it may change a label is set by clean_relabel_confidence, clean_replace_confidence and clean_add_confidence. Raising them makes the cleaner more careful.
- conservative: removes invalid or malformed boxes and exact duplicates.
- model_assisted (default): also relabels, moves and adds boxes using the detector's output.
- aggressive: also deletes boxes the analyzer calls suspicious (tiny, extreme aspect ratio, huge). This can remove real small objects.
Limitations
- The noise is synthetic. Real labelling mistakes are messier and cluster on hard images.
- The detector's helper models learn from the noisy labels themselves, so heavy noise weakens the detector too.
- Precision is measured against planted errors only, so a flag on a pre-existing mistake counts as a false positive and reported precision is a lower bound.
- A model disagreeing with a label is evidence, not proof. Small or ambiguous objects get flagged more often.
- Detection only; segmentation labels are not supported.