AlexeyAB / darknet

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

Adding an additional element to loss function #8103

Closed smolendawid closed 3 years ago

smolendawid commented 3 years ago

Hi I'm working on object detection and I'm thinking about adding an additional element to the loss function, so that the loss function considers also the angle of the object in the image. I think it could make learning faster and I can easily extract this information from my data.

I am very new to the repository here and I would appreciate any hints, even simple ones, like where I could find the current loss function code, how should I modify the config so that every layer input-output works, etc. I'm just thinking about a simple loss where LOSS = L_ciou + L_conf + L_class + L_angle

I appreciate any comments Thanks

WongKinYiu commented 3 years ago

L_box https://github.com/AlexeyAB/darknet/blob/master/src/yolo_layer.c#L174

L_class https://github.com/AlexeyAB/darknet/blob/master/src/yolo_layer.c#L309

L_obj search delta[obj_index] in https://github.com/AlexeyAB/darknet/blob/master/src/yolo_layer.c#L389

smolendawid commented 3 years ago

Thanks for your suggestions!