CAD Vision Model: Sim-to-Real Part Classification

A computer-vision research project in the Applied Systems Laboratory studying whether a classifier for mechanical CAD parts can be trained without ever seeing a real photograph of them.

Diagram: a classifier trained only on rendered CAD meshes, never on a real photo, is tested against real-world photos of the same parts; a classifier trained on real photos is tested on held-out real photos as a baseline.

The sim-to-real pipeline (bottom): CAD/STL meshes are rendered into ~46,680 domain-randomized synthetic images with no real photography involved, used to train a ResNet18 that is then tested against real-world photos it never saw. The baseline pipeline (top) trains and tests on real photos for comparison.

What it does.

  • Two independent ResNet18 pipelines classifying mechanical parts (bearings, bolts, brackets, bushings, collets, gaskets, grommets, screws, nuts, O-rings, and more) into 15 categories
  • Real-photo pipeline: trains directly on photographed parts — 100% top-1 accuracy on held-out real images
  • Synthetic-render pipeline: trains entirely on ~46,680 images rendered from STL/CAD meshes (24 domain-randomized viewpoints per part, varying camera angle, lighting, material, and background) — 99.89% top-1 / 99.98% top-3 accuracy on held-out synthetic test renders
  • The synthetic-trained model was then run against real-world photographs of the same parts to test sim-to-real transfer, using an inference pipeline with automatic foreground cropping and test-time augmentation built specifically for noisy, uncontrolled real photos
  • Two-phase fine-tuning on top of ImageNet-pretrained weights: a frozen-backbone warm-up on the classification head, followed by a full unfreeze with cosine-annealed learning rate decay

Why it matters. Photographing every part variant in an industrial catalog is slow and often incomplete. If a model trained purely on existing CAD geometry can generalize to real camera images, a new part can be added to a vision system the moment its CAD file exists — no photography required.

Stack. Python, PyTorch/torchvision, trimesh, pyrender (offscreen GPU rendering), scikit-learn metrics.

This is active lab research; the repository is private while the work is ongoing.