Answers.Body: <blockquote>
  <p>What is actually the downsampling of 2 mean?</p>
  <p>If I have an image size of <code>256x256x170</code> and if I downsample it by a factor of 2, it will result in an image of size <code>128x128x85</code>?</p>
  </blockquote>
  <p>Yes, that is correct.</p>
  <blockquote>
  <p>Similarly, upsampling or resampling is the opposite interpolation method to original size <code>256x256x170</code>?</p>
  </blockquote>
  <p>Yes, correct result again. Resampling is a more general term and describes resizing an image (or other grid-based signal) using an automatic rule which could be enlarging or reducing the size.</p>
  <p>What resampling does <em>not</em> mean in digital signal processing is going back to the original source and taking a second sample. That might be a reasonable interpretation of the word when coming across it for the first time, but it is not correct here.</p>
  <p>Just saying that a signal is resampled does not give enough information to say exactly what was done numerically to the signal, because it does not specify the rule of what happens with the lost (in case of downsampling) or missing (in case of upsampling) information. There are a few different ways to perform the resize, and different kinds of interpolation. It looks like the paper does give more information here, but you may need to read more or inspect the authors' code to be certain - for instance &quot;nearest neighbour interpolation&quot; <em>probably</em> involves looking at values of the six adjacent voxels to each new one you create, and taking the mean value of the ones that exist in the original grid (some will not, they will be other new cells), but there are a few different ways to manage that process.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-31T22:03:53.380Z
Answers.Text: @Neuk Slater, they use:  
  `dx = 2 
  dy=2 
  dz=2  
  L = L[::dx, ::dy, ::dz] 
  I = I[::dx, ::dy, ::dz]
  ` 
  to downsample the Image(I) and Label(L). But resampling back changes the label values. I am finding it hard to print the codes here.
Answers.UserDisplayName: banikr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-01T22:15:11.060Z
Answers.Text: Moreover, in section 2.2 second paragraph, "...the 3D FCN is trained on images of the lowest resolution in order to capture the largest amount of context, downsampled with a factor of ds1 = 2S and optimized using the Dice loss L1...
  In the next level, we use the predicted segmentation maps as a second input channel to the 3D FCN while learning from the images at a higher resolution, downsampled by a factor of ds2 =ds1 /2, and optimized using Dice loss L2."
  What does it mean by downsampling again by ds2? Shouldn't they upsample prediction by 2 or to original size of high-resolution patch?
Answers.UserDisplayName: banikr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-02T06:52:42.033Z
Answers.Text: @banikr I am not sure of the answers to your follow-up questions, and don't think they would fit in a comment anyway. Could you please ask a new question on the site. You could link this one to help explain what you have already understood.
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-02T20:58:42.503Z
Answers.Text: Check the post: https://ai.stackexchange.com/questions/28067/down-sampling-confusion-in-coarse-to-fine-segmentation @Neil Slater
Answers.UserDisplayName: banikr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-31T07:57:37.957Z
Answers.LastActivityDate: 2021-05-31T08:03:34.553Z
Answers.LastEditDate: 2021-05-31T08:03:34.553Z
Answers.UserDisplayName: Neil Slater
Body: <p>The paper <a href="https://arxiv.org/pdf/1704.06382.pdf" rel="nofollow noreferrer">here</a> in section <strong>2.1 Coarse-to-fine prediction</strong>:</p>
  <blockquote>
  <p>To increase the field of view presented to the CNN and reduce the
  redundancy among neighboring voxels, each image is downsampled by a factor of 2. The resulting prediction maps are then resampled back to the original resolution using nearest-neighbor interpolation.</p>
  </blockquote>
  <p>What does it actually mean to downsample by a factor of 2?</p>
  <p>If I have an image size of <span class="math-container">$256 \times 256 \times 170$</span>, and if I downsample it by a factor of 2, then will it result in an image of size <span class="math-container">$128 \times 128 \times 85$</span>?</p>
  <p>Similarly, would upsampling/resampling be the opposite interpolation method, getting back to the original size of <span class="math-container">$256 \times 256 \times 170$</span>?</p>
  
Tags: <image-segmentation><downsampling><upsampling>
Title: What does 'downsampling' and 'upsampling' mean in coarse-to-fine segmentation?
UserDisplayName: banikr
ThreadText: # What does 'downsampling' and 'upsampling' mean in coarse-to-fine segmentation?
  
  (Asked by: username_0 on 2021-05-31)
  
  The paper [here](https://arxiv.org/pdf/1704.06382.pdf) in section **2.1 Coarse-to-fine prediction**:
  
  > To increase the field of view presented to the CNN and reduce the
  > redundancy among neighboring voxels, each image is downsampled by a factor of 2. The resulting prediction maps are then resampled back to the original resolution using nearest-neighbor interpolation.
  
  What does it actually mean to downsample by a factor of 2?
  
  If I have an image size of $256 \times 256 \times 170$, and if I downsample it by a factor of 2, then will it result in an image of size $128 \times 128 \times 85$?
  
  Similarly, would upsampling/resampling be the opposite interpolation method, getting back to the original size of $256 \times 256 \times 170$?
  
  **Tags:** image-segmentation, downsampling, upsampling
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-05-31. Score: 0
  
  > What is actually the downsampling of 2 mean?
  >
  > If I have an image size of `256x256x170` and if I downsample it by a factor of 2, it will result in an image of size `128x128x85`?
  
  Yes, that is correct.
  
  > Similarly, upsampling or resampling is the opposite interpolation method to original size `256x256x170`?
  
  Yes, correct result again. Resampling is a more general term and describes resizing an image (or other grid-based signal) using an automatic rule which could be enlarging or reducing the size.
  
  What resampling does *not* mean in digital signal processing is going back to the original source and taking a second sample. That might be a reasonable interpretation of the word when coming across it for the first time, but it is not correct here.
  
  Just saying that a signal is resampled does not give enough information to say exactly what was done numerically to the signal, because it does not specify the rule of what happens with the lost (in case of downsampling) or missing (in case of upsampling) information. There are a few different ways to perform the resize, and different kinds of interpolation. It looks like the paper does give more information here, but you may need to read more or inspect the authors' code to be certain - for instance "nearest neighbour interpolation" *probably* involves looking at values of the six adjacent voxels to each new one you create, and taking the mean value of the ones that exist in the original grid (some will not, they will be other new cells), but there are a few different ways to manage that process.
  
  > **Comments:**
  > **username_0**: @Neuk Slater, they use:   `dx = 2  dy=2  dz=2   L = L[::dx, ::dy, ::dz]  I = I[::dx, ::dy, ::dz] `  to downsample the Image(I) and Label(L). But resampling back changes the label values. I am finding it hard to print the codes here.  
  > **username_0**: Moreover, in section 2.2 second paragraph, "...the 3D FCN is trained on images of the lowest resolution in order to capture the largest amount of context, downsampled with a factor of ds1 = 2S and optimized using the Dice loss L1... In the next level, we use the predicted segmentation maps as a second input channel to the 3D FCN while learning from the images at a higher resolution, downsampled by a factor of ds2 =ds1 /2, and optimized using Dice loss L2." What does it mean by downsampling again by ds2? Shouldn't they upsample prediction by 2 or to original size of high-resolution patch?  
  > **username_1**: @banikr I am not sure of the answers to your follow-up questions, and don't think they would fit in a comment anyway. Could you please ask a new question on the site. You could link this one to help explain what you have already understood.  
  > **username_0**: Check the post: https://ai.stackexchange.com/questions/28067/down-sampling-confusion-in-coarse-to-fine-segmentation @Neil Slater  
  
  ---
  
  