当前位置 博文首页 > 不要Q晓航好嘛的博客:目标检测(2020-9-3)

    不要Q晓航好嘛的博客:目标检测(2020-9-3)

    作者:[db:作者] 时间:2021-07-14 15:36

    Edge Boxes: Locating Object Proposals from Edges

    C. Lawrence Zitnick and Piotr Doll′ar
    Microsoft Research

    Abstract:提出了一种利用边界框来检测物体的算法,并且通过框住的轮廓,可以计算包含物体的概率来定量的分析性能,当轮廓与边界框重合概率达到0.7时,物体的召回率超过75%,除此之外,算法的计算速度很快,约在0.25秒,并且还可以进行微小精度损失的实时的变化。

    1Introduction:
    目标检测的目标就是要确定一幅图像当中是否存在要检测的物体。对于这个问题,十几年前的算法是利用滑动窗口的范例,在每个方向,每个尺度,进行的物体对象分类。最近,另外一种框架被提出,该框架替代掉了尺度和方向的采取方法,进而利用边界框的目标检测方法,这类方法可以与对象无关的精确的检测出对象(可以不用依靠周围物体来检测物体),在2013图像网络检测挑战和PASCAL VOC数据集上,该类方法就是获胜者。
    在这篇论文中,提出了一种根据边缘来检测目标的算法,与分割相似,也需要得到图像的边缘映射,之后再从映射中检测目标。具体来说就是:通过边界框包含目标的可能性概率(边界框的分数)来作为目标检测的一个指标,如果所有的边缘像素都属于边界框内部的轮廓线的话,那么就可以得出:该轮廓被边界框涵盖了。在进行目标检测之前,本文利用结构边缘检测器( Structured forests for fast edge detection/Fast edge detection using structured forests)进行边缘映射的获取,在这个过程中,为了减少计算,还将领域内的相似方向的像素进行聚类构成新重组。本文利用传统的方法在每一个潜在的对象位置、比例和高宽比上,生成一个分数,来表示一个对象出现的可能性,以进一步优化边界框。

    第一行原图,第二行是结构边缘检测的结果,第三行是边缘重组,第四行是正确的边界框目标检测和边缘标记,最后一行是上一行的较差效果。其中,绿色的线是预测边界框的一部分,而红色的不是。第3-5行利用了边缘加粗和阈值方法进行了可视化操作
    在这里大胆想象一个课题方向:图像的边缘加宽处理和可视化提高
    方法?原理?(待研究补充)

    2Related work
    最常用的目标检测方法可以大致的分为两类:1.使用复杂且昂贵的分类器和检测器;2.弱监督学习,通过限制候选区域的数量,在较少的监督下学习。
    在这里给出三个目标检测的案例:
    1.算法分数:
    通过在一个分类框架中结合大量的线索来候选排序,并给每个对象分配一个结果的“不客观性”分数,来找到代表对象的候选边界框
    2.种子分割:
    从种子的多个区域开始,为每一个种子生成前景-背景的分割(方法的主要优点是生成高质量的分割掩模,缺点是计算成本高(每幅图像的分钟数。)
    3.超像素融合:
    选择性搜索是基于计算多层次的超像素分层分割,它一直是广泛使用的高层次检测方法。

    本文的方法是第一个直接从边缘中产生目标边界框的方法,不像其他的先前的方法,本文并没有使用分割或超像素,也不需要学习分数函数,而是用边界框封闭整个轮廓。
    3Approach
    本节描述了找到目标对象的方法。目标对象是基于单一计算分数来进行等级划分的。首先,基于边缘重组来描述数据结构,然后定义基于边缘的评分函数,最后,使用滑动窗口的框架来寻找高等级的目标对象,按照粗到细的搜索细化进行跨位置、比例和高宽比的评估(这地方的理解可能有偏差)。
    给定一个图像,首先使用结构边缘检测器来计算每个像素的边缘响应,利用单一尺度变化和尖锐化增强来减少运行时间;然后,对边缘响应利用非极大值抑制正交方法去找到边缘峰值;接着使用简单的贪婪算法构成边缘的重组(结合8连接的边缘,直到方向差的总和超过π/2停止);然后,根据公式:
    θij是xi与xj之间的夹角,γ是亲和力敏感系数
    计算每对领域组的亲和力;接着,由边缘重组集合和亲和力,根据下式:
    T是完整路径
    bw和bh分别是边界框的高度和宽度

    计算候选边界框的目标检测分数,(为了解释边界框中间的边缘相对于边界框附近的边缘不重要这一观察,就用下面的公式来衡量:
    在这里插入图片描述
    );然后,分别在水平和垂直边界寻找交叉点构成数据结构,进而找到重叠边缘组的列表;最后通过IoU(交并比)度量通过滑动窗口搜索图中的每个位置得到结果。
    中间的图是使用重叠边界框的轮廓的图,右边是移除重叠边界框轮廓的图,用于生成热图的方框尺寸由蓝色矩形显示。
    4Results
    本节将算法与其他算法进行比较。下图为算法的变体比较。
    第一张图是采样比率;第二张是NMS的参数;第三张是算法变化;第四张是边缘检测器
    可以看出图c中的曲线变化挺大的,参数的移除对算法本身有一定的影响。
    下面是算法的三个不同版本的准确度的衡量。
    在这里插入图片描述
    从图中可以看出,根据参数设置的Edge boxes50在IoU为0.5时的AUC(Area Under the Curve)和Recall最高。
    下图是不同度量情况下,算法的比较。
    在这里插入图片描述
    上图的其他算法在上文有相应的提到,如Objectness , Selective Search。
    下图是不同算法的性能定量的比较。
    在这里插入图片描述
    5Discussion
    在本文中,提出了一种有效的方法来寻找图像中的目标建议,它依赖于一个简单的观察:完全被一个边界框包围的边缘的数量表明了该边界框包含一个目标的可能性。描述了一个直接的评分函数,它计算一个框内的边缘强度减去横跨该框边界的轮廓部分的强度的加权和。利用有效的数据结构和智能搜索策略,可以快速找到目标建议。结果表明,在目前的技术水平上提高了准确性和效率。
    未来的工作是,使用边缘来帮助生成分割建议,除了边界框建议的对象。在对一个候选边界框进行打分时,去除许多边;这些被抑制边缘的位置可以为分割的生成提供有用的信息。
    训练的图。

    蓝色的框是最接近地面真值的框,地面真值是绿色和红色的框,其中绿色表明被发现的物体,红色表明物体尚未被发现

    Part Code 代码.

    在这里插入代码片
    % EDGES
    % See also readme.txt
    %
    % Fast edge detector code is based on the paper:
    %  P. Doll�r and C. Zitnick
    %  "Structured Forests for Fast Edge Detection", ICCV 2013.
    % Please cite the above paper if you end up using the edge detector.
    %
    % Edge Boxes object proposal generation is based on the paper:
    %  C. Zitnick and P. Doll�r
    %  "Edge Boxes: Locating Object Proposals from Edges", ECCV 2014.
    % Please cite the above paper if you end up using the object proposals.
    %
    % Structured Edge detector code:
    %   edgesChns       - Compute features for structured edge detection.
    %   edgesDemo       - Demo for Structured Edge Detector (please see readme.txt first).
    %   edgesDemoRgbd   - Demo for RGBD Structured Edge Detector (please see readme.txt first).
    %   edgesDetect     - Detect edges in image.
    %   edgesSweeps     - Parameter sweeps for structured edge detector.
    %   edgesTrain      - Train structured edge detector.
    %
    % Edge detection evaluation code:
    %   edgesEval       - Run and evaluate structured edge detector on BSDS500.
    %   edgesEvalDir    - Calculate edge precision/recall results for directory of edge images.
    %   edgesEvalImg    - Calculate edge precision/recall results for single edge image.
    %   edgesEvalPlot   - Plot edge precision/recall results for directory of edge images.
    %
    % Edge Boxes object proposal generation code:
    %   edgeBoxes       - Generate Edge Boxes object proposals in given image(s).
    %   edgeBoxesDemo   - Demo for Edge Boxes (please see readme.txt first).
    %   edgeBoxesSweeps - Parameter sweeps for Edges Boxes object proposals.
    %
    % Object proposal evaluation code:
    %   boxesData       - Get ground truth data for object proposal bounding box evaluation.
    %   boxesEval       - Perform object proposal bounding box evaluation and plot results.
    %
    % Sticky Edge Adhesive Superpixel code:
    %   spDemo          - Demo for Sticky Superpixels (please see readme.txt first).
    %   spDetect        - Detect Sticky Superpixels in image.
    %   spAffinities    - Compute superpixel affinities and optionally corresponding edge map.
    
    % Demo for Structured Edge Detector (please see readme.txt first).
    
    %% set opts for training (see edgesTrain.m)
    opts=edgesTrain();                % default options (good settings)
    opts.modelDir='models/';          % model will be in models/forest
    opts.modelFnm='modelBsds';        % model name
    opts.nPos=5e5; opts.nNeg=5e5;     % decrease to speedup training
    opts.useParfor=0;                 % parallelize if sufficient memory
    
    %% train edge detector (~20m/8Gb per tree, proportional to nPos/nNeg)
    tic, model=edgesTrain(opts); toc; % will load model if already trained
    
    %% set detection parameters (can set after training)
    model.opts.multiscale=0;          % for top accuracy set multiscale=1
    model.opts.sharpen=2;             % for top speed set sharpen=0
    model.opts.nTreesEval=4;          % for top speed set nTreesEval=1
    model.opts.nThreads=4;            % max number threads for evaluation
    model.opts.nms=0;                 % set to true to enable nms
    
    %% evaluate edge detector on BSDS500 (see edgesEval.m)
    if(0), edgesEval( model, 'show',1, 'name','' ); end
    
    

    References

    1. Viola, P.A., Jones, M.J.: Robust real-time face detection. IJCV 57(2) (2004) 137–154
    2. Dalal, N., Triggs, B.: Histograms of oriented gradients for human detection. In: CVPR. (2005)
    3. Felzenszwalb, P., Girshick, R., McAllester, D., Ramanan, D.: Object detection with discriminatively trained part based models. PAMI 32(9) (2010) 1627–1645
    4. Alexe, B., Deselaers, T., Ferrari, V.: Measuring the objectness of image windows. PAMI 34(11) (2012)
    5. Uijlings, J.R.R., van de Sande, K.E.A., Gevers, T., Smeulders, A.W.M.: Selective search for object recognition. IJCV (2013)
    6. Carreira, J., Sminchisescu, C.: Cpmc: Automatic object segmentation using constrained parametric min-cuts. PAMI 34(7) (2012) 7. Rahtu, E., Kannala, J., Blaschko, M.: Learning a category independent object detection cascade. In: ICCV. (2011) 8. Manen, S., Guillaumin, M., Van Gool, L., Leuven, K.: Prime object proposals with randomized prims algorithm. In: ICCV. (2013) 9. Endres, I., Hoiem, D.: Category-independent object proposals with diverse ranking. PAMI (2014) 10. Rantalankila, P., Kannala, J., Rahtu, E.: Generating object segmentation proposals using global and local search. In: CVPR. (2014) 11. Cheng, M.M., Zhang, Z., Lin, W.Y., Torr, P.: BING: Binarized normed gradients for objectness estimation at 300fps. In: CVPR. (2014) 12. Wang, X., Yang, M., Zhu, S., Lin, Y.: Regionlets for generic object detection. In: ICCV. (2013) 13. Girshick, R.B., Donahue, J., Darrell, T., Malik, J.: Rich feature hierarchies for accurate object detection and semantic segmentation. In: CVPR. (2014) 14. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: CVPR. (2009) 15. Everingham, M., Van Gool, L., Williams, C.K.I., Winn, J., Zisserman, A.: The pascal visual object classes (voc) challenge. IJCV 88(2) (2010) 303–338 16. Doll′ar, P., Zitnick, C.L.: Structured forests for fast edge detection. In: ICCV. (2013) 17. Marr, D.: Vision: A computational investigation into the human representation and processing of visual information. Inc., New York, NY (1982) 18. Eitz, M., Hays, J., Alexa, M.: How do humans sketch objects? ACM Transactions Graphics 31(4) (2012) 19. Doll′ar, P., Zitnick, C.L.: Fast edge detection using structured forests. CoRR abs/1406.5549 (2014) 20. Deselaers, T., Alexe, B., Ferrari, V.: Localizing objects while learning their appearance. In: ECCV. (2010) 21. Siva, P., Xiang, T.: Weakly supervised object detector learning with model drift detection. In: ICCV. (2011) 22. Gu, C., Lim, J.J., Arbel′aez, P., Malik, J.: Recognition using regions. In: CVPR. (2009)
    7. Siva, P., Xiang, T.: Weakly supervised object detector learning with model drift detection. In: ICCV. (2011)
    8. Gu, C., Lim, J.J., Arbel′aez, P., Malik, J.: Recognition using regions. In: CVPR. (2009)
    9. Hoiem, D., Efros, A.A., Hebert, M.: Geometric context from a single image. In: ICCV. (2005)
    10. Russell, B.C., Freeman, W.T., Efros, A.A., Sivic, J., Zisserman, A.: Using multiple segmentations to discover objects and their extent in image collections. In: CVPR. (2006)
    11. Malisiewicz, T., Efros, A.A.: Improving spatial support for objects via multiple segmentations. In: BMVC. (2007)
    12. Hosang, J., Benenson, R., Schiele, B.: How good are detection proposals, really? In: BMVC. (2014)
    13. Felzenszwalb, P.F., Huttenlocher, D.P.: Efficient graph-based image segmentation. IJCV 59(2) (2004)
    14. Canny, J.: A computational approach to edge detection. PAMI (6) (1986) 679–698
    cs