Class weights for balancing data in TensorFlow Object Detection API

前端 未结 2 1043
醉梦人生
醉梦人生 2020-12-29 13:07

I\'m fine-tuning SSD object detector using TensorFlow object detection API on Open Images Dataset. My training data contains imbalanced classes, e.g.

  1. top (5K i
2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-29 13:17

    The Object Detection API losses are defined in: https://github.com/tensorflow/models/blob/master/research/object_detection/core/losses.py

    In particular, the following loss classes have been implemented:

    Classification losses:

    1. WeightedSigmoidClassificationLoss
    2. SigmoidFocalClassificationLoss
    3. WeightedSoftmaxClassificationLoss
    4. WeightedSoftmaxClassificationAgainstLogitsLoss
    5. BootstrappedSigmoidClassificationLoss

    Localization losses:

    1. WeightedL2LocalizationLoss
    2. WeightedSmoothL1LocalizationLoss
    3. WeightedIOULocalizationLoss

    The weight parameters are used to balance anchors (prior boxes) and are of size [batch_size, num_anchors] in addition to hard negative mining. Alternatively, the focal loss down weighs well classified examples and focusses on the hard examples.

    The primary class imbalance is due to many more negative examples (bounding boxes without objects of interest) in comparison to very few positive examples (bounding boxes with object classes). That seems to be the reason why class imbalance within positive examples (i.e. unequal distribution of positive class labels) is not implemented as part of object detection losses.

提交回复
热议问题