Answers.Body: <p>It of course depends on the detection model that is used.</p>
  <p>But in your case I think you relate to a Faster-RCNN type architecture for bounding box detection. In this case only the relative position to an anchor is regressed, that is correct. Of course the regression &quot;values&quot; isolated have no information where they are absolute in the image since the same convolution is shared and slided over the whole image/layer. However, after your regression layer is done (i.e. slided the convolution over the whole previous layer) it outputs a new feature map with relative regression values. The regression values itself do not contain the information about the abolute position, but the xy position of the relative feature values inside the output feature map of the regressor combined with the relative values itself gives you the information about the absolute position.</p>
  <p>This also makes it &quot;translation invariant&quot;, which is an important and wanted feature of Faster-RCNN architectures.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-12T18:43:44.913Z
Answers.Text: Yeah so we know the anchor positions from the start and we just need the relative scaling of the box. And if I recall correctly, each individual regression head is tied to a specific anchor right?
Answers.UserDisplayName: Alexander Soare
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-13T08:56:49.227Z
Answers.Text: Yes exactly. The "regression head"-convolution is shared and shifted over the whole input map and at each convolution-window position outputs 4k relative regression values that are written to the corresponding (absolute but unaccurate) position in the output map. Combined with the relative values themself you then get accurate absolute positions.
Answers.UserDisplayName: Marcel_marcel1991
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-12T15:17:09.383Z
Answers.LastActivityDate: 2022-01-12T15:17:09.383Z
Answers.UserDisplayName: Marcel_marcel1991
Body: <p>I've always found bounding box regression a bit weird. There's no positional encoding like in vision transformers, so how does the network &quot;know&quot; the absolute position when producing bounding box coordinates? It gets even weirder when we are dealing with two-stage detectors because, in the second stage bounding box regression, only an ROI is available, not the whole image.</p>
  
Tags: <computer-vision><object-detection><bounding-box>
Title: How does a bounding box detection network "know" about absolute position?
UserDisplayName: Alexander Soare
ThreadText: # How does a bounding box detection network "know" about absolute position?
  
  (Asked by: username_0 on 2022-01-11)
  
  I've always found bounding box regression a bit weird. There's no positional encoding like in vision transformers, so how does the network "know" the absolute position when producing bounding box coordinates? It gets even weirder when we are dealing with two-stage detectors because, in the second stage bounding box regression, only an ROI is available, not the whole image.
  
  **Tags:** computer-vision, object-detection, bounding-box
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-01-12. Score: 2 | Accepted answer
  
  It of course depends on the detection model that is used.
  
  But in your case I think you relate to a Faster-RCNN type architecture for bounding box detection. In this case only the relative position to an anchor is regressed, that is correct. Of course the regression "values" isolated have no information where they are absolute in the image since the same convolution is shared and slided over the whole image/layer. However, after your regression layer is done (i.e. slided the convolution over the whole previous layer) it outputs a new feature map with relative regression values. The regression values itself do not contain the information about the abolute position, but the xy position of the relative feature values inside the output feature map of the regressor combined with the relative values itself gives you the information about the absolute position.
  
  This also makes it "translation invariant", which is an important and wanted feature of Faster-RCNN architectures.
  
  > **Comments:**
  > **username_0**: Yeah so we know the anchor positions from the start and we just need the relative scaling of the box. And if I recall correctly, each individual regression head is tied to a specific anchor right?  
  > **username_1**: Yes exactly. The "regression head"-convolution is shared and shifted over the whole input map and at each convolution-window position outputs 4k relative regression values that are written to the corresponding (absolute but unaccurate) position in the output map. Combined with the relative values themself you then get accurate absolute positions.  
  
  ---
  
  