caiyuanhao1998 / Retinexformer

"Retinexformer: One-stage Retinex-based Transformer for Low-light Image Enhancement" (ICCV 2023) & (NTIRE 2024 Challenge)
https://arxiv.org/abs/2303.06705
MIT License
828 stars 64 forks source link

关于数据集的划分以及训练的配置的疑问 #64

Closed August-L-J closed 4 months ago

August-L-J commented 4 months ago

大佬你好,我有两个疑问,一个是关于数据集划分的疑问,一个是关于训练的的配置疑问

第一个疑问,关于数据集划分的

为啥按着这样的形式划分LOL_v1的数据集呢? 在LOLv1\Test\input文件夹中,有15张png图片 在LOLv1\Test\target文件夹中,有15张png图片 在LOLv1\Train\input文件夹中,有485张png图片 在LOLv1\Train\target文件夹中,有485张png图片 这样子划分数据集有什么科学依据么?有什么原理呢? 希望能够得到作者的解答

    |    |--LOLv1
    |    |    |--Train
    |    |    |    |--input
    |    |    |    |    |--100.png
    |    |    |    |    |--101.png
    |    |    |    |     ...
    |    |    |    |--target
    |    |    |    |    |--100.png
    |    |    |    |    |--101.png
    |    |    |    |     ...
    |    |    |--Test
    |    |    |    |--input
    |    |    |    |    |--111.png
    |    |    |    |    |--146.png
    |    |    |    |     ...
    |    |    |    |--target
    |    |    |    |    |--111.png
    |    |    |    |    |--146.png

第二个疑问,关于训练配置的问题

关于scheduler的配置,为什么要使用CosineAnnealingRestartCyclicLR算法而不是采用其他的算法呢?(periods: [46000, 104000]) 以及# Split 300k iterations into two cycles.,# 1st cycle: fixed 3e-4 LR for 92k iters.,# 2nd cycle: cosine annealing (3e-4 to 1e-6) for 208k iters.这些注释设置的科学性在哪呢?是通过什么公式计算的么? 为什么要采取这样的训练策略而不是其他的训练策略呢? 希望能够得到作者的解答

train:
  total_iter: 150000
  warmup_iter: -1 # no warm up
  use_grad_clip: true

  # Split 300k iterations into two cycles. 
  # 1st cycle: fixed 3e-4 LR for 92k iters. 
  # 2nd cycle: cosine annealing (3e-4 to 1e-6) for 208k iters.
  scheduler:
    type: CosineAnnealingRestartCyclicLR
    periods: [46000, 104000]       
    restart_weights: [1,1]
    eta_mins: [0.0003,0.000001]   

  mixing_augs:
    mixup: true
    mixup_beta: 1.2
    use_identity: true

  optim_g:
    type: Adam
    lr: !!float 2e-4
    # weight_decay: !!float 1e-4
    betas: [0.9, 0.999]

  # losses
  pixel_opt:
    type: L1Loss
    loss_weight: 1
    reduction: mean
caiyuanhao1998 commented 4 months ago

(1)你好,LOL v1 数据集是由这篇论文的作者划分的。说实话,485:15的比例确实不太合理,15张图片太少,可能与训练集的分布不一致,导致训练的模型性能呢不稳定。

(2)因为 CosineAnnealingRestartCyclicLR 比其他 lr scheduler 算法的效果更好。iteration的划分并不是通过什么计算得来的,就是调参。

如果觉得我们的repo和解答有用的话,帮我们点点star支持一下,感谢