Find 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.

96%precision over 93 flagged boxes and images
99%of 80 injected errors caught
100%precision of the rule and decoder checks alone
15checks, each scored on its own

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.

Shifted boxdetector.box_fit
Shifted box
  • the detector's box (0.98) overlaps this one with IoU 0.37: loose, cut or shifted
Loose boxdetector.box_fit
Loose box
  • the detector's box (0.98) overlaps this one with IoU 0.36: loose, cut or shifted
Cut-off boxdecoder.box_shifted
Cut-off box
  • a EAN-13 decodes just outside this box; the box is probably shifted or cut short
Wrong classdetector.wrong_class
Wrong class
  • labelled code128, detector says qr (0.97)
Box on nothingdetector.unsupported
Box on nothing
  • the detector finds the other objects in this image but nothing here
Duplicate boxduplicates.box
Duplicate box
  • duplicates box 496 (IoU 0.94)
Squashed boxgeometry.degenerate
Squashed box
  • box is 644.7 x 1.8 px
Box outside the imagegeometry.outside
Box outside the image
  • box extends 56 px outside the 960x720 image
Missing labeldetector.unlabeled
Missing label
  • the detector finds a code128 (0.98) with no label
Duplicate imageduplicates.image
Duplicate image
  • near-identical to image 90 (hash distance 0, pixel difference 0.0)
Blurred imagequality.blur
Blurred image
  • soft edges: 0.51 per unit contrast on the labelled object, Laplacian to gradient energy 0.021
Underexposed imagequality.dark
Underexposed image
  • underexposed: 99% of pixels are below 41/255 (mean 20)

Precision 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.

checkcorrectprecisionerrors it caught
detector.box_fit17 of 17100%cut 5, loose 6, shift 6
detector.unlabeled16 of 16100%blur image 1, degenerate 5, missing 5, outside 5
duplicates.image10 of 10100%duplicate image 10
quality.blur10 of 10100%blur image 10
quality.dark10 of 10100%dark image 10
decoder.unlabeled7 of 7100%degenerate 4, missing 2, outside 1
detector.unsupported6 of 6100%spurious 6
duplicates.box5 of 5100%duplicate 5
geometry.degenerate5 of 5100%degenerate 5
geometry.outside5 of 5100%outside 5
decoder.box_shifted2 of 2100%cut 2
decoder.wrong_class2 of 2100%wrong class 2
decoder.box_cut1 of 1100%cut 1
decoder.box_fit1 of 1100%shift 1
detector.wrong_class6 of 1060%wrong class 6

Recall by error type

injected errorcaughtrecall
shift6 of 6100%
loose6 of 6100%
cut5 of 683%
wrong class6 of 6100%
spurious6 of 6100%
duplicate5 of 5100%
degenerate5 of 5100%
outside5 of 5100%
missing5 of 5100%
duplicate image10 of 10100%
blur image10 of 10100%
dark image10 of 10100%

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.

ChecksFlaggedPrecisionRecall
Rules and decoder58100%66%
Rules, decoder and CLIP8480%78%
Rules, decoder and detector9396%99%
All four11081%99%

How it decides

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Vision modelscripts/clip_review.py runs CLIP locally over every box and asks whether it shows a 1D barcode, a 2D code or nothing; --vlm turns confident disagreements into findings. Free and needs no training data, but coarse.
  7. Claude (optional)--llm sends 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.

real photo flagged quality.blur
IMAG0468.jpg
  • quality.blursoft edges: 0.60 per unit contrast on the labelled object, Laplacian to gradient energy 0.023
real photo flagged quality.blur
IMAG0474.jpg
  • quality.blursoft edges: 0.64 per unit contrast on the labelled object, Laplacian to gradient energy 0.019

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