YOLOX icon indicating copy to clipboard operation
YOLOX copied to clipboard

Why does the object loss in yolox calculate the loss of all predictions?

Open iphonegirl opened this issue 3 years ago • 3 comments

I'm reading the source code of yolox , when I scan the code about loss computation,the reg loss and cls loss just cauculate the loss of predition which was selected by a series of strategies,but things going to be different in obj loss , I found the object loss contains the loss of all predictions,I really can't understand it ,can anybody explain it for me ? thanks very much !!

here is the code image

iphonegirl avatar May 24 '22 09:05 iphonegirl

Your issue is not quiet clear for me. In my opinion, cls and reg loss only care about foreground, but objectness affect both foreground area and background area, code here is intuitive.

FateScript avatar May 24 '22 12:05 FateScript

Your issue is not quiet clear for me. In my opinion, cls and reg loss only care about foreground, but objectness affect both foreground area and background area, code here is intuitive.

Why the obj loss is scaled by the number of foreground samples rather than the number of total samples? many thanks!

zye1996 avatar Jul 07 '22 06:07 zye1996

To make the loss more stable and your training process could be more smooth. If your like, you could alos use foreground ema value as scaled number. @zye1996

FateScript avatar Jul 07 '22 07:07 FateScript