I am currently working on a wood defects object detector for my bachelor thesis project in construction engineering, in which it detects defects such as knots and splits, and measures its dimensions form the sizes of the detected bounding boxes. I am trying to implement that on Mathematica using a YOLO neural network, I have the dataset with its annotation, and exported it into Mathematica, and I was able to modify the output size of the YOLO V2 model to match the number of classes and anchor boxes that I have. I chose YOLO V2 since it is the only YOLO model that have a construction notebook uploaded, and I was able to modify the model layers parameter to match my intended result. However, I am currently at the loss function construction stage for the training procedure, and I am not able to find any online resources on how such a function can be constructed on Mathematica. I attached the notebook for what i reached so far, and I would appreciate any help on how to build the loss function and to train the net on my dataset.