Dataset class-balance checker
Paste your COCO JSON or YOLO labels, see per-class counts and the imbalance ratio. Catch a dominant-class problem before you waste a training run.
Why class balance matters
Object-detection models trained on imbalanced datasets confidently over-predict the majority class and quietly miss the minority ones. A 50:1 ratio is enough to make a model functionally ignore the rare class — even if your overall mAP looks decent.
Rough thresholds:
max:min ≤ 3— balanced; no intervention needed.max:min 3-10— moderate; class-weighted loss or balanced sampling usually fixes it.max:min > 10— severe; combine augmentation, class-weighted loss, and (if possible) more labels of the rare class.min == 0— broken; you can't train a class you have zero labels for.
The fastest fix for severe imbalance: target the rare class with zero-shot detection to find more candidates, then run them through auto-labelling and active learning to expand the rare-class label pool.
Class balance — built into mSightFlow projects
This browser tool checks one snapshot. The platform monitors balance continuously and fires alerts:
# GET .../quality/alerts surfaces class-imbalance alerts among other QA signals
import os, requests
alerts = requests.get(
"https://api.msightflow.ai/v1/projects/PROJECT_ID/quality/alerts",
headers={"Authorization": f"Bearer {os.environ['MSF_API_KEY']}"},
).json()
for a in alerts["alerts"]:
print(f"[{a['severity']}] {a['type']}: {a['message']}")
# → [warning] class_imbalance: 'person' has 45× more samples than 'helmet'Sibling tools
Continuous class-balance monitoring.
Free in every mSightFlow tier — annotation quality + IAA + class-balance alerts run on your projects automatically.