0
$\begingroup$

I'm reading about contrastive learning paper, they use data augmentation as method.

By the way, I have some questions about data augmentation. What is color dropping?

color jittering is changing HSL(Hue, saturation, lightness) on image. But I don't know color dropping.

I search on google, but it doesn't help. I assumed color dropping as ...

  1. bluring?
  2. remove color on image? then show as grayscale or binary image?
  3. add some colored water drops on image? like raining windows which rain contained color water.
  4. change the color some part on image?
  5. change a image as pointillism art?

I really don't know color dropping on data augmentation. could you help me?

Thank you.

$\endgroup$
4
  • 1
    $\begingroup$ Could you link the paper related to your question? $\endgroup$ Jul 23, 2023 at 17:33
  • $\begingroup$ @LucaAnzalone Sure. I give a paper's title by ISO 690 format, I recommand to search [google scholar](scholar.google.co.kr). 1. CHEN, Ting, et al. A simple framework for contrastive learning of visual representations. In: International conference on machine learning. PMLR, 2020. p. 1597-1607. they reference second paper's title, but That couldn't search with "color drop" 2. HOWARD, Andrew G. Some improvements on deep convolutional neural network based image classification. arXiv preprint arXiv:1312.5402, 2013. It cannot find about "color drop" $\endgroup$
    – Yang
    Jul 24, 2023 at 2:56
  • $\begingroup$ @LucaAnzalone 3. HENAFF, Olivier. Data-efficient image recognition with contrastive predictive coding. In: International conference on machine learning. PMLR, 2020. p. 4182-4192. They reference fourth paper's title, but I couldn't understand fourth paper's key sentence yet. $\endgroup$
    – Yang
    Jul 24, 2023 at 2:57
  • $\begingroup$ @LucaAnzalone 4. DOERSCH, Carl; GUPTA, Abhinav; EFROS, Alexei A. Unsupervised visual representation learning by context prediction. In: Proceedings of the IEEE international conference on computer vision. 2015. p. 1422-1430. They said "An alternative approach is to randomly drop 2 of the 3 color channels from each patch('color dropping'), replacing the dropped colors with gaussian noise" on 4th page in pdf, or 1425 page in paper. I think this is key sentense, but still confused what's the meaning of the drop in this sentense. there are any existed example pictures, so I am confused. $\endgroup$
    – Yang
    Jul 24, 2023 at 2:57

1 Answer 1

1
$\begingroup$

By dropping color channels, they mean replacing the color channel with noise.

For example:

import numpy as np
import cv2
import matplotlib.pyplot as plt

test_image_path = '4.2.07.tiff' # peppers from https://sipi.usc.edu/database/database.php

# read image
img = cv2.imread(test_image_path, cv2.IMREAD_COLOR)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = img.astype(float)
img = (img / 255.0) - 0.5
plt.imshow(img + 0.5)

Original peppers image

Then dropping channels (the output will vary based on how the parameters of the gaussian noise):

# keep the first channel, drop the other two
img[:, :, 1] = np.random.normal(0, 0.1, (img.shape[:2]))
img[:, :, 2] = np.random.normal(0, 0.1, (img.shape[:2]))
plt.imshow(img + 0.5)

Peppers image with second and third channel dropped

$\endgroup$
1
  • $\begingroup$ Thank you so much! I understand with examples. $\endgroup$
    – Yang
    Jul 26, 2023 at 5:49

Not the answer you're looking for? Browse other questions tagged .