PyTorch-YOLOv3
PyTorch-YOLOv3 copied to clipboard
cls accuracy does not change from 100%, is that normal?
Hello, I am training Yolo with Draknet backend on my costum dataset with only 1 class. I see that loss is decreasing, so training sounds to be working, but cls_acc remains intact, 100%. is that normal? In fact have another related question, what does exactly some of the metric mean? specifically what do conf, cls, cls_acc, conf_obj, and conf_noobj mean? what is their range and what is the good/bad score for them? Is there any source I can give it a read?
Many thanks in advance!
I attach a copy of the training output if it can be of any help for clarification: `---- [Epoch 0/100, Batch 0/17892] ---- +------------+--------------+--------------+--------------+ | Metrics | YOLO Layer 0 | YOLO Layer 1 | YOLO Layer 2 | +------------+--------------+--------------+--------------+ | grid_size | 12 | 24 | 48 | | loss | 89.802475 | 72.254868 | 75.289886 | | x | 0.088133 | 0.060701 | 0.091472 | | y | 0.172018 | 0.113565 | 0.166340 | | w | 2.094299 | 0.632194 | 0.246498 | | h | 2.478830 | 2.960152 | 0.277733 | | conf | 84.317696 | 67.701241 | 73.703987 | | cls | 0.651498 | 0.787016 | 0.803853 | | cls_acc | 100.00% | 100.00% | 100.00% | | recall50 | 0.000000 | 0.000000 | 0.000000 | | recall75 | 0.000000 | 0.000000 | 0.000000 | | precision | 0.000000 | 0.000000 | 0.000000 | | conf_obj | 0.687763 | 0.477680 | 0.463240 | | conf_noobj | 0.555994 | 0.483683 | 0.514767 | +------------+--------------+--------------+--------------+ Total loss 237.35
---- [Epoch 0/100, Batch 1/17892] ---- +------------+--------------+--------------+--------------+ | Metrics | YOLO Layer 0 | YOLO Layer 1 | YOLO Layer 2 | +------------+--------------+--------------+--------------+ | grid_size | 10 | 20 | 40 | | loss | 94.562836 | 73.290543 | 75.957161 | | x | 0.081261 | 0.042202 | 0.026371 | | y | 0.039539 | 0.073852 | 0.034955 | | w | 4.957320 | 1.388143 | 0.466023 | | h | 4.302971 | 3.603056 | 0.766496 | | conf | 84.460670 | 67.389290 | 73.942818 | | cls | 0.721081 | 0.793998 | 0.720499 | | cls_acc | 100.00% | 100.00% | 100.00% | | recall50 | 0.000000 | 0.250000 | 0.000000 | | recall75 | 0.000000 | 0.000000 | 0.000000 | | precision | 0.000000 | 0.000515 | 0.000000 | | conf_obj | 0.582077 | 0.544008 | 0.467908 | | conf_noobj | 0.555174 | 0.482735 | 0.515936 | +------------+--------------+--------------+--------------+ Total loss 243.81
---- [Epoch 0/100, Batch 2/17892] ---- +------------+--------------+--------------+--------------+ | Metrics | YOLO Layer 0 | YOLO Layer 1 | YOLO Layer 2 | +------------+--------------+--------------+--------------+ | grid_size | 11 | 22 | 44 | | loss | 73.605385 | 63.372581 | 71.214027 | | x | 0.144750 | 0.042110 | 0.050654 | | y | 0.096979 | 0.149345 | 0.125947 | | w | 5.480806 | 0.255100 | 0.413815 | | h | 1.205167 | 0.451985 | 0.302725 | | conf | 66.009125 | 61.935760 | 69.627342 | | cls | 0.668553 | 0.538281 | 0.693540 | | cls_acc | 100.00% | 100.00% | 100.00% | | recall50 | 0.000000 | 0.250000 | 0.000000 | | recall75 | 0.000000 | 0.000000 | 0.000000 | | precision | 0.000000 | 0.001033 | 0.000000 | | conf_obj | 0.493795 | 0.430927 | 0.465525 | | conf_noobj | 0.467110 | 0.444496 | 0.494032 | +------------+--------------+--------------+--------------+ Total loss 208.19
---- [Epoch 0/100, Batch 3/17892] ---- +------------+--------------+--------------+--------------+ | Metrics | YOLO Layer 0 | YOLO Layer 1 | YOLO Layer 2 | +------------+--------------+--------------+--------------+ | grid_size | 14 | 28 | 56 | | loss | 74.515106 | 65.952492 | 71.696716 | | x | 0.015829 | 0.011734 | 0.084050 | | y | 0.124274 | 0.045050 | 0.128698 | | w | 5.969457 | 0.805450 | 0.136586 | | h | 1.520593 | 2.432864 | 1.158610 | | conf | 66.384216 | 62.035343 | 69.648407 | | cls | 0.500741 | 0.622048 | 0.540366 | | cls_acc | 100.00% | 100.00% | 100.00% | | recall50 | 0.000000 | 0.000000 | 0.250000 | | recall75 | 0.000000 | 0.000000 | 0.000000 | | precision | 0.000000 | 0.000000 | 0.000048 | | conf_obj | 0.509221 | 0.442796 | 0.546905 | | conf_noobj | 0.470102 | 0.445486 | 0.494937 | +------------+--------------+--------------+--------------+ Total loss 212.16
---- [Epoch 0/100, Batch 4/17892] ---- +------------+--------------+--------------+--------------+ | Metrics | YOLO Layer 0 | YOLO Layer 1 | YOLO Layer 2 | +------------+--------------+--------------+--------------+ | grid_size | 12 | 24 | 48 | | loss | 71.450768 | 59.946552 | 66.792786 | | x | 0.051978 | 0.068346 | 0.030721 | | y | 0.131083 | 0.038508 | 0.184411 | | w | 8.075194 | 1.866672 | 0.301755 | | h | 6.524155 | 0.942213 | 0.523325 | | conf | 56.443550 | 56.779175 | 65.540833 | | cls | 0.224810 | 0.251641 | 0.211739 | | cls_acc | 100.00% | 100.00% | 100.00% | | recall50 | 0.000000 | 0.500000 | 0.000000 | | recall75 | 0.000000 | 0.000000 | 0.000000 | | precision | 0.000000 | 0.002068 | 0.000000 | | conf_obj | 0.742609 | 0.608187 | 0.332132 | | conf_noobj | 0.385419 | 0.419219 | 0.472041 | +------------+--------------+--------------+--------------+ Total loss 198.19 `
YOLO works by: proposing bounding boxes, determining if an object is in the box, then classifying the object in the box.
Class accuracy is accuracy of class prediction given that an object is present in the box, so 100% accuracy is the only possible score for your example.
conf, conf_obj, conf_noobj are going to be the measures of how the model does at identifying if an object is present in the bounding box. I don't recall how they are defined respectively.
As I understand it cls_acc computes the percentage of the objects of a class identified as that specific class. In other words, it only decreases if an object of class 'a' is identified as being an object of class 'b'. In your case, since you have only one class, it is impossible to assing a detection to another class and so cls_acc is always 100%.
But can someone explain me, why is the conf, conf_obj and conf_noobj decreasing on training further? I am working on something similar to this, it has only 1 class. And also why is precision and recall almost 0?
But can someone explain me, why is the conf, conf_obj and conf_noobj decreasing on training further? I am working on something similar to this, it has only 1 class. And also why is precision and recall almost 0?
Did you load the pretrained parameters or did you start from scratch? When I started direct training from scratch, I met almost the same results as you.