为什么 YoloV3 在测试中的检测率很差?



我训练YoloV3进行对象检测。 我训练达到平均召回率:批次中所有图像几乎为 1.0,平均 IOU 高于 0.9。 但是,当我使用未包含在训练中的图像(但它们与训练后的图像非常相似(进行测试时,检测阈值需要设置为 0.1。 但是使用训练中使用的图像进行测试,它们的检测率阈值可以设置为0.7。 在训练中可能出了什么问题或我需要改变什么? 我用于训练的 cfg 是

[net]
# Testing
#batch=1
#subdivisions=1
# Training
batch=16
subdivisions=8
height=416
width=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1
learning_rate=0.001
burn_in=1000
max_batches = 20000
policy=steps
steps=5000,10000
scales=.1,.1
[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

#######
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky
[route]
layers=-9
[convolutional]
batch_normalize=1
size=1
stride=1
pad=1
filters=64
activation=leaky
[reorg]
stride=2
[route]
layers=-1,-4
[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky
[convolutional]
size=1
stride=1
pad=1
filters=30
activation=linear

[region]
anchors =  2.00,1.24, 2.75,0.93, 2.84,1.75, 3.72,1.21, 4.63,1.59
bias_match=1
classes=1
coords=4
num=5
softmax=1
jitter=.3
rescore=1
object_scale=5
noobject_scale=1
class_scale=1
coord_scale=1
absolute=1
thresh = .6
random=1

我在将 Yolo 用于非方形图像时遇到了这样的问题。是你的情况吗? 在训练阶段,Yolo 将图像大小调整为所需的大小(即网络中的 416x416(:https://github.com/pjreddie/darknet/blob/master/src/data.c#L971 但在测试阶段,它会调整图像保留纵横比的大小,并为图像添加所需的边框:https://github.com/pjreddie/darknet/blob/master/examples/detector.c#L587(下面注释了具有哑大小调整大小的替代代码行(。当然,如果输入图像不是方形的,它们似乎与训练:)完全不同 我使用 https://github.com/AlexeyAB/darknet 叉,这个问题最近在那里得到了修复(https://github.com/AlexeyAB/darknet/commit/efaf684cb20b996db0cd6d99d20fabb4bc26859a(。但似乎,原来的Yolo仍然拥有它。 附言。虽然 Yolo 是一个很棒的工具,但它的代码有很多这样的东西,使用它时最好查看源代码和调试器:)

取消注释批处理 = 1 和细分 = 1 并注释最后一行:

# Testing
#batch=1
#subdivisions=1
# Training  
batch=16  
subdivisions=8

相关内容

  • 没有找到相关文章

最新更新