AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.68k stars 7.96k forks source link

Unexpected behaviour with translational symmetry #4282

Open pabloalcain opened 4 years ago

pabloalcain commented 4 years ago

Darknet unexpected behaviour: no translational symmetry when detecting.

What I did: Created a centered red square in a white image and a completely white image Labeled the red square Trained a network (yolov3 tiny modified for one class) Detect on red squares with white backgrounds in different positions

Some examples:

image Square in (222, 305): prob = 99%

image Square in (365, 124): prob = 19%

This behaviour was not entirely random. You can see here the detection probabilities depending on the position (lower than 25% was set to 0 as per default thresholding): image

image

As you can see, the network does catch information from the object (the obvious red mask), yet the results are very different depending on the position and with some sort of pattern. Further training reduces this issue, but does not mitigate it entirely.

AlexeyAB commented 4 years ago

Try to add scale_x_y = 1.1 to the each of 3 [yolo] layers in cfg-file and train again, will you get better results? https://github.com/AlexeyAB/darknet/issues/3293