- torch : 1.8.2+cu111
- torchvision : 0.9.2+cu111
- torchmetrics : 0.10.0
- numpy : 1.21.2
- wandb : 0.13.2
pip install -r requirements.txt
- Cifar100
- Use Superclass for Coarse label
- Use Classes for Fine label
python preprocess.py --dataset cifar100 --data_dir "data_dir" --types train,test
- Backbone : Wide_ResNet_50
- Coarse : Using WRN50 Backbone expcet for
layer4
- Fine : Using whole WRN50 Backbone
- Main Goal is training Fine Label Classification
- Concatenating Coarse feature and Fine feature
- Using
1x1conv
layer for matching channel after concatenating
- Simply Using Fc layer for Classifier
The following hyperparameters are not the best ones.
The model is still training.
train.py --epochs 15 --batch_size 32 --lr 0.008 --backbone wide_resnet_50 --wandb --sweep --sweep_count 5
python train.py --epochs 15 --batch_size 32 --lr 0.008 --backbone wide_resnet_50 --wandb --milestones 7,13
- If you want to train only_fine model, just add
--only_fine
above command
Default Hyperparameter Setting
optimizer
: SGD
batch_size
: 32
coarse
: 1
, fine
: 2
- setting different Loss Weight
- Coarse : Fine = 1 : 2
epochs
: 15
lr
: 8e-3
lr_scheduler
: ReduceLROnPlateau
- or you can use
MultiStepLR
with using milestones
argument
- Using
wandb.sweep
- Process
- Optimizing "only fine model" using
wandb.sweep
- batch_size :32
- epochs : 15
- lr : 0.0079
- milestones : [7, 12]
- Traning "coarse+fine model" using above hyper parameter
- Graph only fine vs. coarse+fine model
- Accuracy Comparison (max)
|
only_fine |
coarse+fine |
acc |
0.787 |
0.7832 |
- wandb report Link
- Find best parameter for Coarse+fine model
- coarse and fine loss weight
- lr
- etc..
- Change the layer to freeze on the Coarse Backbone
- Apply other dataset with hierarchical label
- Apply other Backbone
- Apply different feature synthesis instead of concatenating