Object Detection


I am trying to learn a model for object detection. The tutorial for setting up the datablock for this task is clear. However to setup the learner what loss function(s) to use. Further what metrics are suitable for this task?
As we are predicting both bounding box and labels the loss function should account for both classification accuracy and MSE error.

Presently the dataloaders show only

FlattenedLoss of BCEWithLogitsLoss()

as the loss_func

Any insights??

I think that currently, fastai isn’t suitable for object detection although it may change in the future. There are several posts about it. Some months ago, I tried to use fastai V2 for object detection and I stopped after hitting so many problems. There are nice libraries for object detection:

  1. IceVision is like fastai for object detection.
  2. MMDetection
  3. Detectron2

Regarding losses, you should start with Focal Loss.


Hi Victor,

Regarding Focal Loss. Have you tried extending Focal Loss to Multi-class by any chance?

Yes. Here is a link for kornia that implements Focal Loss for multiclass.