1 배경 / 목적
outputs/cosmos_datagen_ar_p3_init0_v2를 만든 Cosmos-Predict2 학습 설정을 추적하고,
최종 데이터셋용 crop+resize 전 원본(432×768 4-view tile)을 cosmos 학습 GT(480×832 tile)와
나란히 비교할 수 있게 만드는 것이 목적.
특히 실패한(제일 못한) 생성본을 찾는 것 — 어떤 task/조건에서 cosmos AR이 깨지는지 파악하여
데이터셋 품질 필터링 및 재생성 우선순위를 정하기 위함.
기존 한계: 생성 품질 평가가 육안 확인만이었고, 1440 ep 전체를 체계적으로 스코어링한 적 없었음.
어느 task가 AR에서 실패하는지, 실패 원인이 뭔지 불명확.
2 작업 내용
① 학습 Config 추적
생성 스크립트: scripts/run_cosmos_datagen_autoregressive.sh
체크포인트: 14b_groot_robocasa_mg30_real_480/checkpoints/model/iter_000047200.pt
실험 정의: cosmos_predict2/configs/base/experiment/groot.py:335
predict2_video2world_training_14b_groot_robocasa_mg30_480
실제 config: ckpt 디렉토리 config.yaml / stdout.log head에서 확인
② GT 매핑 확정
생성본: _episode__f0000_s_ar.mp4 (ep_idx 0–719)
매핑 경로:
ep_idx → source_mapping.json[ep_idx]['orig_demo_id']
→ GT = benchmark_train/robocasa_mg30/videos/_episode_.mp4
검증: ep_idx=0 → orig_demo_id=297, n_frames=402 일치. 24 task 전부 gen/GT 존재 확인
③ crop+resize 메커니즘 (어디서 손실 나는지)
scripts/build_synthetic_lerobot_v2_h50.py : split_and_process_tile():
생성 tile 432×768
→ quadrant 216×384 (top-L/R agentview, bot-L wrist, bot-R 검정)
→ center crop 216×216 (x_off=84, 좌우 84px ≈ 22%씩 제거)
→ 128×128 resize
"원본" 비교 = 이 crop+resize 적용 전 상태 (432×768 tile 그대로)
④ 신규 스크립트 2개
score_cosmos_failures.py — 1440 ep 실패 스코어링 (GT-free 지표):
GT-free 지표 (서로 다른 trajectory라 frame diff 무의미):
blur collapse: sharp_last / sharp_first (마지막 iter / 첫 iter Laplacian variance)
frozen: 후반 iter agentview motion
collapse: 후반 절대 sharpness
badness = 0.5 × blur_pct + 0.3 × frozen_pct + 0.2 × collapse_pct (percentile rank)
build_gt_vs_cosmos_compare.py — GT|Cosmos 나란히 mp4 생성:
--layout row (기본): 좌=GT / 우=Cosmos, 3-view 가로 한 줄, 위=GT / 아래=Cosmos
--time_mode sync (기본): GT 20fps / Cosmos 16fps → 진행률 0→100% 비례 lockstep 재생
--aspect 원본 wide 그대로: GT quad 240×416, gen quad 216×384, 공통 높이 240 스케일
--jobs_csv + --top_n: 스코어 CSV에서 worst N 렌더 (파일명 rank###_ prefix)
⑤ "stretch" 검증 (사용자 의심 → 반증)
의심: "생성본이 늘어난 것 / center-crop을 늘린 것 아니냐"
검증:
raw 디코딩 배열 = (279, 432, 768, 3) → 768×432 full 4-view tile 그대로 (128 아님)
frame0 PNG ≡ mp4 frame0 픽셀 완전 동일 (np.array_equal True)
seed(832×480 wide)로 조건 → frame0도 wide 전체 FOV
결론: center-crop 흔적 없음. 넓은 이유 = AR 생성이 aspect_ratio="16:9"(768:432)로
cosmos가 정사각 128 cam을 16:9 tile로 stretch해 학습 → 모델 출력 자체가 wide.
crop은 오직 build_synthetic_lerobot_v2_h50.py(128 데이터셋 빌드)에서만 발생.
3 결과
학습 Config 요약 (init0_v2 생성 모델)
| 항목 | 값 |
| 모델 | Cosmos-Predict2 14B video2world (DiT 36블록, ch5120, heads40) |
| 학습 방식 | Full FT (train_architecture=base) — LoRA 아님 |
| 초기화 | DROID pretrained (model-480p-16fps.pt) |
| 데이터 | robocasa_mg30 720ep (24×30), 4-view tile 480×832, 93f/clip, 16fps |
| Optimizer | AdamW lr=4.32e-5 (2-14.5), wd=0.1, betas=[0.9, 0.99] |
| Scheduler | LambdaLinear warmup=1000 cycle=100k fmax=0.2 fmin=0.1 |
| Batch | per-GPU 1 × 4 GPU = eff 4, workers=8 |
| Precision | bf16, grad_clip=1.0, EMA off, FSDP shard=4 cp=1 |
| 실제 Steps | max_iter=400k이나 47,200에서 종료 |
| 학습 시간 | ~7.0 s/iter × 47.4k → 4GPU 기준 ~369 GPU-h |
| 기간 | 2026-04-16 14:43 → 04-20 19:53 (≈4.2일, requeue 포함) |
실패 랭킹 (worst — badness 내림차순)
| rank | task | ep_idx | seed | blur_ratio | late_motion | badness |
| #1 | TurnOffStove | 577 | 0 | 0.64 | 0.94 | 0.990 |
| #2 | TurnOnSinkFaucet | 652 | 0 | 0.67 | 1.23 | 0.970 |
| #3 | TurnOffMicrowave | 510 | 1 | 0.71 | 1.02 | 0.970 |
| #4–30 | TurnOnSinkFaucet / TurnOnStove 계열 다수 | — | — | 0.63–0.74 | ~1.0–1.7 | 0.92–0.96 |
Best vs Worst 비교
| Task 유형 | blur_ratio | late_motion | badness | 평가 |
| TurnOff/TurnOn Stove/Faucet/Microwave | 0.63–0.71 | 0.94–1.7 | 0.92–0.99 | AR collapse (미세 동작) |
| OpenSingleDoor, PnP 계열 | 1.2–1.35 | 7–14 | 0.04–0.06 | 선명도 유지, 잘 생성 |
실패 패턴: 미세 articulated 동작 task (sink faucet, stove knob, microwave)에서 집중 실패.
AR 5-iter chaining 과정에서 작은 모션을 정지+blur로 collapse.
성공 패턴: 동적 task (door open, pick-place)는 선명도가 오히려 증가하며 잘 생성 — 모델이 큰 모션은 학습 잘 됨.
산출물
outputs/cosmos_datagen_ar_p3_init0_v2/
failure_scores.csv — 1440행 전체 스코어 (재정렬 가능)
gt_compare_worst/
rank000~029_*.mp4 — worst-30 비교 영상 (row, wide aspect, fps sync)
gt_compare_smoke_row/
_*.mp4 × 24 — task당 1개, row layout (형태 검수용)
gt_compare_smoke/
_*.mp4 × 24 — 초기 2×2 tile 버전 (보존)
4 Takeaway
의미
init0 데이터셋은 LoRA가 아닌 14B full-FT(DROID-init) 47.2k-step 모델 (~369 GPU-h)로 생성됨이 확인됐다.
단순 LoRA fine-tune이 아닌 full-FT임을 감안할 때 생성 품질의 baseline이 된다.
실패 모드가 task 종류와 강하게 상관된다 — 작은 articulated 동작에서 AR collapse.
데이터셋 품질 필터링 및 재생성 우선순위: TurnOff/TurnOn Stove/Faucet/Microwave를 먼저 타겟해야 함.
"stretch" 논란이 해소됨 — 생성본 자체는 full 432×768 tile이고, 16:9 wide 출력은 학습 tile 형태에서 비롯됨.
center-crop은 오직 128×128 LeRobot 데이터셋 빌드 단계에서만 발생.
5 Next Steps
hallucination 지표 보완
현재 badness는 blur/frozen 중심 → 고주파 노이즈 garbage(hallucination)는 못 잡음.
색/구조 drift 지표 추가 검토 (SSIM 변동, color histogram shift 등).
worst 육안 확인 후 스코어링 확장
worst-30 영상 육안 확인 후 형태 OK면 --top_n 늘려 전체 확장.
또는 task별 worst로 재집계하여 각 task의 대표 실패 케이스 추출 가능.
실패 task 재생성 검토
TurnOff/TurnOn Stove/Faucet/Microwave 계열 우선 재생성:
guidance 강화, num_iterations 증가, 또는 해당 task 학습 데이터 보강 검토.