paper: https://arxiv.org/abs/2004.10934
github: https://github.com/AlexeyAB/darknet
感谢AlexeyAB大神分享
[net]
batch=64 # batch size
subdivisions=8 # batch size 细分,训练中每次推理batch/subdivisions(64/8)幅图片,计算loss时使用batch(64)幅累加
#width=512
#height=512
width=608 # 输入图片统一尺寸为608 *608 *3
height=608
channels=3
momentum=0.949 # 动量 加速学习,特别是处理高曲率、小但一致的梯度,或是带噪声的梯度。动量算法累计之前梯度指数级衰减的移动平均,并且继续沿着该方向移动。详细公式请见《花书》第8章第三节
decay=0.0005 # 权重衰减正则项,防止过拟合
angle=0 # 旋转角度,数据增强参数
saturation = 1.5 # 数据增强参数HSV彩色模型:饱和度
exposure = 1.5 # 曝光度
hue=.1 # 色调
learning_rate=0.0013 # 学习率 ,学习率设置机制:https://zhuanlan.zhihu.com/p/28893986
burn_in=1000 # 迭代次数>burn_in*3时,使用policy策略
max_batches = 500500 # 最大迭代次数
policy=steps # 学习率调整策略:CONSTANT, STEP, EXP, POLY, STEPS, SIG, RANDOM, SGDR
steps=400000,450000
scales=.1,.1 # steps 和scales为学习率调整策略参数。当迭代到400000次时,学习率衰减10倍;当迭代到450000次时,学习率再衰减10倍
#cutmix=1 #是否使用cutmix数据增强
mosaic=1 # 是否使用mosaic数据增强
#:104x104 54:52x52 85:26x26 104:13x13 for 416
[convolutional]
batch_normalize=1 #使用batch_normalize
filters=32 #卷积核输出通道32,此层输入尺寸=608×608×3,输出尺寸=608×608×32,总共参数=333*32
size=3 #卷积核尺寸,3×3
stride=1 #卷积步长1
pad=1 # 边界填充1
activation=mish # 激活函数
[convolutional]
batch_normalize=1
filters=64
size=3
stride=2
pad=1
activation=mish
[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=mish
[route]
layers = -2
[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=mish
[convolutional]
batch_normalize=1
filters=32
size=1
stride=1
pad=1
activation=mish
[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=mish
[shortcut] # add层
from=-3
activation=linear
[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=mish
[route] # 等于常说的cancat层
layers = -1,-7
[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=mish
…
…
…
##########################
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
[maxpool]
stride=1
size=5
[route]
layers=-2
[maxpool]
stride=1
size=9
[route]
layers=-4
[maxpool]
stride=1
size=13
[route]
layers=-1,-3,-5,-6
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[upsample]
stride=2
[route]
layers = 85
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[route]
layers = -1, -3
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky
[upsample]
stride=2
[route]
layers = 54
[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky
[route]
layers = -1, -3
[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=256
activation=leaky
[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=256
activation=leaky
[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky
##########################
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=256
activation=leaky
[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear
[yolo]
mask = 0,1,2 # 使用anchor的索引,0,1,2表示使用下面定义的anchors中的前三对anchors
anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401
classes=80 # 类别数目
num=9 # anchors对数
jitter=.3 # 数据增强手段,缩放抖动系数,对原始图片进行宽高方向上的插值缩放(两方向上缩放系数不一定相同)
ignore_thresh = .7 # iou>ignore_thresh认为是正样本
truth_thresh = 1 # 真实框的iou值
scale_x_y = 1.2 # 为加快收敛,在anchor->预测框过程中,将中心点偏移范围0-1,映射到-0.1-1.1
iou_thresh=0.213 # 如果某个真实框和某个anchor的iou大于此阈值,则这个anchor负责预测这个真是框
cls_normalizer=1.0 # 计算分类损失的正则化系数,计算分类梯度时的衰减系数
iou_normalizer=0.07 # 计算边界回归损失的正则化系数,计算边界回归梯度时的衰减系数
iou_loss=ciou # 边界框回归损失函数,支持: MSE, IOU Loss, GIOU Loss, DIOU Loss, CIOU Loss.
nms_kind=greedynms # nms种类,支持:CORNERS_NMS,GREEDY_NMS,DIOU_NMS
beta_nms=0.6 # diou_nms 超参
max_delta=5 # 在iou loss 不是MSE时(iou loss: IOU, GIOU, MSE, DIOU, CIOU),dx, dy, dh, dw的取值范围[-max_delta, max_delta]
[route]
layers = -4
[convolutional]
batch_normalize=1
size=3
stride=2
pad=1
filters=256
activation=leaky
[route]
layers = -1, -16
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky
[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear
[yolo]
mask = 3,4,5
anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401
classes=80
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
scale_x_y = 1.1
iou_thresh=0.213
cls_normalizer=1.0
iou_normalizer=0.07
iou_loss=ciou
nms_kind=greedynms
beta_nms=0.6
max_delta=5
[route]
layers = -4
[convolutional]
batch_normalize=1
size=3
stride=2
pad=1
filters=512
activation=leaky
[route]
layers = -1, -37
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky
[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear
[yolo]
mask = 6,7,8
anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401
classes=80
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1 # 是否使用随机多尺度训练
scale_x_y = 1.05
iou_thresh=0.213
cls_normalizer=1.0
iou_normalizer=0.07
iou_loss=ciou
nms_kind=greedynms
beta_nms=0.6
max_delta=5