License YOLO
Integrations

Ultralytics YOLO and NVIDIA Cosmos Data Factory: Synthetic data for defect detection

NVIDIA Cosmos Data Factory synthetic data and an agentic training loop help Ultralytics YOLO26 match full-dataset defect detection accuracy with fewer labels.

Manuel CalvéManuel Calvé11 min read

Listen to this article

NVIDIA Cosmos Data Factory synthetic data and an agentic training loop help Ultralytics YOLO26 match full-dataset defect detection accuracy with fewer labels.

Ultralytics and NVIDIA have partnered to show what targeted training data can do for Ultralytics YOLO. NVIDIA’s agentic data-enhanced training loop identifies the images a model needs, NVIDIA Cosmos Data Factory generates the ones that don’t exist yet, and Ultralytics YOLO is the model trained on the result. Our machine learning (ML) team put the combination through 19 public industrial-inspection benchmarks, comparing Ultralytics YOLO26 trained with NVIDIA’s agentic pipeline and Cosmos Data Factory synthetic data against the same model trained the conventional way. This post shares the results.

More data isn't the answer. The right data is.#

Every inspection team knows the pattern. A defect-detection model performs well on the defects it has seen many times, then misses the rare scratch, the unusual lighting, or the odd camera angle that matters most on the production line. The usual fix is to collect and label more of everything, which is slow, expensive, and mostly adds images the model already handles well.

Automated agentic training powered by NVIDIA takes a different approach: it finds the specific weak spots in a dataset and patches them, with real images that already exist or with synthetic ones from Cosmos Data Factory where real examples don’t. Paired with Ultralytics YOLO, that means a model that is trained on exactly the data it's missing.

How does NVIDIA’s data-enhanced training loop work?#

NVIDIA’s agentic data-enhanced training loop for Ultralytics YOLO is a model-improvement pipeline that wraps the training loop and decides what data the model needs next:

  • Mines real data. It searches existing image pools for real examples that fill specific gaps in the training set.
  • Generates synthetic data. Where real examples don't exist, it generates edge-case images with Cosmos Data Factory.
  • Labels automatically. A component called AnomalyGen labels the synthetic images, so no manual annotation is needed before retraining.

The guiding idea is targeted data over data efficiency. The goal isn't simply to train on less data. It's to precisely fill the gaps in a dataset where the model is weak, by mining or by generating, and retraining on that enriched set. Training on fewer images is often a side effect of doing this well, as the results below show.

The pipeline has been benchmarked in depth with Ultralytics YOLO, and every result in this article uses Ultralytics YOLO26.

Where NVIDIA Cosmos Data Factory fits#

Cosmos Data Factory is NVIDIA's data curation, processing, and generation platform, built on its Cosmos world models. Within the agentic training loop, its job is to generate images for scenarios a real dataset doesn’t cover well, such as specific defect types in manufacturing or fisheye-lens distortion in transportation footage.

The hand-off is simple. Cosmos generates the edge-case imagery, AnomalyGen labels it, and Ultralytics YOLO is retrained on the combined real and synthetic set using the standard Ultralytics training pipeline.

Putting Cosmos Data Factory to the test on 19 public datasets#

To see how far Cosmos Data Factory + Ultralytics YOLO can go, our ML team ran the agentic data-enhanced fine-tuning pipeline on 19 public industrial inspection datasets covering steel, PCBs, fabric, metal surfaces, and consumer products, about 91,000 training images in total. Every run used one 8-GPU host.

The comparison is deliberately strict. The baseline and the Cosmos Data Factory model were trained with an identical recipe: Ultralytics YOLO26x, 100 epochs, the same optimizer, learning rate, and seed, and both were scored on the same held-out test set. The only difference is which images each model trained on. The baseline trains on every labeled image (and, for the synthetic-data test, real images only).

1. The same accuracy on a fraction of the labels#

On 11 of the 19 datasets, Ultralytics YOLO26x trained with the agentic pipeline matched the same model trained on the full dataset. Across those 11, 53% of the labeled images were never needed.

datasetlabeledusednot neededmAP50 fullmAP50 curated
dagm class 11,0359091%0.99230.9998
dagm class 21,0359091%1.00000.9999
dagm class 31,0359091%1.00000.9987
dagm class 41,0359091%1.00000.9991
dagm class 72,07018091%1.00000.9995
dagm class 82,07017891%0.99911.0000
dagm class 92,07018091%1.00000.9992
dagm class 102,07018091%1.00001.0000
pcb-defect20,92413,90334%0.99000.9893
hripcb55941426%0.98910.9754
deeppcb1,00090010%0.98870.9885

Table 1. Datasets where Cosmos Data Factory matched the full-data model. mAP50 on the same held-out set.

On the DAGM datasets, the agentic pipeline reached the same mAP50 on a tenth of the labels, and on two classes it finished slightly ahead of the full-data model. On pcb-defect, it dropped 7,000 of 20,924 images for an accuracy difference four times smaller than run-to-run noise.

For teams paying for annotation, this is the headline: most of the labeling budget on these datasets went into images that didn't change the result.

2. Training up to 74% faster#

Bar chart of training time on the full dataset vs. the Cosmos Data Factory subset

Figure 1. Training time, full dataset vs. Cosmos Data Factory subset, on the datasets where Cosmos Data Factory was faster.

Training Ultralytics YOLO on a smaller, targeted set also cuts compute. 10 of the 19 datasets trained faster with the agentic pipeline. On DAGM, training time dropped from 13–24 minutes to 4–7 minutes, a 69–74% reduction. The larger datasets saw smaller but real savings: 19% on VisA and 12% on metal-surface-defect.

The saving isn't universal. On the remaining nine datasets, the agentic pipeline took longer than a single full-data run, because each curated round retrains from scratch. Where the curated subset isn't much smaller than the original, those extra rounds outweigh the savings.

3. Generated defects sharpen the boxes#

Bar chart of mAP75 with real images only vs. with generated defects

Figure 2. mAP75 with real images only vs. with generated defects, on the datasets where synthesis was tested and helped.

The third test isolates synthetic data. On datasets with polygon annotations, we added defects generated with Cosmos Data Factory, labeled by AnomalyGen and compared the resulting Ultralytics YOLO model against one trained on real images only.

We report mAP75, a stricter metric than mAP50: a prediction counts only if its box reaches an intersection over union (IoU) of at least 0.75 with the true defect. It measures how precisely the model locates a defect, not just whether it finds it. Adding generated defects raised mAP75 by 0.11 to 0.32 on the DAGM classes, and recall improved on every dataset tested. The biggest jump was DAGM class 9, from 0.650 to 0.966. On Real-IAD, the gain was marginal (+0.008).

Defects are rare by nature, so real examples of a given defect type are always in short supply. Generating them, already labeled, lets Ultralytics YOLO learn a defect's exact shape and extent without anyone drawing a polygon.

How much synthetic data went in#

Each generation runs in three steps. Cosmos Data Factory first finds plausible defect locations on the real images (placed), the generator draws defect images at those locations (generated), and only up to a set limit enters the training set (kept). We tested two limits: synthetic images equal to 25% or 100% of the real images in the training set.

Across 18 generation rounds (9 baseline and 9 synthetic), the pipeline generated 11,448 images. Only 1,481 of those, about one in eight, were kept, so the limit decided how much synthetic data each Ultralytics YOLO model saw, not the generator's output. At the 100% limit, each training set held one synthetic image for every real one; at 25%, roughly one for every four. In absolute terms, the amounts are small: on DAGM, 90–180 real images plus at most the same number of synthetic ones.

datasetlimitplacedgeneratedblockedkeptrealratio
dagm class 125%870440022901 : 0.24
dagm class 1100%870400090901 : 1.00
dagm class 225%606254022901 : 0.24
dagm class 2100%606304090901 : 1.00
dagm class 325%900370022901 : 0.24
dagm class 3100%900370090901 : 1.00
dagm class 9100%1,80062001801801 : 1.00
realiad25%9,5344,44001937721 : 0.25
realiad100%9,5344,25007727721 : 1.00
Total11,44801,481

Table 2. Generated images and the real-to-synthetic ratio, from each run's generation and admission records.

What this means for teams building inspection models#

For teams already training Ultralytics YOLO, Cosmos Data Factory and automated agentic training powered by NVIDIA fit into the workflow they have and know: the same models, the same training recipe, with smarter data going in.

  • Cover the edge cases you can't collect. Auto-labeled synthetic defects help Ultralytics YOLO localize defects where real examples are scarce.
  • Spend the labeling budget where it counts. On over half the datasets tested, most labels were redundant. Targeted selection finds the images that matter.
  • Iterate faster. Smaller, curated training sets mean shorter Ultralytics YOLO training runs and quicker experiments on many datasets.

Availability#

The Cosmos-based synthetic generation step is currently available as a sample and demo, and isn't yet a shipped integration.

To try Cosmos Data Factory with your own Ultralytics YOLO models, get in touch with the Ultralytics team. We'll keep working with NVIDIA as the synthetic generation step moves toward a full integration.

Appendix: test setup and datasets#

All runs: Ultralytics YOLO26x, 100 epochs, identical optimizer, learning rate and seed for baseline and Cosmos Data Factory; one 8-GPU host; same held-out test set per dataset. The 11 datasets with polygon annotations can use generated defects. Each dataset in Table 3 links to its public copy on Ultralytics Platform, where you can browse the images and labels or clone it to train your own model.

datasettrain imagesannotationsource
dagm class 1, 2, 3, 41,035 eachpolygonDAGM 2007
dagm class 7, 8, 9, 102,070 eachpolygonDAGM 2007
pcb-defect20,924boxPCB defect
dspcbsd6,575boxDsPCBSD+
deeppcb1,000boxDeepPCB
hripcb559boxHRIPCB
metal-surface-defect11,845boxGC10-DET (+ NEU-DET)
tianchifabric10,332boxTianchi fabric
severstal10,061polygonSeverstal steel
mvtec-ad4,637boxMVTec AD
visa7,794polygonVisA
realiad-bottle-cap3,581polygonReal-IAD
crack1,290boxcrack segmentation

Table 3. The 19 datasets (DAGM counts as eight, one per class).

Written by

Manuel Calvé
Manuel Calvé

Head of Ecosystem and Partnerships · Ultralytics

Manuel Calvé is Head of Ecosystem and Partnerships at Ultralytics, where he leads its technology and industry partnerships, including its work with AMD and NVIDIA. Based in London, he previously managed global alliances at Canonical, the company behind Ubuntu, building its partnerships with global system integrators such as Accenture, Capgemini and Infosys, and went on to lead strategic alliances at SUSE and Conduktor. He holds a Master of Public Administration in Energy, Climate and Technology Policy from UCL and a Bachelor's degree in Business and Economics from the University of Basel.

Comments

Ask a question, share your results, or help someone else.

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Turn drone and aerial imagery into real-time insights for agriculture, aquaculture, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Apply computer vision in aerospace with Ultralytics YOLO for aircraft inspection, runway FOD detection, airport ground operations, and composite defect detection.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning