YOLO v1 訓練背景知識

通常我們開始訓練以後,會看到 Terminal 當中出現一串串的訓練記錄,像這樣:

50: 1930.669922, 231.327698 avg, 0.002500 rate, 2.424220 seconds, 3200 images
Loaded: 0.000019 seconds
/home/aaron/projects/darknet/voc/VOCdevkit/VOC2012/JPEGImages/2008_005561.jpg
Detection Avg IOU: 0.000000, Pos Cat: -233.200256, All Cat: -54.901386, Pos Obj: -86.691528, Any Obj: -68.210297, count: 8
Detection Avg IOU: 0.000000, Pos Cat: -119.403282, All Cat: -48.066135, Pos Obj: 268.144257, Any Obj: -59.214031, count: 8
Detection Avg IOU: 0.000000, Pos Cat: 57.456070, All Cat: -26.749168, Pos Obj: 38.026318, Any Obj: -57.525066, count: 12
Detection Avg IOU: 0.000000, Pos Cat: 67.061951, All Cat: -48.290962, Pos Obj: -262.874481, Any Obj: -63.860405, count: 8

仔細一看,還真不知道在寫什麼東西。

不過,如果你的訓練記錄像上面這樣,出現許多 0 或負數,那就可以先停止訓練了,因為這代表這次的訓練 100% 會失敗。

我們先來看看這些數值代表的意義。跟據這條討論串的說明,我們可以知道:

  • Detection Avg IOU:Ground truth box 與 Predicted box 間 IOU 的平均 True positives;越靠近 1 越好,代表重疊部分越多。這裡有圖示說明。
  • Pos Cat:分類預測正確的平均;越靠近 1 越好,代表分類預測越準確。
  • All Cat:任何其他分類預測的平均;越靠近 0 越好,因為這是分類成其他類別的結果。
  • Pos Obj:在該網格 (Grid Cell) 中預測出物件的平均;越靠近 1 越好,代表正確地在某些網格中辨識出物品。
  • Any Obj:所有其他網格中預測出物件的平均;越靠近 0 越好,因為大多數的網格都不包含目標物。

所以

如果發現一開始訓練,就有奇怪的數值:

或是完全沒有抓取到特徵:

我們都應該趕緊停止訓練,並且更換 pre-train-weight 或是不使用 pre-train-weight 來訓練。

完美的訓練效果,應該要趨近於這樣的結果:

results matching ""

    No results matching ""