5

我正在設置新的Google Object Detection API,以在大面積的衛星圖像中查找小物體。它工作得很好 - 它找到了我想要的所有10個對象,但是我也得到了50-100個誤判[這些東西看起來有點像目標對象,但不是]。減少誤報的最佳策略:Google新的衛星圖像對象檢測API

我使用'pets' tutorial中的sample config來精細調整它們提供的faster_rcnn_resnet101_coco型號。我從小開始,只有100個訓練樣本(僅有1節課)。我的驗證集中有50個示例。每個示例都是一個200x200像素的圖像,中間有一個帶標記的對象(〜40x40)。我訓練,直到我的精度&損失曲線高原。

我對使用深度學習進行對象檢測相對較新。什麼是提高我的精確度的最佳策略?例如硬性負面採礦?增加我的訓練數據集大小?我還沒有試過他們提供的最準確的模型faster_rcnn_inception_resnet_v2_atrous_coco,因爲我想保持一定的速度,但如果需要的話會這樣做。

堅硬的負面採礦似乎是合乎邏輯的一步。如果您同意,我該如何實施它,爲我的訓練數據集設置tfrecord文件?假設我爲每個50-100個誤報製作200x200圖像:

  • 我是否爲每個創建'annotation'xml文件,但沒有'object'元素?
  • ...或者我會將這些不利底片標記爲第二類嗎?
  • 如果我在我的訓練集中有100個負面數據到100個正面數據 - 這是一個健康的比率嗎?我可以包括多少個底片?

回答

0

我還在探索Tensorflow的Object Detection API。具體來說,我試圖微調現有的模型,以消除人爲檢測的誤報。

下面本文介紹了您所描述的相同目的硬負開採: Training Region-based Object Detectors with Online Hard Example Mining

在3.1節他們描述使用前景和背景類:

背景的投資回報。如果地帶真值的最大值IoU在區間[bg lo,0.5)中,則區域被標記爲背景(bg)。 FRCN和SPPnet都使用bg lo = 0.1的閾值較低的 ,並且在[14]中假設 粗略地近似硬性負採礦; 的假設是與地面實況有一些重疊的區域更可能是令人困惑或困難的區域。我們在第5.4節 中展示,儘管這種啓發式有助於收斂和檢測的準確性,但它並不是最理想的,因爲它忽略了一些不經常但很重要的困難背景區域。我們的方法刪除了bg lo閾值。

其實本文引用其想法是在難以開採Tensorflow的對象檢測losses.py代碼中使用:

class HardExampleMiner(object): 
"""Hard example mining for regions in a list of images. 
Implements hard example mining to select a subset of regions to be 
back-propagated. For each image, selects the regions with highest losses, 
subject to the condition that a newly selected region cannot have 
an IOU > iou_threshold with any of the previously selected regions. 
This can be achieved by re-using a greedy non-maximum suppression algorithm. 
A constraint on the number of negatives mined per positive region can also be 
enforced. 
Reference papers: "Training Region-based Object Detectors with Online 
Hard Example Mining" (CVPR 2016) by Srivastava et al., and 
"SSD: Single Shot MultiBox Detector" (ECCV 2016) by Liu et al. 
""" 

基於模型的配置文件,該HardMinerObject由losses_builder返回。py在這段代碼中:

def build_hard_example_miner(config, 
          classification_weight, 
          localization_weight): 
"""Builds hard example miner based on the config. 
Args: 
    config: A losses_pb2.HardExampleMiner object. 
    classification_weight: Classification loss weight. 
    localization_weight: Localization loss weight. 
Returns: 
    Hard example miner. 
""" 
loss_type = None 
if config.loss_type == losses_pb2.HardExampleMiner.BOTH: 
    loss_type = 'both' 
if config.loss_type == losses_pb2.HardExampleMiner.CLASSIFICATION: 
    loss_type = 'cls' 
if config.loss_type == losses_pb2.HardExampleMiner.LOCALIZATION: 
    loss_type = 'loc' 

max_negatives_per_positive = None 
num_hard_examples = None 
if config.max_negatives_per_positive > 0: 
    max_negatives_per_positive = config.max_negatives_per_positive 
if config.num_hard_examples > 0: 
    num_hard_examples = config.num_hard_examples 
hard_example_miner = losses.HardExampleMiner(
    num_hard_examples=num_hard_examples, 
    iou_threshold=config.iou_threshold, 
    loss_type=loss_type, 
    cls_loss_weight=classification_weight, 
    loc_loss_weight=localization_weight, 
    max_negatives_per_positive=max_negatives_per_positive, 
    min_negatives_per_image=config.min_negatives_per_image) 
return hard_example_miner 

這是由model_builder.py返回並由train.py調用。所以基本上,在我看來,簡單地生成真正的正面標籤(使用像LabelImg或RectLabel這樣的工具)應該足以讓火車算法在相同的圖像中找到難以消除的負面信息。相關的問題給出了一個很好的walkthrough。我還沒有看到其他人提到自己必須產生負面影響。

如果您想要輸入沒有真實肯定的數據(即沒有圖像需要分類),我並不知道,我希望別人能夠提示是否需要。 PASCAL VOC提到了一個「其他」標籤ID 0,可以用來標註干擾標籤,但我沒有嘗試將0或0標籤作爲標籤。

請更新您找到的任何結果或任何您偶然發現的新信息。謝謝!