title: Class weights for balancing data in TensorFlow Object Detection API
body: <p>I'm fine-tuning <a href="https://arxiv.org/pdf/1512.02325.pdf" rel="noreferrer">SSD</a> object detector using <a href="https://github.com/tensorflow/models/tree/master/research/object_detection" rel="noreferrer">TensorFlow object detection API</a> on <a href="https://storage.googleapis.com/openimages/web/index.html" rel="noreferrer">Open Images Dataset</a>. My training data contains imbalanced classes, e.g.</p>
  
  <ol>
  <li>top (5K images)</li>
  <li>dress (50K images)</li>
  <li>etc...</li>
  </ol>
  
  <p>I would like to add class weights to classification loss to improve performance. How do I do that? The following section of the config file seems relevant:</p>
  
  <pre><code>loss {
    classification_loss {
      weighted_sigmoid {
      }
    }
    localization_loss {
      weighted_smooth_l1 {
      }
    }
   ...
    classification_weight: 1.0
    localization_weight: 1.0
  }
  </code></pre>
  
  <p>How can I change the config file to add classification loss weights per class? If not through a config file, what's a recommended way of doing that? </p>