공은찬 | 곽민구 | 김준섭 | 김진용 | 심용철 | 오재석 | 최현진 |
---|---|---|---|---|---|---|
Notion | TIL | Git | Blog | Notion | TIL | Devlog |
따라서 우리는 사진에서 쓰레기를 Segmentation하는 모델을 만들어 이러한 문제점을 해결해보고자 합니다. 문제 해경을 위한 데이터셋으로는 배경, 일반 쓰레기, 플라스틱, 종이, 유리 등 11종류의 쓰레기가 찍힌 사진 데이터셋이 제공됩니다.
- Linux version 4.4.0-59-generic
- Python >= 3.8.5
- PyTorch >= 1.7.1
- conda >= 4.9.2
- tensorboard >= 2.4.1
- CPU: Intel(R) Xeon(R) Gold 5220 CPU @ 2.20GHz
- GPU: Tesla V100-SXM2-32GB
팀구성 | 역할 |
---|---|
공은찬_T2009 | Custom loss, Optimizer 적용 |
곽민구_T2255 | Optimizer, Loss, Scheduler Test 진행 |
김준섭_T2056 | Segmentation Multi-label Stratified K-fold 구성 |
김진용_T2063 | Copy paste 데이터 셋 제작 |
심용철_T2122 | Model 탐색, Resize 및 weighted loss 실효성 검증 |
오재석_T2133 | Stratified K-fold 데이터셋 코드 틀 작성 |
최현진_T2234 | Baseline Code 작성, Pseudo Labeling, Oversampling |
- Segmentation task에서 데이터를 reasonable하게 train/val dataset을 나누기 위함
- 아래와 같이 각 이미지마다 3가지 label을 정의 후 Multi-label Stratified K-Fold로 데이터를 나눔
수가 적은 Class를 최대한 포함하기 위해 이미지마다 가장 적은 수에 해당하는 클래스를 이미지의 클래스로 정의
이미지당 Class의 수
이미지당 Annotation의 수
- 가장 성능이 좋은 모델의 inference 결과로 학습 데이터를 만들고 재학습
- Segmentation task 특성으로 점수 크게 향상(0.727 -> 0.75)
baseline/
├── train.py # main
├── trainer.py
├── dataset.py
├── test.py
├── utils.py
└── models/ # train model package
└── loss/ # loss metric package
└── scheduler/ # scheduler package
└── model
└── exp1/ # model file will save here
util/
├── oversampling.py
└── pseudo_labeling.py
copy_paste/
├─ check_copy_paste.ipynb
├─ copy_paste.py
├─ mask_convert_json.py
├─ get_coco_mask.py
├─ README.md
└─ requirements.txt
- Random Horizontal Flip
- Large Scale Jittering
- Copy-Paste
- Large patch to Small patch
- Small patch to Large patch
- Random Flip
./aug.sh
pip install -r requirements.txt
python get_coco_mask.py
--input_dir ../../input/data/
--split train_all
python copy_paste.py --input_dir ../../input/data/ --output_dir ../../input/data/
--patch ["Paper pack", "Battery", "Plastic", 'Clothing',"Glass" ]
--remove_patch ["Paper", "Plastic bag"]
--json_path train.json
--lsj True
--lsj_max 2
--lsj_min 0.2
--aug_num 1500
--extract_patch True
python mask_coco_mask.py
--main_json train.json
--mode add
python train.py \
--model UPlusPlus_Efficient_b5 \
--epochs 200 \
--loss FocalLoss \
--val_json kfold_0_val.json \
--train_json kfold_0_train.json \
--train_augmentation CustomTrainAugmentation \
--batch_size 5
python test.py python test.py --model_dir model/exp --model_name epoch10.pth --augmentation TestAugmentation
- reference here
exmple/