Research demo · open/synthetic data

Industrial NeRF Factory

TL;DR. The payoff: turn a handful of photos into unlimited auto-labeled training data. A from-scratch PyTorch NeRF (Instant-NGP-style hash encoding) reconstructs the part in 3D, then a physics-based defect-injection engine perturbs its density/color fields to synthesize scratches, cracks, dents, and contamination with automatic COCO labels — so downstream inspection AI trains on synthetic data without manual annotation. Built solo end-to-end across 7-8 integrated modules behind a FastAPI/Celery backend. Scope is stated up front: a personal R&D prototype on synthetic/open data, self-described as demo/research level and not deployed in any factory.
10,000 synthetic images per labeled dataset export
4 defect types scratch · crack · dent · contamination
COCO auto-labeled output no manual annotation
7-8 integrated modules NeRF core to sim-to-real
System Architecture
End-to-end pipeline architecture: multi-view data collection through from-scratch NeRF training, novel view synthesis, physics-based synthetic data generation, AI model training, to simulated sim-to-real transfer, with continuous-improvement feedback loops. (Robot control and SfM pose estimation are mock/prototype stages; no ROS 2 or real-robot deployment is wired in.)

Problem

Industrial AI models for manufacturing (e.g. robotic inspection and manipulation) need large, diverse, accurately-labeled training data, but capturing real-world data for every part, angle, lighting condition, and defect type is slow and expensive. The goal was to build a NeRF-based pipeline that reconstructs an industrial target in 3D from a set of multi-view camera images, then renders unlimited photorealistic novel views and physics-based synthetic defects (scratches, cracks, dents, contamination) so that downstream inspection/robotics AI can be trained on automatically-labeled synthetic data, plus a digital twin and domain-randomized simulation for sim-to-real robot training.

What I built

  • NeRF core, from scratch: implemented an Instant-NGP-style NeRF in PyTorch (multi-resolution hash encoding + tiny MLP, src/.../core/nerf_engine.py) with volume rendering and marching-cubes mesh export — reused by the acoustic and hyperspectral variants.
  • Synthetic-data pipeline: built a physics-based DefectInjectionEngine (scratch/crack/dent/contamination) and a SyntheticDataGenerator that produces labeled datasets (COCO export) for training inspection AI without manual annotation.
  • Solo developer of the full platform end-to-end (backend + ML): a modular architecture spanning NeRF synthetic data, digital twin, sim-to-real, and multimodal variants behind a FastAPI/Typer API+CLI (Celery/Redis, PostgreSQL, MinIO/S3, Docker, Prometheus/Grafana), with a 500+ test-function pytest suite across 31 files.

Design decisions

  1. Physics-based defect injection for automatically-labeled synthetic data

    Rather than capturing rare real defects, a DefectInjectionEngine modifies the trained NeRF's density/color fields to synthesize scratches, cracks, dents, and contamination, and SyntheticDataGenerator renders large labeled datasets (e.g. 10,000 images, COCO export) for inspection-AI training. This is the actual 'synthetic data' mechanism in the repo (more so than novel-view rendering alone).

    Pipeline: a trained NeRF density/color field, a DefectInjectionEngine that perturbs it to synthesize scratch/crack/dent/contamination, and a SyntheticDataGenerator that exports auto-labeled images (COCO).
    The differentiator: rather than capture rare real defects, the DefectInjectionEngine perturbs the trained NeRF density/color fields to synthesize scratches, cracks, dents, and contamination, then exports automatically-labeled training data (COCO).
  2. Implement an Instant-NGP-style NeRF from scratch in PyTorch instead of binding the native CUDA library

    The NeRF core (src/industrial_nerf_factory/core/nerf_engine.py) implements multi-resolution hash encoding (MultiResHashEncoding) plus a small MLP in the style of Instant-NGP, with a docstring fast-training goal of <5 min (an aspirational target, not a measured benchmark). This same encoding is reused by the acoustic and hyperspectral NeRF variants. Nerfstudio and tiny-cuda-nn are listed as dependencies but are not imported in the source, and the native NVIDIA Instant-NGP CUDA library is not wired in; the implementation is the project's own from-scratch PyTorch reimplementation.

  3. Camera pose estimation: COLMAP is referenced as the intended production path but not integrated

    Camera poses can be supplied directly to the NeRF engine; where poses are missing (e.g. plant_nerf), the code generates a mock circular trajectory and explicitly notes 'For production use, integrate with COLMAP or OpenCV SfM' (src/.../agriculture/plant_nerf.py). COLMAP-based pose estimation is documented as future work, not implemented; the pipeline currently relies on supplied poses or a synthetic circular trajectory.

  4. Domain randomization for sim-to-real robot training

    The sim-to-real approach is visual + physics domain randomization (src/.../robotics/domain_randomization.py) wrapping a Gymnasium NeRF environment, with PPO policy training and a success-rate evaluation computed over simulated episodes. The robot's NeRF rendering is a mock stub (returns random RGB/depth), so transfer is not validated on hardware and no real sim-to-real success rate is measured; the technique implemented is domain randomization, not a separate learned domain-adaptation method.

    Sim-to-Real Transfer Comparison
    Side-by-side comparison illustrating the sim-to-real concept: synthetic renderings generated from the digital twin alongside reference captures, highlighting the visual + physics domain-randomization technique used to bridge the simulation gap. Transfer is evaluated in simulation only; no real-robot deployment or measured degradation is shown.
  5. FastAPI + Celery/Redis service architecture (not Ray/gRPC)

    The backend is a FastAPI REST API with a Celery/Redis task queue, SQLAlchemy + PostgreSQL, and MinIO/S3 storage, containerized via Docker/docker-compose with Prometheus + Grafana monitoring scaffolding. ray[tune] is a dependency for hyperparameter search, but there is no Ray distributed-cluster training and no gRPC anywhere in the code; the architecture is single-node, not a distributed training cluster.

  6. Multimodal NeRF variants: acoustic and hyperspectral

    Beyond RGB NeRF, the platform extends the radiance field to predict sound intensity (AcousticNeRF, for 3D sound-source localization and predictive maintenance) and 128-band spectra (HyperspectralNeRF, 400-1000nm, for material-level QC), reusing the shared hash encoding. These are framed as novel research directions.

  7. Quality metric capture is scaffolded, not measured

    The data model stores a nullable best_psnr field, and the platform is intended to evaluate rendering quality; however SSIM and LPIPS are not computed anywhere in the source and no PSNR/SSIM/LPIPS values are committed. Rendering-quality metrics are scaffolded for storage only, not measured; no fidelity numbers are claimed.

In operation

Training Pipeline Architecture
Comprehensive visualization of the NeRF training pipeline architecture, illustrating the data flow from raw multi-view images through neural network training to final 3D scene reconstruction. The pipeline incorporates positional encoding, ray marching, and volume rendering stages for photorealistic novel view synthesis.
Rendering Quality Comparison
Conceptual quality comparison across NeRF configurations and resolutions, illustrating the rendering-speed vs. visual-fidelity trade-off for inspection use. PSNR storage is scaffolded in the data model; SSIM/LPIPS are not implemented and no measured metric values are committed.
Multi-View Camera Input Grid
Grid visualization of the multi-view camera inputs used for NeRF training. Each image captures the target from a different angle, providing coverage for 3D reconstruction with consistent lighting and supplied camera poses. The per-target view count is a runtime input, not a fixed constant.
Novel View Synthesis Results
Gallery of novel view synthesis results from the trained NeRF model, rendering photorealistic images from arbitrary camera positions not present in the training set and enabling unlimited synthetic data generation for downstream AI model training.

Engineering foothold

ClaimEvidence
Sim-to-real success rate is computed in simulation only, not measured on real hardwareThe code computes success_rate = n_success / n_episodes over simulated episodes (rl_trainer.py / sim_to_real.py) with a mock NeRF renderer; there is no real-robot measurement. The '>95%' figure in the README Key Features table and sim_to_real.py docstring is an aspirational target, not a measured result, and is not claimed here.
Multi-view image inputs drive NeRF training (per-target view count is supplied at runtime, not a fixed constant)The NeRF engine consumes a set of multi-view images with camera poses; there is no fixed '36'-viewpoint constant anywhere in the source, so no specific viewpoint count is claimed.
~14k LOC of core platform source (~23k including tests/scripts)src/ = 14,256 LOC across 34 .py files; whole repo = 23,079 LOC (find . -name '*.py' | xargs wc -l). The README/badges/citation '15,704 lines' figure is a stale self-reported sum and does not match the current tree.
500+ test functions across 31 test filesCurrent suite has 511 test functions (grep -rE 'def test_' tests/ | wc -l) across 31 test files. (README/badges say '157 tests' and an older TEST_ANALYSIS_REPORT.md counted '114+' — both stale snapshots.) No committed pytest run/coverage report exists, so the count is a static collection figure, not a pass-status figure.
End-to-end pipeline is architected and demo-runnable, not a validated production deploymentArchitecture/README describe a full data-collection -> NeRF -> synthetic-data -> training -> deployment flow, and modules exist for each stage. The validation reports (ULTRATHINK_VALIDATION_REPORT.md, COMPREHENSIVE_CODE_VALIDATION_REPORT.md) rate it 'demo/research level' (데모 가능 / 프로덕션 불가) with 5 unfixed Critical issues and mock stages (robot NeRF render, SfM pose estimation).
Novel view synthesis from arbitrary unseen camera positionsThe NeRF engine supports rendering novel views from arbitrary poses (nerf_engine.render), the core capability of NeRF. No committed quantitative fidelity (PSNR/SSIM/LPIPS) exists for the rendered views, so the capability is claimed structurally, not with a measured photorealism score.
Rendering-quality metric storage is scaffolded (best_psnr field), but SSIM/LPIPS are not implemented and no values are measuredOnly best_psnr (a nullable DB column) exists; SSIM and LPIPS are not computed anywhere in src, and no metric values are committed. PSNR is scaffolded for storage; SSIM/LPIPS are not implemented and no measured fidelity values exist, so none are claimed.
Physics-based synthetic defect generation with automatic labelsDefectInjectionEngine implements scratch/crack/dent/contamination by modifying NeRF density/color, and SyntheticDataGenerator.generate_dataset produces labeled images (COCO export). Verified in src/.../core/defect_injection.py and core/synthetic_data.py and README usage examples.

Tech stack

3D Reconstruction / NeRF
NeRF (custom PyTorch), Instant-NGP-style hash encoding, PyTorch, Open3D / Trimesh, scikit-image (marching cubes)
Synthetic Data / Vision
Physics-based defect injection, OpenCV / Kornia, COCO-format dataset export, Albumentations
Robotics / Sim-to-Real
Gymnasium, PPO (Stable-Baselines3), Visual + physics domain randomization
Multimodal NeRF
Acoustic NeRF (librosa / pyroomacoustics), Hyperspectral NeRF (128 bands)
Backend / Infrastructure
FastAPI, Celery + Redis, SQLAlchemy + PostgreSQL, Alembic, MinIO / S3, Docker / docker-compose, Prometheus + Grafana
Quality Metrics
PSNR (stored field, scaffolded)

← All projects