detector.box_fitFind the wrong labels
before a model learns them.
LabelLens audits object-detection datasets (COCO or YOLO). Rule checks catch broken boxes, duplicates and bad images; a barcode decoder, a trained detector, a local vision-language model and, optionally, Claude give a second opinion on every label. Every check's precision is measured on a dataset with known, injected errors.
One of each, caught
A real finding for every kind of injected error. The label under review is orange; what a second opinion saw is blue.
detector.box_fit
detector.box_fit
decoder.box_shifted
detector.wrong_class
detector.unsupported
duplicates.box
geometry.degenerate
geometry.outside
detector.unlabeled
duplicates.image
quality.blur
quality.darkPrecision of every check
80 errors injected into 1,010 images of the BarcodeStress retail set (seed 1): 5% of boxes damaged one of nine ways, plus duplicated, blurred and underexposed images. A finding is correct when it points at an injected error; the base set's own labels are exact, so everything else counts against the check. BarcodeStress's YOLOv8n: 30 epochs on 2,550 synthetic images from another seed, none of them in this set.
| check | correct | precision | errors it caught |
|---|---|---|---|
| detector.box_fit | 17 of 17 | 100% | cut 5, loose 6, shift 6 |
| detector.unlabeled | 16 of 16 | 100% | blur image 1, degenerate 5, missing 5, outside 5 |
| duplicates.image | 10 of 10 | 100% | duplicate image 10 |
| quality.blur | 10 of 10 | 100% | blur image 10 |
| quality.dark | 10 of 10 | 100% | dark image 10 |
| decoder.unlabeled | 7 of 7 | 100% | degenerate 4, missing 2, outside 1 |
| detector.unsupported | 6 of 6 | 100% | spurious 6 |
| duplicates.box | 5 of 5 | 100% | duplicate 5 |
| geometry.degenerate | 5 of 5 | 100% | degenerate 5 |
| geometry.outside | 5 of 5 | 100% | outside 5 |
| decoder.box_shifted | 2 of 2 | 100% | cut 2 |
| decoder.wrong_class | 2 of 2 | 100% | wrong class 2 |
| decoder.box_cut | 1 of 1 | 100% | cut 1 |
| decoder.box_fit | 1 of 1 | 100% | shift 1 |
| detector.wrong_class | 6 of 10 | 60% | wrong class 6 |
Recall by error type
| injected error | caught | recall |
|---|---|---|
| shift | 6 of 6 | 100% |
| loose | 6 of 6 | 100% |
| cut | 5 of 6 | 83% |
| wrong class | 6 of 6 | 100% |
| spurious | 6 of 6 | 100% |
| duplicate | 5 of 5 | 100% |
| degenerate | 5 of 5 | 100% |
| outside | 5 of 5 | 100% |
| missing | 5 of 5 | 100% |
| duplicate image | 10 of 10 | 100% |
| blur image | 10 of 10 | 100% |
| dark image | 10 of 10 | 100% |
Which second opinion helps
The same 80 errors, scored with different sets of checks. CLIP, an open vision-language model, runs on a CPU with no training data and judges every box; it can tell a 1D barcode from a 2D code from an empty surface, not one 1D symbology from another. Without a detector it raises recall from rules alone; next to a trained detector it adds nothing and costs precision, because its false alarms are frames where glare has washed the code out.
| Checks | Flagged | Precision | Recall |
|---|---|---|---|
| Rules and decoder | 58 | 100% | 66% |
| Rules, decoder and CLIP | 84 | 80% | 78% |
| Rules, decoder and detector | 93 | 96% | 99% |
| All four | 110 | 81% | 99% |
How it decides
- RulesDegenerate and out-of-frame boxes, duplicate boxes (IoU 0.85), and class balance. Aspect-ratio outliers are opt-in: on tilted, variable-length symbols they were 14% precise.
- Duplicate imagesA 256-bit difference hash picks candidates generously; the 64x48 pixel difference decides (mean 1.5 or less and 99th percentile 6 or less), so frames that share a background but not a label are kept apart.
- Blur and exposureBlur needs soft edges on the labelled object and little second-derivative energy in the frame; either alone also fires on glare. Underexposed means nothing in the frame is bright, not just a low mean.
- Decoderzxing-cpp reads every symbol and says what and where it really is. Reads that match a box's class confirm it; a UPC-E read out of an EAN-13 is a fragment, not a wrong class.
- DetectorA YOLOv8n trained on separate BarcodeStress images. A label it cannot support is only reported when it does find the other objects in that image, so hard frames do not flood the report.
- Vision model
scripts/clip_review.pyruns CLIP locally over every box and asks whether it shows a 1D barcode, a 2D code or nothing;--vlmturns confident disagreements into findings. Free and needs no training data, but coarse. - Claude (optional)
--llmsends a crop of every flagged box and a 2% sample to Claude, which answers with structured output: is the object there, which class, is the box tight. Answers are cached. Not part of this benchmark: it needs an API key.
On real photos
150 camera-phone photos of product barcodes from the ArTe-Lab collection (CC BY 3.0), labelled from the authors' pixel masks. LabelLens raised 0 box findings and 2 image findings: the two frames below, both genuinely out of focus.


Use it
git clone https://github.com/Arsham1ho/LabelLens && cd LabelLens && uv sync
uv run labellens scan path/to/dataset --out report # COCO json, folder with annotations/coco.json, or YOLO folder
uv run labellens scan path/to/dataset --predictions preds.json # add a detector's second opinion
uv run labellens scan path/to/dataset --vlm vlm.json # add a local vision model's view of every box
uv run labellens scan path/to/dataset --llm # add Claude's review (needs ANTHROPIC_API_KEY)
uv run labellens inject path/to/dataset --out injected --rate 0.05
uv run labellens bench injected --predictions preds.json # score every check