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
2
votes
1 answer

Train and test split set using ImageDataGenerator and flow

I'm trying to make a network using augmentation. First I use ImageDataGenerator with validation_split=0.2. train_generator = ImageDataGenerator( rotation_range=90, zoom_range=0.15, width_shift_range=0.2, height_shift_range=0.2, …
2
votes
0 answers

The effect of batch_size in ImageDataGenerator

I am new to Keras and am trying to do data augmentation but I am stuck at the start itself. I am having an image and I am trying to make augmentations of it as…
2
votes
1 answer

ValueError: Could not find a format to write the specified file in single-image mode

I am trying to read an image using skimage package, then crop it and then save it. Till cropping it works fine. While saving, it throws the below error ValueError: Could not find a format to write the specified file in single-image mode Below is…
2
votes
2 answers

How to use a cv2 image augmentation function with tensorflow tf.data.Dataset?

I am using tf.data.Dataset to create my dataset and training a CNN with keras. I need to apply masks on the images, and the mask depends on the shape of the image, there are no predefined pixel coordinates. When looking for an answer on the…
S.E.K.
  • 147
  • 2
  • 11
2
votes
1 answer

Data-augmentation generators not working with TensorFlow 2.0

I am trying to train model with image data-augmentation generators on TensorFlow 2.0, after downloading Kaggle's cats_vs_dogs dataset using below code. train_datagen = ImageDataGenerator(rescale=1. / 255, …
rahiakela
  • 21
  • 4
2
votes
1 answer

Keras: Altered ImageDataGenerator gives error "__init__() got an unexpected keyword argument"

I am using keras=2.3.1 and I wanted to use my own version of zca_whitening. For that, I made changes directly into the ImageDataGenerator class in the keras file…
NeStack
  • 1,739
  • 1
  • 20
  • 40
2
votes
1 answer

Python: time stretch wave files - comparison between three methods

I'm doing some data augmentation on a speech dataset, and I want to stretch/squeeze each audio file in the time domain. I found the following three ways to do that, but I'm not sure which one is the best or more optimized way: dimension =…
2
votes
2 answers

PyTorch Data Augmentation is taking too long

For the task that involves regression, I need to train my models to generate density maps from RGB images. To augment my dataset I have decided to flip all the images horizontally. For that matter, I also have to flip my ground truth images and I…
Bedir Yilmaz
  • 3,823
  • 5
  • 34
  • 54
2
votes
1 answer

Perform Augmentation (using ImageDataGenerator) and save augmented image as original name

I am applying augmentation to 493 classes and each class has 1 or 2 or 3 or 4 images (its not known 1 class may have only 1 image other may have 2 images). When I apply augmentation using ImageDataGenerator I get the augmented images but the name of…
2
votes
1 answer

Correct usage of ImageDataGenerator flow function

I am trying to use data augmentation for a regression model in Keras. Therefore I want to use the ImageDataGenerator class from Keras. Nearly all tutorials I can find on that task have a classification approach and thus use the method…
Codey
  • 1,131
  • 2
  • 15
  • 34
2
votes
1 answer

How to use the python method "ImageDataGenerator" and save the augmented images in a variable?

I'm constructing an augmented database to improve my CNN. The scheme is: I send an image, one per time, to generate another 40 images. The quoted method saves the augmented images in a directory, but I want to save them in a variable without saving…
Luan Souza
  • 159
  • 1
  • 1
  • 11
2
votes
1 answer

how to increase number of images with data augmentation

I'm trying to apply data augmentation with pytorch. In particular, I have a dataset of 150 images and I want to apply 5 transformations (horizontal flip, 3 random rotation ad vertical flip) to every single image to have 750 images, but with my code…
2
votes
1 answer

How to properly perform data-augmentation on MRI and prepare them for deep learning?

I'm trying to using deep learning (3D CNN) to perform brain disease classification. Currently, the input size is set to be 96*96*96. This is due to the original scan have a size of 256*256*256. I first removed the background by resizing to…
2
votes
1 answer

TensorFlow Object Detection API augmentations

I'm curious about the order of resizing and augmentations in the TensorFlow object detection API. For example, I'm using the config file ssd_mobilenet_v2_oid_v4.config. This uses fixed_shape_resizer and ssd_random_crop. So what is the interaction…
Austin
  • 6,921
  • 12
  • 73
  • 138
2
votes
2 answers

Data augmentation with Keras produces almost white images

I'm trying do do data augmentation with keras ImageDataGenerator. I'm pulling the images from a Dataframe containing the paths to the image in one column and the label in another one. For now, i'm only trying to flip the image horizontaly. But when…
Adriendod
  • 79
  • 5