Answers.Body: <p>There are some special architectures of CNNs which are designed exactly for the task you mention. The <a href="https://github.com/facebookresearch/Detectron" rel="nofollow noreferrer">Detector</a> library includes a collection of these architectures, <a href="https://arxiv.org/abs/1703.06870" rel="nofollow noreferrer">this</a> paper describes the Mask R-CNN network in detail, which is designed for image segmentation tasks.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-07T08:18:56.063Z
Answers.Text: Thanks for your answer! The Mask R-CNN, Faster R-CNN are interesting but they all seem to be tailored towards combining classification with bounding box detection - I don't see a simple and effective way to isolate the key elements for finding bounding boxes alone
Answers.UserDisplayName: Daniel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-07T06:34:42.487Z
Answers.LastActivityDate: 2018-09-07T06:34:42.487Z
Answers.UserDisplayName: 50k4
Answers.Body: <p>In the R-CNN family approach, the BBox regression is performed using a specific module providing <strong>region proposal</strong>: initially the <a href="https://www.learnopencv.com/selective-search-for-object-detection-cpp-python/" rel="nofollow noreferrer">Selective Search</a> has been used then <a href="https://www.quora.com/How-does-the-region-proposal-network-RPN-in-Faster-R-CNN-work" rel="nofollow noreferrer">Region Proposal Network</a> has been introduced, which has the advantage, being a NN, to be trainable. </p>
  
  <p>This has not to be confused with the BBox Regressor which comes after in the architecture and is focused on refining the proposal bboxes for the “Non Background” proposal objects </p>
  
  <p>Please consider that to perform object detection properly, at least using a region proposal based architecture, you need to perform the basic “Background / Non Background” classification (which is where CNN features help) so to filter out non relevant proposals </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-13T16:21:55.860Z
Answers.LastActivityDate: 2018-11-13T16:21:55.860Z
Answers.UserDisplayName: Nicola Bernini
Body: <p>I have an application where I want to find the locations of objects on a simple, relatively constant background (fixed camera angle, etc). For investigative purposes, I've created a test dataset that displays many characteristics of the actual problem.</p>
  <p>Here's a sample from my test dataset.</p>
  <p><a href="https://i.sstatic.net/AKV7f.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AKV7f.png" alt="enter image description here" /></a></p>
  <p>Our problem description is to <strong>find the bounding box of the single circle in the image</strong>. If there is more than one circle or no circles, we don't care about the bounding box (but we at least need to know that there is no valid single bounding box).</p>
  <p>For my attempt to solve this, I built a CNN that would regress <code>(min_x, min_y, max_y, max_y)</code>, as well as one more value that could indicate how many circles were in the image.</p>
  <p>I played with different architecture variations, but, in general, the architecture a was very standard CNN (3-4 ReLU convolutional layers with max-pooling in between, followed by a dense layer and an output layer with linear activation for the bounding box outputs, set to minimise the mean squared error between the outputs and the ground truth bounding boxes).</p>
  <p>Regardless of the architecture, hyperparameters, optimizers, etc, the result was always the same - <strong>the CNN could not even get close to building a model</strong> that was able to regress an accurate bounding box, even with over 50000 training examples to work with.</p>
  <p>What gives? Do I need to look at using another type of network as CNNs are more suited to classification rather than localisation tasks?</p>
  <p>Obviously, there are computer vision techniques that could solve this easily, but due to the fact that the actual application is more involved, I want to know strictly about NN/AI approaches to this problem.</p>
  
Tags: <convolutional-neural-networks><computer-vision><object-detection><bounding-box>
Title: How to architect a network to find bounding boxes in simple images?
UserDisplayName: Daniel
ThreadText: # How to architect a network to find bounding boxes in simple images?
  
  (Asked by: username_0 on 2018-09-07)
  
  I have an application where I want to find the locations of objects on a simple, relatively constant background (fixed camera angle, etc). For investigative purposes, I've created a test dataset that displays many characteristics of the actual problem.
  
  Here's a sample from my test dataset.
  
  [![enter image description here](https://i.sstatic.net/AKV7f.png)](https://i.sstatic.net/AKV7f.png)
  
  Our problem description is to **find the bounding box of the single circle in the image**. If there is more than one circle or no circles, we don't care about the bounding box (but we at least need to know that there is no valid single bounding box).
  
  For my attempt to solve this, I built a CNN that would regress `(min_x, min_y, max_y, max_y)`, as well as one more value that could indicate how many circles were in the image.
  
  I played with different architecture variations, but, in general, the architecture a was very standard CNN (3-4 ReLU convolutional layers with max-pooling in between, followed by a dense layer and an output layer with linear activation for the bounding box outputs, set to minimise the mean squared error between the outputs and the ground truth bounding boxes).
  
  Regardless of the architecture, hyperparameters, optimizers, etc, the result was always the same - **the CNN could not even get close to building a model** that was able to regress an accurate bounding box, even with over 50000 training examples to work with.
  
  What gives? Do I need to look at using another type of network as CNNs are more suited to classification rather than localisation tasks?
  
  Obviously, there are computer vision techniques that could solve this easily, but due to the fact that the actual application is more involved, I want to know strictly about NN/AI approaches to this problem.
  
  **Tags:** convolutional-neural-networks, computer-vision, object-detection, bounding-box
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-09-07. Score: 1
  
  There are some special architectures of CNNs which are designed exactly for the task you mention. The [Detector](https://github.com/facebookresearch/Detectron) library includes a collection of these architectures, [this](https://arxiv.org/abs/1703.06870) paper describes the Mask R-CNN network in detail, which is designed for image segmentation tasks.
  
  > **Comments:**
  > **username_0**: Thanks for your answer! The Mask R-CNN, Faster R-CNN are interesting but they all seem to be tailored towards combining classification with bounding box detection - I don't see a simple and effective way to isolate the key elements for finding bounding boxes alone  
  
  ---
  
  ### Answer by username_2 on 2018-11-13. Score: 0
  
  In the R-CNN family approach, the BBox regression is performed using a specific module providing **region proposal**: initially the [Selective Search](https://www.learnopencv.com/selective-search-for-object-detection-cpp-python/) has been used then [Region Proposal Network](https://www.quora.com/How-does-the-region-proposal-network-RPN-in-Faster-R-CNN-work) has been introduced, which has the advantage, being a NN, to be trainable.
  
  This has not to be confused with the BBox Regressor which comes after in the architecture and is focused on refining the proposal bboxes for the “Non Background” proposal objects
  
  Please consider that to perform object detection properly, at least using a region proposal based architecture, you need to perform the basic “Background / Non Background” classification (which is where CNN features help) so to filter out non relevant proposals
  
  
  ---
  
  