- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在设置新的 Tensorflow Object Detection API在大面积的卫星图像中寻找小物体。它工作得很好 - 它找到了我想要的所有 10 个对象,但我也得到了 50-100 个误报 [看起来有点像目标对象,但事实并非如此]。
我正在使用sample config来自'pets' tutorial ,微调他们提供的 faster_rcnn_resnet101_coco
模型。我从小规模开始,只有 100 个对象的训练示例(仅 1 个类)。我的验证集中有 50 个示例。每个示例都是一个 200x200 像素图像,中心有一个标记对象 (~40x40)。我训练直到我的精度和损失曲线达到稳定水平。
我对使用深度学习进行对象检测还比较陌生。提高精确度的最佳策略是什么?例如硬负挖矿?增加我的训练数据集大小?我还没有尝试过他们提供的最准确的模型 faster_rcnn_inception_resnet_v2_atrous_coco
,因为我想保持一定的速度,但如果需要的话我会这样做。
硬阴性挖掘似乎是一个合乎逻辑的步骤。如果您同意,我如何实现它并为我的训练数据集设置 tfrecord 文件?假设我为 50-100 个误报中的每一个制作了 200x200 的图像:
最佳答案
我最近在工作中重新审视了这个主题,并认为我会为将来访问的任何人更新我当前的学习内容。
该主题出现在 Tensorflow's Models repo issue tracker 。 SSD 允许您设置要挖掘的负例与正例的比例 (max_males_per_positive: 3
),但您也可以为没有正例的图像设置最小数量 (min_males_per_image: 3
)。这两个都在 model-ssd-loss 配置部分中定义。
也就是说,我在 Faster-RCNN 的模型配置中没有看到相同的选项。问题中提到 models/research/object_detection/core/balanced_positive_negative_sampler.py
包含用于 Faster-RCNN 的代码。
本期讨论的另一个选项是专门为相似者创建第二个类。在训练期间,模型将尝试学习类别差异,这将有助于实现您的目的。
最后,我发现了这个article关于滤波器放大器网络 (FAN) 的信息可能会为您的航空图像工作提供信息。
================================================== ===================
以下论文描述了与您描述的相同目的的硬负挖掘: Training Region-based Object Detectors with Online Hard Example Mining
在第 3.1 节中,他们描述了使用前台和后台类:
Background RoIs. A region is labeled background (bg) if its maximum IoU with ground truth is in the interval [bg lo, 0.5). A lower threshold of bg lo = 0.1 is used by both FRCN and SPPnet, and is hypothesized in [14] to crudely approximate hard negative mining; the assumption is that regions with some overlap with the ground truth are more likely to be the confusing or hard ones. We show in Section 5.4 that although this heuristic helps convergence and detection accuracy, it is suboptimal because it ignores some infrequent, but important, difficult background regions. Our method removes the bg lo threshold.
事实上这篇论文被引用,其思想被用在Tensorflow的对象检测loss.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 由如下代码中的loss_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 .
如果您想要输入没有真正阳性的数据(即图像中不应对任何内容进行分类),只需将阴性图像添加到没有边界框的 tfrecord 中即可。
关于machine-learning - 减少误报的最佳策略 : Google's new Object Detection API on Satellite Imagery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45666499/
这个问题在这里已经有了答案: Why don't Java's +=, -=, *=, /= compound assignment operators require casting? (11 个
我搜索了很多,但没有一个链接能帮助我解决这个问题。我得到了 ORA-21500: internal error code, arguments: [%s], [%s], [%s], [%s], [%s
我正在做 RegexOne 正则表达式教程,它有一个 question关于编写正则表达式以删除不必要的空格。 教程中提供的解决方案是 We can just skip all the starting
([\s\S]+|\s?) 中 |\s? 的目的或作用是什么?如果没有它,表达式会不会与 ([\s\S]+) 相同? 最佳答案 这不是完全相同的。 ([\s\S]+|\s?) 会匹配空字符串,而 ([
这个正则表达式有一组还是两组? 我正在尝试使用第二组访问 bookTitle 但出现错误: Pattern pattern = Pattern.compile("^\\s*(.*?)\\s+-\\s+
在 C 中给定一个字符串指针 s,下面的迭代会做什么?即它以什么方式遍历字符串? for (++s ; *s; ++s); 最佳答案 for (++s ; *s;++s) 表示 将指针 s 递增到字符
我正在用一个 node.js 应用程序解析一个大列表并有这段代码 sizeCode = dbfr.CN_DESC.split('\s+-\s*|\s*-\s+') 这似乎不起作用,因为它返回了 [ '
我正在编写一个简单的字符串连接程序。 该程序按照我发布的方式运行。但是,我首先使用以下代码编写它来查找字符串的结尾: while (*s++) ; 但是,这个方法并没有奏效。我传递给它的字符串
这个问题已经有答案了: What does (?和aramchand来自Mohandas Karamchand G 因此,在使用这些匹配来分割字符串后,您最终会得到 {"M", "K", "G"} 注
我正在尝试转换 Map到 List使用 lambda。 本质上,我想将键和值与 '=' 连接起来之间。这看起来微不足道,但我找不到如何去做。 例如 Map map = new HashMap<>();
我正在经历 K & R,并且在递增指针时遇到困难。练习 5.3(第 107 页)要求您使用指针编写一个 strcat 函数。 在伪代码中,该函数执行以下操作: 将 2 个字符串作为输入。 找到字符串
在下面的代码中,pS 和 s.pS 在最后一行是否保证相等?也就是说,在语句S s = S();中,是否可以确定不会构造一个临时的S? #include using namespace std; s
演示示例代码: public void ReverseString(char[] s) { for(int i = 0, j = s.Length-1; i < j; i++, j--){
我一直在寻找类似于 .NET examples 中的示例的 PowerShell 脚本.取一个 New-TimeSpan 并显示为 1 天 2 小时 3 分钟 4 秒。排除其零的地方,在需要的地方添加
def func(s): s = s + " is corrected" return s string_list = ["She", "He"] for s in string_li
我是 python 的新手。当我在互联网上搜索 lambda 时。我在 lambda_functions 中找到了这个声明. processFunc = collapse and (lambda s:
我最近开始学习正则表达式,并试图为上面的问题写一个正则表达式。如果限制只放在一个字母上(例如不超过 2 个“b”),这并不困难。 那么答案就是:a* c*(b|ε)a* c*(b|ε)a* c* 但是
当我运行 npm install 时出现以下错误,但我无法修复它。 我试过:npm install -g windows-build-tools 也没有修复这个错误 ERR! configure
有很多有趣的haskell网上可以找到片段。 This post可以在 this (awesome) Stack Overflow question 下找到. The author写道: discou
我知道以下三行代码旨在将字符串提取到$ value中并将其存储在$ header中。但是我不知道$value =~ s/^\s+//;和$value =~ s/\s+$//;之间有什么区别。 $val
我是一名优秀的程序员,十分优秀!