0

我有两个从 Instagram 收集的数据集。其中之一是汽车的照片。我使用来自 TensorFlow 模型花园的 CenterNet HourGlass104 1024x1024,在 COCO 数据集上进行了预训练,训练了一个对象检测器来检测汽车中的公司徽标。它工作得很好。

然而,我在另一个数据集上尝试了相同的方法,这是人们拿着来自不同商店的购物袋的照片。物体检测器的工作是检测购物袋和品牌。这一次,object center loss非常高,mAP为零。

我用相同的配置训练了两个模型(TensorFlow 的默认配置,批量较小,不会遇到内存问题)。

我也尝试降低学习率,但没有任何改善。

我想我应该尝试更改 object_center_params,但我不知道应该更改哪些值。

我还训练了其他模型,例如 Faster R-CNN Inception、SSD 和 EfficientDet,它们都有效。对于这个特定的数据集,只有 CenterNet 没有。

这是我的 pipeline.config 文件:

model {
  center_net {
    num_classes: 3
    feature_extractor {
      type: "hourglass_104"
      channel_means: 104.01361846923828
      channel_means: 114.03422546386719
      channel_means: 119.91659545898438
      channel_stds: 73.60276794433594
      channel_stds: 69.89082336425781
      channel_stds: 70.91507720947266
      bgr_ordering: true
    }
    image_resizer {
      keep_aspect_ratio_resizer {
        min_dimension: 1024
        max_dimension: 1024
        pad_to_max_dimension: true
      }
    }
    object_detection_task {
      task_loss_weight: 1.0
      offset_loss_weight: 1.0
      scale_loss_weight: 0.10000000149011612
      localization_loss {
        l1_localization_loss {
        }
      }
    }
    object_center_params {
      object_center_loss_weight: 1.0
      classification_loss {
        penalty_reduced_logistic_focal_loss {
          alpha: 2.0
          beta: 4.0
        }
      }
      min_box_overlap_iou: 0.699999988079071
      max_box_predictions: 100
    }
  }
}
train_config {
  batch_size: 2
  data_augmentation_options {
    random_horizontal_flip {
    }
  }
  data_augmentation_options {
    random_adjust_hue {
    }
  }
  data_augmentation_options {
    random_adjust_contrast {
    }
  }
  data_augmentation_options {
    random_adjust_saturation {
    }
  }
  data_augmentation_options {
    random_adjust_brightness {
    }
  }
  data_augmentation_options {
    random_square_crop_by_scale {
      scale_min: 0.6000000238418579
      scale_max: 1.2999999523162842
    }
  }
  optimizer {
    adam_optimizer {
      learning_rate {
        cosine_decay_learning_rate {
          learning_rate_base: 0.000015625
          total_steps: 50000
          warmup_learning_rate: 0.00000390625
          warmup_steps: 5000
        }
      }
      epsilon: 1.0000000116860974e-07
    }
    use_moving_average: false
  }
  fine_tune_checkpoint: "pre-trained-models/centernet_hg104_1024x1024_coco17_tpu-32/checkpoint/ckpt-0"
  num_steps: 100000
  max_number_of_boxes: 100
  unpad_groundtruth_tensors: false
  fine_tune_checkpoint_type: "detection"
  fine_tune_checkpoint_version: V2
}
train_input_reader {
  tf_record_input_reader {
    input_path: "annotations/gucci-louisvuitton-prada/train.record"
  }
}
eval_config {
  metrics_set: "coco_detection_metrics"
  use_moving_averages: false
  batch_size: 1
}
eval_input_reader {
  label_map_path: "annotations/gucci-louisvuitton-prada/label_map.pbtxt"
  shuffle: false
  num_epochs: 1
  tf_record_input_reader {
    input_path: "annotations/gucci-louisvuitton-prada/test.record"
  }
}

我会很感激我能得到的任何帮助。

4

0 回答 0