[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -1,66 +1,290 @@
|
||||
---
|
||||
id: wiki-2026-0508-cv-synthesis
|
||||
title: CV Synthesis
|
||||
title: Computer Vision Synthesis (Synthetic Data)
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AUTO-CVSY-001]
|
||||
aliases: [synthetic data, sim2real, domain adaptation, NVIDIA Omniverse, Unity Perception, model collapse]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.92
|
||||
tags: [auto-reinforced, cv-synthesis, Computer-Vision, Synthetic-Data, image-generation, computer-graphics]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [computer-vision, synthetic-data, sim2real, domain-adaptation, omniverse, unity, autonomous-driving, robotics]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: Python
|
||||
framework: NVIDIA Omniverse / Unity Perception / Blender / Diffusers
|
||||
---
|
||||
|
||||
# [[CV_Synthesis|CV_Synthesis]]
|
||||
# CV Synthesis (Synthetic Data)
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "가상의 눈을 위한 가상의 데이터: 실제 촬영 없이도 컴퓨터 그래픽스와 AI를 이용해 완벽하게 라벨링된 대규모 학습 데이터를 생성함으로써, 컴퓨터 비전 모델 개발의 높은 비용과 데이터 부족 문제를 해결하는 지능형 제조 공정."
|
||||
## 📌 한 줄 통찰
|
||||
> **"매 가상 의 image 의 학습 data"**. 매 perfect ground truth + 매 rare event + 매 privacy. 매 sim-to-real domain gap 의 핵심 challenge. 매 modern: 매 generative AI (Stable Diffusion) + 매 photoreal sim (Omniverse, Gaussian Splatting). 매 model collapse 의 risk.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
컴퓨터 비전 합성([[CV_Synthesis|CV Synthesis]])은 가상의 환경에서 인공적인 이미지나 비디오 데이터를 생성하여 모델을 학습시키는 기술입니다.
|
||||
## 📖 핵심
|
||||
|
||||
1. **필요성**:
|
||||
* **Perfect Ground Truth**: 합성 데이터는 객체의 위치, 각도, 픽셀 단위 마스크 정보를 오차 없이 자동으로 가짐.
|
||||
* **Rare [[Events|Events]]**: 도로 위 사고 상황 등 실제로 수집하기 어려운 희귀 사례([[Black-Swan|Black-Swan]])를 무한히 생성 가능. (Black-Swan과 연결)
|
||||
* **Privacy**: 실제 사람의 얼굴이나 번호판을 쓰지 않아도 되므로 개인정보 보호 이슈에서 자유로움.
|
||||
2. **핵심 기술**:
|
||||
* **Sim-to-Real**: 가상 세계(Simulator)와 실제 세계 간의 차이(Domain Gap)를 줄이기 위한 도메인 적응 기술.
|
||||
### 매 motivation
|
||||
1. **Perfect ground truth**: 매 pixel mask, 매 3D position, 매 depth, 매 segmentation 의 free.
|
||||
2. **Rare event**: 매 accident, 매 edge case 의 endless.
|
||||
3. **Privacy**: 매 face / plate 의 X.
|
||||
4. **Cost**: 매 real annotation $$$ 의 X.
|
||||
5. **Coverage**: 매 lighting / weather / pose 의 systematic.
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌**: 과거에는 합성 데이터가 너무 '가짜 티'가 나서 성능 저하를 유발한다는 정책적 우려가 컸으나, 현대 정책은 확산 모델(Diffusion)이나 렌더링 최적화(Gaussian Splatting)를 통한 '극사실주의 합성 데이터 정책'으로 성능 우위를 입증함(RL Update).
|
||||
- **정책 변화(RL Update)**: 합성 데이터에 의한 '모델 붕괴(Model Collapse)' 방지 정책이 중요해짐에 따라, 원본 데이터와 합성 데이터의 적절한 혼합 비율 정책과 데이터 다양성 증명 정책이 모델 개발의 필수 과정이 됨.
|
||||
### 매 source
|
||||
- **Game engine** (Unity, Unreal): 매 photoreal.
|
||||
- **Synthetic 3D pipeline** (Blender, Houdini).
|
||||
- **NVIDIA Omniverse**: 매 industrial digital twin.
|
||||
- **Diffusion model**: 매 prompt-based.
|
||||
- **GAN**: 매 specific domain (face, etc).
|
||||
- **Procedural generation**: 매 controllable.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Computer Vision|Computer Vision]], [[Black-Swan|Black-Swan]], [[Diffusion-Models|Diffusion-Models]], Simulation, [[Data Distillation (데이터 증류)|Data [[Distillation]] (데이터 증류)]]
|
||||
- **Modern Tech/Tools**: [[Unity|Unity]] Perception, NVIDIA Omniverse, Stable Diffusion, Blender.
|
||||
---
|
||||
### 매 응용
|
||||
1. **Autonomous driving**: 매 CARLA, 매 Waymo Carcraft.
|
||||
2. **Robotics**: 매 Isaac Sim, 매 sim2real.
|
||||
3. **Surveillance**: 매 person re-id.
|
||||
4. **Medical**: 매 augment rare condition.
|
||||
5. **Aerial**: 매 drone training.
|
||||
6. **Manufacturing**: 매 defect detection.
|
||||
7. **Retail**: 매 product variation.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### Sim-to-Real domain gap
|
||||
- **Visual gap**: 매 lighting / texture / shadow.
|
||||
- **Distribution gap**: 매 prevalence.
|
||||
- **Causal gap**: 매 dynamics / physics.
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
### 매 mitigation
|
||||
- **Domain randomization**: 매 random texture / lighting.
|
||||
- **Domain adaptation**: 매 GAN / CycleGAN.
|
||||
- **Photorealism push**: 매 ray tracing, Gaussian splatting.
|
||||
- **Hybrid training**: 매 real + synthetic.
|
||||
- **Self-supervised**: 매 unlabeled real.
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
### 매 Model Collapse (modern concern)
|
||||
- 매 synthetic data 만 의 train → 매 real distribution drift.
|
||||
- 매 generation 의 amplify own bias.
|
||||
- 매 mitigation: 매 fresh real 의 mix.
|
||||
- → Shumailov et al. 2024.
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
### 매 platform
|
||||
- **NVIDIA Omniverse / Replicator**: 매 enterprise.
|
||||
- **Unity Perception SDK**: 매 game-engine.
|
||||
- **Unreal MetaHuman**: 매 photoreal humans.
|
||||
- **Mitsuba 3**: 매 differentiable rendering.
|
||||
- **Kubric** (Google): 매 video synthesis.
|
||||
- **Habitat / iGibson**: 매 robot indoor.
|
||||
- **CARLA / AirSim**: 매 driving / drone.
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
### 매 generative augmentation
|
||||
- **Stable Diffusion**: 매 prompt-driven.
|
||||
- **ControlNet**: 매 layout-controlled.
|
||||
- **DreamBooth + LoRA**: 매 specific class.
|
||||
- **Inpainting**: 매 selective augment.
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
## 💻 패턴
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
### Unity Perception (label config)
|
||||
```csharp
|
||||
// 매 Unity Perception SDK
|
||||
using UnityEngine.Perception.GroundTruth;
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
[CreateAssetMenu]
|
||||
public class ProductLabelConfig : IdLabelConfig {}
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
// 매 Perception camera 의 attach
|
||||
// 매 RGB + bounding box + segmentation + depth 의 auto.
|
||||
```
|
||||
|
||||
### Domain randomization (Python)
|
||||
```python
|
||||
import random
|
||||
import bpy # 매 Blender API
|
||||
|
||||
def randomize_scene():
|
||||
# 매 light
|
||||
light = bpy.data.objects['Light']
|
||||
light.data.energy = random.uniform(500, 2000)
|
||||
light.location = (random.uniform(-5, 5), random.uniform(-5, 5), random.uniform(3, 10))
|
||||
|
||||
# 매 camera angle
|
||||
cam = bpy.data.objects['Camera']
|
||||
cam.rotation_euler = (random.uniform(0, 0.5), random.uniform(0, 0.5), random.uniform(0, 6.28))
|
||||
|
||||
# 매 background HDR
|
||||
world = bpy.data.worlds['World']
|
||||
hdri = random.choice(['hdri/sunset.exr', 'hdri/cloudy.exr', 'hdri/night.exr'])
|
||||
world.node_tree.nodes['Environment Texture'].image = bpy.data.images.load(hdri)
|
||||
|
||||
# 매 material color
|
||||
for obj in bpy.context.scene.objects:
|
||||
if obj.data and obj.data.materials:
|
||||
obj.data.materials[0].diffuse_color = (
|
||||
random.random(), random.random(), random.random(), 1
|
||||
)
|
||||
|
||||
# 매 1000 frame 의 render
|
||||
for i in range(1000):
|
||||
randomize_scene()
|
||||
bpy.context.scene.render.filepath = f'./synthetic/img_{i:04d}.png'
|
||||
bpy.ops.render.render(write_still=True)
|
||||
```
|
||||
|
||||
### NVIDIA Omniverse Replicator (Python)
|
||||
```python
|
||||
import omni.replicator.core as rep
|
||||
|
||||
with rep.new_layer():
|
||||
camera = rep.create.camera(position=(0, 0, 1000))
|
||||
light = rep.create.light(rotation=(-90, 0, 0), light_type='distant')
|
||||
|
||||
# 매 distractor objects
|
||||
distractors = rep.create.cube(count=20)
|
||||
|
||||
# 매 target object
|
||||
target = rep.create.sphere()
|
||||
|
||||
with rep.trigger.on_frame(num_frames=1000):
|
||||
with target:
|
||||
rep.modify.pose(
|
||||
position=rep.distribution.uniform((-200, -200, 0), (200, 200, 200)),
|
||||
rotation=rep.distribution.uniform((0, 0, 0), (360, 360, 360)),
|
||||
)
|
||||
with distractors:
|
||||
rep.randomizer.scatter_2d()
|
||||
with light:
|
||||
rep.modify.attribute('intensity', rep.distribution.uniform(500, 5000))
|
||||
|
||||
# 매 writer (RGB + bbox + mask)
|
||||
writer = rep.WriterRegistry.get('BasicWriter')
|
||||
writer.initialize(output_dir='./synthetic/', rgb=True, bbox=True, mask=True)
|
||||
writer.attach([rep.create.render_product(camera, (1024, 1024))])
|
||||
```
|
||||
|
||||
### CARLA driving sim
|
||||
```python
|
||||
import carla
|
||||
|
||||
client = carla.Client('localhost', 2000)
|
||||
world = client.get_world()
|
||||
|
||||
# 매 spawn vehicle + camera
|
||||
blueprint_library = world.get_blueprint_library()
|
||||
vehicle_bp = blueprint_library.filter('vehicle.tesla.model3')[0]
|
||||
spawn_point = world.get_map().get_spawn_points()[0]
|
||||
vehicle = world.spawn_actor(vehicle_bp, spawn_point)
|
||||
|
||||
camera_bp = blueprint_library.find('sensor.camera.rgb')
|
||||
camera_bp.set_attribute('image_size_x', '800')
|
||||
camera = world.spawn_actor(camera_bp, carla.Transform(carla.Location(x=2.5, z=1.0)), attach_to=vehicle)
|
||||
|
||||
# 매 listen
|
||||
camera.listen(lambda image: image.save_to_disk(f'./out/{image.frame:08d}.png'))
|
||||
|
||||
# 매 weather randomization
|
||||
weather = carla.WeatherParameters(cloudiness=80, precipitation=30, sun_altitude_angle=45)
|
||||
world.set_weather(weather)
|
||||
```
|
||||
|
||||
### Diffusion-based augmentation
|
||||
```python
|
||||
from diffusers import StableDiffusionInpaintPipeline
|
||||
import torch
|
||||
|
||||
pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
||||
'runwayml/stable-diffusion-inpainting', torch_dtype=torch.float16,
|
||||
).to('cuda')
|
||||
|
||||
# 매 existing image + 매 mask → 매 inpaint with new variation
|
||||
def augment_with_inpaint(image, mask, prompts):
|
||||
augmented = []
|
||||
for p in prompts:
|
||||
result = pipe(
|
||||
prompt=p,
|
||||
image=image,
|
||||
mask_image=mask,
|
||||
num_inference_steps=30,
|
||||
guidance_scale=7.5,
|
||||
).images[0]
|
||||
augmented.append(result)
|
||||
return augmented
|
||||
|
||||
# 매 e.g., medical scan 의 condition variation
|
||||
prompts = ['a benign tumor', 'a malignant tumor stage 1', '...']
|
||||
```
|
||||
|
||||
### Sim2Real domain adaptation (CycleGAN)
|
||||
```python
|
||||
# 매 sim → real domain
|
||||
from torch_cyclegan import CycleGAN
|
||||
|
||||
cyclegan = CycleGAN(
|
||||
generator_S2R=Generator(),
|
||||
generator_R2S=Generator(),
|
||||
discriminator_R=Discriminator(),
|
||||
discriminator_S=Discriminator(),
|
||||
)
|
||||
|
||||
# 매 sim image 의 real-style transfer
|
||||
real_styled = cyclegan.S2R(sim_image)
|
||||
# 매 train downstream model on (sim_label, real_styled).
|
||||
```
|
||||
|
||||
### Mix ratio (model collapse mitigation)
|
||||
```python
|
||||
def adaptive_mix(epoch, real_data, synthetic_data):
|
||||
"""매 early: synthetic 의 lots, late: real 의 emphasize."""
|
||||
real_ratio = min(0.7, 0.2 + epoch * 0.05)
|
||||
n_real = int(BATCH_SIZE * real_ratio)
|
||||
n_synth = BATCH_SIZE - n_real
|
||||
|
||||
return DataLoader(
|
||||
ConcatDataset([
|
||||
Subset(real_data, random.sample(range(len(real_data)), n_real)),
|
||||
Subset(synthetic_data, random.sample(range(len(synthetic_data)), n_synth)),
|
||||
]),
|
||||
batch_size=BATCH_SIZE,
|
||||
)
|
||||
```
|
||||
|
||||
## 🤔 결정 기준
|
||||
| 상황 | Tool |
|
||||
|---|---|
|
||||
| Driving | CARLA / Waymo Carcraft |
|
||||
| Robot indoor | Habitat / iGibson |
|
||||
| Industrial | NVIDIA Omniverse |
|
||||
| Bbox / segmentation | Unity Perception |
|
||||
| Photoreal humans | MetaHuman + Unreal |
|
||||
| Augmentation | Stable Diffusion + ControlNet |
|
||||
| Domain gap | CycleGAN / domain randomization |
|
||||
| Tabletop | Blender + scripted |
|
||||
|
||||
**기본값**: 매 photoreal + 매 domain randomization + 매 mix with real.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Computer-Vision]] · [[Synthetic-Data]] · [[Simulation]]
|
||||
- 변형: [[Sim2Real]] · [[Domain-Randomization]] · [[Domain-Adaptation]] · [[CycleGAN]]
|
||||
- 응용: [[Autonomous-Vehicles]] · [[Robotics]] · [[CARLA]] · [[Omniverse]] · [[Unity-Perception]]
|
||||
- Adjacent: [[Diffusion-Models]] · [[ControlNet]] · [[Model-Collapse]] · [[Algorithmic-Biology]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 data scarcity. 매 rare event. 매 privacy-sensitive. 매 cost reduction. 매 systematic coverage.
|
||||
**언제 X**: 매 real data abundant + cheap. 매 high domain-gap not addressed.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Synthetic 만 의 train**: 매 model collapse + sim2real gap.
|
||||
- **Single environment**: 매 over-fit.
|
||||
- **No domain randomization**: 매 unrealistic 학습.
|
||||
- **Generative 의 cycle (synth → train → gen → train)**: 매 collapse.
|
||||
- **No real validation**: 매 fake metric.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Tobin domain randomization 2017, Tremblay 2018, NVIDIA Omniverse).
|
||||
- 신뢰도 A.
|
||||
- Related: [[Autonomous-Vehicles]] · [[Diffusion-Models]] · [[Robotics]] · [[Algorithmic-Biology]] · [[Model-Collapse]].
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — sim2real + domain randomization + 매 Unity / Omniverse / CARLA / SD / CycleGAN code |
|
||||
|
||||
Reference in New Issue
Block a user