Body: <p>A task I’m working on at the moment requires a CNN with a height map as one of the inputs. This is a matrix of floating point values in which each point is the height of that point above sea level.</p>
  
  <p>I’m having trouble deciding how to normalize this data. I know there are networks that work on depth or distance data but that is different for several reasons:</p>
  
  <ul>
  <li>Height can also be negative (as opposed to depth/distance which starts at 0)</li>
  <li>Height has a very large range - can get values between -400 and +~9000.</li>
  </ul>
  
  <p>For these reasons the common approach to normalisation, simply subtracting the mean and dividing by the standard deviation, will result in the loss of information in most cases (all values will be close to zero).</p>
  
  <p>I thought of maybe subtracting the local mean for each input, rather than a general mean calculated from all the data, but I still don't know what to do with the standard deviation, since dividing by the local standard deviation can result in very “flat” and very “steep” inputs looking the same after normalization.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-21T15:41:56.913Z
Comments.Text: Could you apply a log transformation to it? That would mean that the more frequent data points close to NN (sea level) would still have a good range, while the (presumably rarer?) extreme values would be compressed.
Comments.UserDisplayName: Oliver Mason
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-21T19:50:14.890Z
Comments.Text: Hi, thanks. I know that’s a common practice with depth/distance data but the problem as I mentioned is that my data can also be negative and log is undefined for non-positive values..
Comments.UserDisplayName: iariav
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-22T07:57:58.620Z
Comments.Text: As you're only using the log to compress the range of the data, could you not just log the magnitude? So that -250 becomes -2.397?
Comments.UserDisplayName: Oliver Mason
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-23T07:18:42.017Z
Comments.Text: that's an interesting idea but I think it's still problematic. let us say I'm working on a high altitude area. say 5000+. so all the small variations in height will be lost after I take the log. and if I take the same height structure to a low altitude place, say ~100, the representation will be very different.
Comments.UserDisplayName: iariav
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-31T16:52:23.287Z
Comments.Text: i would suggest local-contrast-normalization.
Comments.UserDisplayName: thecomplexitytheorist
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-01T08:47:55.610Z
Comments.Text: This question should be migrated to: https://datascience.stackexchange.com/.
Comments.UserDisplayName: JahKnows
Tags: <deep-learning><convolutional-neural-networks>
Title: Normalizing height data for CNN
UserDisplayName: iariav
ThreadText: # Normalizing height data for CNN
  
  (Asked by: username_0 on 2018-05-21)
  
  A task I’m working on at the moment requires a CNN with a height map as one of the inputs. This is a matrix of floating point values in which each point is the height of that point above sea level.
  
  I’m having trouble deciding how to normalize this data. I know there are networks that work on depth or distance data but that is different for several reasons:
  
  * Height can also be negative (as opposed to depth/distance which starts at 0)
  * Height has a very large range - can get values between -400 and +~9000.
  
  For these reasons the common approach to normalisation, simply subtracting the mean and dividing by the standard deviation, will result in the loss of information in most cases (all values will be close to zero).
  
  I thought of maybe subtracting the local mean for each input, rather than a general mean calculated from all the data, but I still don't know what to do with the standard deviation, since dividing by the local standard deviation can result in very “flat” and very “steep” inputs looking the same after normalization.
  
  **Tags:** deep-learning, convolutional-neural-networks
  > **Comments:**
  > **username_1**: Could you apply a log transformation to it? That would mean that the more frequent data points close to NN (sea level) would still have a good range, while the (presumably rarer?) extreme values would be compressed.  
  > **username_0**: Hi, thanks. I know that’s a common practice with depth/distance data but the problem as I mentioned is that my data can also be negative and log is undefined for non-positive values..  
  > **username_1**: As you're only using the log to compress the range of the data, could you not just log the magnitude? So that -250 becomes -2.397?  
  > **username_0**: that's an interesting idea but I think it's still problematic. let us say I'm working on a high altitude area. say 5000+. so all the small variations in height will be lost after I take the log. and if I take the same height structure to a low altitude place, say ~100, the representation will be very different.  
  > **username_2**: i would suggest local-contrast-normalization.  
  > **username_3**: This question should be migrated to: https://datascience.stackexchange.com/.  
  
  ---
  
  ## 0 answers
  
  