Questions tagged [data-augmentation]

Data augmentation

Data augmentation is the technique of increasing the size of data used for training a model. It also helps in preventing overfitting.

Some of the most common data augmentation techniques for images include:

  • Scaling
  • Cropping
  • Flipping
  • Rotation
  • Color jittering
465 questions
5
votes
2 answers

Keras `ImageDataGenerator` image and mask augments differently

I'm training a semantic segmentation model using Keras with TensorFlow backend. I adopted ImageDataGenerator to do the image augmentation, including rotation, flip and shift. By following the documentation, I created a dictionary maskgen_args and…
5
votes
1 answer

How to fit Keras ImageDataGenerator for large data sets using batches

I want to use the Keras ImageDataGenerator for data augmentation. To do so, I have to call the .fit() function on the instantiated ImageDataGenerator object using my training data as parameter as shown below. image_datagen =…
C.S.
  • 161
  • 1
  • 1
  • 12
4
votes
1 answer

Is there a way to retrieve the specific parameters used in a random torchvision transform?

I can augment my data during training by applying a random transform (rotation/translation/rescaling) but I don't know the value that was selected. I need to know what values were applied. I can manually set these values, but then I lose a lot of…
4
votes
1 answer

Tensorflow random numbers in Data Augmentation map function

I want to use the crop_central function with a random float between 0.50-1.00 for data augmentation. However, when using numpy.random.uniform(0.50, 1.00) and plotting the images the crop is constant. I debugged this by using 4 images and plotting 8…
4
votes
1 answer

keras ImageDataGenerator interpolates binary mask

I am training a neural network to predict a binary mask on mouse brain images. For this I am augmenting my data with the ImageDataGenerator from keras. But I have realized that the Data Generator is interpolating the data when applying spatial…
Jimmy2027
  • 313
  • 3
  • 10
4
votes
1 answer

How to convert Tensor to numpy array inside a map function using tf.py_function

I am trying to create an image augmentation pipeline for an object detection network, where my training examples are augmented as they go into the network. The images and the bounding boxes need to be augmented, but the standard tf.image methods…
4
votes
1 answer

How to create noisy images for data augmentation

I followed the most upvoted answer to a question regarding adding noise to an image. However it doesn't work for me. I just want to observe different noise effects on image while using Python How to add noise (Gaussian/salt and pepper etc) to image…
4
votes
2 answers

Keras ImageDataGenerator with center crop for rotation and translation shift

I need to do data augmentation but not with any fill modes, constant, reflect, nearest, wrap. Instead everytime the image is rotated or translated, I would like to have it center-cropped (shown below) so as not have any black, white, reflected, or…
Saravanabalagi Ramachandran
  • 8,551
  • 11
  • 53
  • 102
3
votes
1 answer

How to use detectron2's augmentation with datasets loaded using register_coco_instances

I've trained a detectron2 model on custom data I labeled and exported in the coco format, but I now want to apply augmentation and train using the augmented data. How can I do that if I'm not using a custom DataLoader, but the…
3
votes
0 answers

Data Augmentation with tf.data

I'd like to incorporate Data Augmentation with tf.data into my tf.data pipeline. For applying data augmentation I'm using TenserFlow's preprocessing module and Sequential class. When incorporating a series of data augmentation operations into my…
3
votes
0 answers

Data Augmentation to increase the dataset size

So here I want to apply augmentation to a dataset of images to increase the size of the Dataset but I keep getting error. Here is the code : **from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img import…
Fatema
  • 31
  • 1
3
votes
3 answers

How to combine successive rows with an increasing overlap between them (just like a rolling window)?

I am currently starting to learn Pandas and struggling to do a task with it. What I am trying to do is to augment the data stored in a dataframe by combining two succesive rows with an increasing overlap between them. Just like a rolling window. I…
Javier TG
  • 465
  • 2
  • 7
  • 15
3
votes
1 answer

Keras Data Augmentation with ImageDataGenerator (Your input ran out of data)

I am currently learning how to perform data augmentation with Keras ImageDataGenerator from "Deep learning with Keras" by François Chollet. I now have 1000 (Dogs) & 1000 (Cats) images in training dataset. I also have 500(Dogs) & 500(Cats) images in…
3
votes
1 answer

How to augment data in a Tensorflow Dataset?

For a set of images, I was confused if the term Data Augmentation meant to transform the current dataset (e.g. crop/flip/rotate/...) or if it meant to increase the amount of data by adding the cropped/flipped/rotated images to the initial dataset.…
Begoodpy
  • 1,018
  • 3
  • 8
  • 20
3
votes
1 answer

Augmenting Time Series Data for Deep Learning

If I want to apply deep learning to the dataset from the sensors that I currently possess, I would require quite a lot data, or we may see overfitting. Unfortunately, the sensors have only been active for a month and therefore the data requires…
SDG
  • 2,260
  • 8
  • 35
  • 77
1
2
3
30 31