Answers.Body: <p>Neil is right, data augmentation is suppose to add data that respect the same distribution as the original data.</p>
  <p>Grayscale is a linear combination of individual channel, therefore the single channels have different distributions (histograms) compared to their combination. And that is always gonna be the case, and unfortunately there's no work around to it, the only way would be to match the single channel histograms to the grayscale one, but then you'll end up with 3 copies of the same image.</p>
  <p>You can easily check the differences with this code snippet.</p>
  <p><a href="https://i.sstatic.net/omgOm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/omgOm.png" alt="enter image description here" /></a></p>
  <pre><code>import numpy as np
  import skimage as sk
  import matplotlib.pyplot as plt
  
  
  def plot_hist():
      img = sk.data.chelsea()
  
      red = img[:, :, 0]
      green = img[:, :, 1]
      blue = img[:, :, 2]
  
      gray_crt = 0.2125 * red + 0.7154 * green + 0.0721 * blue
      gray_avg = img.mean(axis=2)
  
      fig, ax = plt.subplots(2, 3)
  
      bins = np.arange(-0.5, 255 + 1, 1)
      ax[0, 0].imshow(img)
      ax[0, 1].hist(gray_crt.flatten(), bins=bins, color=&quot;k&quot;)
      ax[0, 2].hist(gray_avg.flatten(), bins=bins, color=&quot;k&quot;)
  
      colors = [&quot;r&quot;, &quot;g&quot;, &quot;b&quot;]
      for c in range(img.shape[2]):
          ax[1, c].hist(img[:, :, c].flatten(), bins=bins, color=colors[c])
      plt.show()
  
  
  if __name__ == &quot;__main__&quot;:
      plot_hist()
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-05T08:46:51.690Z
Answers.LastActivityDate: 2022-04-05T08:46:51.690Z
Answers.UserDisplayName: Edoardo Guerriero
Body: <p>Suppose there is a ML network that takes grayscale images as the input. The images that I have are RGB images. So, instead of converting these RGB images to grayscale, I treat each individual colour bands as distinct inputs to the network. that is, instead of feeding RGB image A to the network, I feed the R matrix of A as the first input, followed by the G matrix and then the B matrix. This leads to 3 times more data for the network. Can this be considered as data augmentation (since we are increasing the amount of data)? If yes, what is the name of this data augmentation technique?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-05T07:32:58.950Z
Comments.Text: I doubt it has a name. In your example, how close are the separate channel images to the target population where the network will be used to make predictions?
Comments.UserDisplayName: Neil Slater
Tags: <image-processing><data-augmentation>
Title: Is using separate channels of a RBG image a valid data augmentation technique?
UserDisplayName: user7080
ThreadText: # Is using separate channels of a RBG image a valid data augmentation technique?
  
  (Asked by: username_0 on 2022-04-05)
  
  Suppose there is a ML network that takes grayscale images as the input. The images that I have are RGB images. So, instead of converting these RGB images to grayscale, I treat each individual colour bands as distinct inputs to the network. that is, instead of feeding RGB image A to the network, I feed the R matrix of A as the first input, followed by the G matrix and then the B matrix. This leads to 3 times more data for the network. Can this be considered as data augmentation (since we are increasing the amount of data)? If yes, what is the name of this data augmentation technique?
  
  **Tags:** image-processing, data-augmentation
  > **Comments:**
  > **username_1**: I doubt it has a name. In your example, how close are the separate channel images to the target population where the network will be used to make predictions?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-04-05. Score: 1
  
  Neil is right, data augmentation is suppose to add data that respect the same distribution as the original data.
  Grayscale is a linear combination of individual channel, therefore the single channels have different distributions (histograms) compared to their combination. And that is always gonna be the case, and unfortunately there's no work around to it, the only way would be to match the single channel histograms to the grayscale one, but then you'll end up with 3 copies of the same image.
  You can easily check the differences with this code snippet.
  
  import numpy as np
  import skimage as sk
  import matplotlib.pyplot as plt
  
  
  def plot_hist():
      img = sk.data.chelsea()
  
      red = img[:, :, 0]
      green = img[:, :, 1]
      blue = img[:, :, 2]
  
      gray_crt = 0.2125 * red + 0.7154 * green + 0.0721 * blue
      gray_avg = img.mean(axis=2)
  
      fig, ax = plt.subplots(2, 3)
  
      bins = np.arange(-0.5, 255 + 1, 1)
      ax[0, 0].imshow(img)
      ax[0, 1].hist(gray_crt.flatten(), bins=bins, color="k")
      ax[0, 2].hist(gray_avg.flatten(), bins=bins, color="k")
  
      colors = ["r", "g", "b"]
      for c in range(img.shape[2]):
          ax[1, c].hist(img[:, :, c].flatten(), bins=bins, color=colors[c])
      plt.show()
  
  
  if __name__ == "__main__":
      plot_hist()
  
  
  ---
  
  