TL;DR
Training high-accuracy object detection models usually requires thousands of expensive, manually drawn bounding boxes. This paper demonstrates a workflow to train a YOLOv11 model for specialized bakery inventory tasks using only image-level labels and automated pseudo-labeling from foundation models (like SAM 2 and Grounding DINO), ultimately matching or exceeding the performance of fully supervised baselines.
What Problem Does This Paper Address?
In the food industry, especially in German bakeries, managing "leftovers" is critical for reducing waste and optimizing production. However, manual counting is labor-intensive, and the sheer variety of baked goods makes traditional "fully supervised" computer vision—where humans must manually annotate every single bun and pretzel in thousands of photos—prohibitively expensive and slow.
While "open-vocabulary" models (which can theoretically detect anything you describe in text) exist, they often struggle with the fine-grained differences between specialized industrial products. The authors sought a way to bridge the gap: how to get the accuracy of a custom-trained model without the massive manual annotation bottleneck.
Methods
The authors proposed a two-stage training workflow that leverages "foundation models" to do the heavy lifting:
- Weakly Supervised Annotation: Instead of drawing boxes, employees took photos of trays containing only one type of product (e.g., only "Pretzel Sticks"). The researchers used open-vocabulary models (OWLv2 and Grounding DINO) with a generic prompt ("baked good") to find the objects. Because they knew the tray only had one type of item, they could automatically assign the correct label to every box found. They applied four custom filters (Background, Duplicate, Crowd, and Nested) to clean up the automated predictions.
- Pseudo-Labeling via Tracking: To make the model robust to different camera angles, they recorded videos of the trays. They used Segment Anything 2 (SAM 2) to propagate a few initial labels across thousands of video frames. This reduced manual annotation effort by over 96%.
- Edge Deployment: They trained YOLOv11x on this automated data, targeting a balance between high accuracy and sub-second latency on mobile devices like an iPad Mini.
Datasets
The study utilized several custom-compiled dataset splits covering 19 classes of baked goods:
- $D_{train}$ / $D_{test}$: 763 "deployment" images used for the fully supervised baseline and benchmarking.
- $C_{train}$: 315 single-class images used for the weakly supervised workflow.
- $V_{train}$ / $V_{test}$: 209 videos (approx. 6,000 frames) used for viewpoint robustness.
- $A_{test}$: A specific "Angle" test set with images captured from 0° to 80° to measure how well the model handles tilted perspectives.
Key Insights and Ideas
- Localization vs. Classification: Foundation models like Grounding DINO are excellent at finding where an object is (localization) but surprisingly poor at identifying specific German pastries (classification). By using single-class trays, the researchers decoupled these tasks, using the AI for the "where" and the tray's known identity for the "what."
- The SAM 2 Advantage: Using video tracking for annotation is a massive efficiency gain. By annotating just the first frame of a video and letting SAM 2 track the items as the camera moves, the researchers generated high-quality training data for "non-ideal" viewpoints with almost zero extra human effort.
- Surpassing the Baseline: Surprisingly, the model trained with limited supervision actually outperformed the fully supervised baseline when tested at challenging camera angles. This suggests that the diversity of data generated via pseudo-labeling is more valuable than the "perfect" accuracy of a smaller, manually annotated set.
Key Results
- High Accuracy: The weakly supervised model achieved a mean Average Precision (mAP) of 0.91, nearly matching the 0.98 of the fully supervised baseline on standard top-down views.
- Robustness Boost: Fine-tuning with video pseudo-labels improved performance by 19.3% under non-ideal deployment conditions (slanted angles).
- Speed: The YOLOv11x model achieved a latency of under 0.5 seconds per image on an iPad Mini 6, making it practical for real-time use in a busy bakery.
- Annotation Efficiency: The pseudo-labeling workflow reduced manual annotation costs by more than 96% for the video dataset.
Limitations and Future Work
- Single-Class Constraint: The initial data collection still requires a "clean" tray of a single product type, which is a minor but necessary disruption to a bakery's workflow.
- Extreme Angles: While robustness improved, performance still drops sharply once the camera angle exceeds 40°.
- Seasonal Variety: Some baked goods are seasonal; the authors noted that rare items (with as few as 12 examples) were harder for the model to master. Future work could explore using synthetic data (Generative AI) to fill these gaps for rare or seasonal products.
Summary updated