Retrospectives Badge

Describe the bug

  • Wandb 용량 제약 100GB때문에 실험을 할 수 없는 현상 발생
  • You need to set the save_best parameter in your CheckpointHook config. For example like this in case of an evaluation based on COCO mAP:
default_hooks = dict(
    checkpoint=dict(
        type="CheckpointHook",
        save_best="coco/bbox_mAP",
        rule="greater"
    )
)

Take a look at the CheckpointHook documentation to learn more about different configurations.

To Reproduce

  • Config 파일 수정: configs 파일에서 checkpoint_config 항목 수정 cfg.checkpoint_config = dict(interval=1, save_best='bbox_mAP_50', save_last=True)

  • Wandb Artifacts로 모델 관리: Wandb의 Artifact 기능을 사용

    artifact = wandb.Artifact('best_model', type='model')
    artifact.add_file('path_to_best_model.pth')
    wandb.log_artifact(artifact)
    

Expected behavior

# 모델 훈련 시작 시 Wandb 초기화
wandb.init(
    project="Object Detection", 
    dir=experiment_dir,
    name=f'{model_name}_{random_code}',
    config=cfg._cfg_dict.to_dict()
)

모델 저장 및 Wandb 체크포인트 저장

cfg.checkpoint_config = dict(interval=1, save_best='bbox_mAP_50', save_last=True)

훈련 후 Wandb Artifacts로 체크포인트 저장

artifact = wandb.Artifact('best_model', type='model')
artifact.add_file(os.path.join(experiment_dir, 'best_model.pth'))
wandb.log_artifact(artifact)

Screenshots

  • 스크린샷 2024-10-11 오전 10 46 14

Additional context

  • MMDetection과 Wandb를 결합하여 최적의 모델만을 효율적으로 저장

Possible Solution

  • MMDetection과 Wandb를 결합하여 최적의 모델만을 효율적으로 저장

Inference

  • https://github.com/open-mmlab/mmdetection/issues/10662

Background

  • 큰 모델(teacher)에서 작은 모델(student)로 지식을 전이하여 모델 경량화나 추론 속도 개선을 이루면서도 성능을 유지하거나 향상시키는 기법
  • KD는 큰 모델의 성능을 작은 모델에 전이하기 때문에, student 모델이 경량화되어 더 빠른 추론 속도를 제공하면서도 성능 저하를 최소화
  • Object Detection에서, Feature-based KD나 Attention Transfer는 탐지 성능을 극대화할 수 있는 방법으로, student 모델이 더 중요한 시각적 정보를 학습하게 할 수 있음
  • Diffusion Denoising Implicit Models(DDIM)을 사용하여 이미지 내 다양한 객체를 생성
  • 새롭게 생성된 객체가 원본 이미지의 배경과 자연스럽게 결합되도록 하여, 현실적이고 이질감 없는 증강 이미지를 생성

Todo

  • Category Affinity Matrix
  • Surrounding Region Alignment
  • Instance-Level Filtering
  • Config 파일 수정
  • Stable Diffusion 적용

See also

  • https://arxiv.org/abs/2408.02891
  • Dataset Pipeline 수정: 카테고리 친화도 매트릭스를 사용하여 다양한 카테고리 간의 관계를 반영하려면 데이터 증강 파이프라인에서 이를 반영해야 합니다. MMDetection의 data 섹션에서 데이터 증강을 담당하는 부분에 새로운 증강 방식(친화도 기반 이미지 변환)을 추가
  • datasets/coco_detection.py 또는 관련 데이터셋 파일에서 데이터 로드 및 전처리 과정을 수정하여 카테고리 간 친화도 매트릭스를 반영