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
3 answers

Agumenting data in keras using albumentations

I am trying to train a keras ResNet50 model for image classification model using a tutorial. Instead of the inbuilt data generator, I want to use albumentations library for augmentation. from albumentations import Compose transforms =…
pkj
  • 559
  • 1
  • 9
  • 21
2
votes
1 answer

How to do data augmentation with tensorflow federated?

I'm hoping to explore how data augmentation work on federated learning, and I'm currently using tff to implement it. I notice that the datasets provide by tff is composed of tensors, and tensors cannot be adjusted directly, so a naive idea would be…
2
votes
2 answers

Randomly apply Keras `PreprocessingLayer`

Imgaug has a p parameter which defines a probability for how often a certain augmentation is applied e.g. in 50% of the inputs. Is there something similar for the Keras PreprocessingLayers? One example of such a layer is the RandomFlip. In imgaug…
mss
  • 348
  • 2
  • 12
2
votes
0 answers

Is there any possibility to use Custom layer trainable weight as a parameter for tensorflow addons function rotation?

What I want to do is learn my custom layer what is the best rotation for images of one domain. Im using tensorflow addons functions and want to pass weight value as parameter. There is my custom layer class RotationLayer(Layer): def __init__(self,…
2
votes
1 answer

How to stretch and squeeze an image in PyTorch?

I am working on MNIST Digit Data and looking for a way to either stretch or squeeze the image. The data is of the shape (28,28) and I want the final image to be of the same shape but either stretched or squeezed. Is there any way to do it using…
slothfulwave612
  • 1,349
  • 9
  • 22
2
votes
5 answers

Keras data augmentation pipeline for image segmentation dataset (image and mask with same manipulation)

I am building a preprocessing and data augmentation pipeline for my image segmentation dataset There is a powerful API from keras to do this but I ran into the problem of reproducing same augmentation on image as well as segmentation mask (2nd…
2
votes
0 answers

How do you do data augmentation for segmentation in PyTorch

I am trying to add augmentation to my data loader in torch. All of my example images have masks and none are blank. But when I add an augmentation like RandomRotation I find that some examples in my dataset then yield an image that has not labels…
nickponline
  • 25,354
  • 32
  • 99
  • 167
2
votes
1 answer

Keras RandomRotation layer produces black lines?

I'm trying to augment my image dataset with Keras RandomRotation. Here's the code: data_augmentation = tf.keras.Sequential([ keras.layers.experimental.preprocessing.RandomRotation( 0.5, fill_mode='reflect', …
mark mark
  • 306
  • 2
  • 13
2
votes
1 answer

How to change pre_processing function execution order for ImageDataGenerator at Keras?

I am using Keras's "ImageDataGenerator" class for data augmentation. Since the image has the bounding box of the relevant object, I want to crop the image to the relevant part before augmenting it. The class has an argument named…
2
votes
1 answer

Usage of Data Augmentation in Tensorflow 2

I am trying to use the new TensorFlow object detection API, released in June. But I am having some difficulties in using the data augmentation utils, provided by them. This is because they import a contrib.image from TensorFlow, which is only…
2
votes
0 answers

How to perform custom data augmentation using Tensorflow Object Detection API and tf.estimator?

I'm aware that they are already provided in model.config by using something like: data_augmentation_options { random_adjust_contrast { } } However, I need to perform my own data augmentation methods. Below is the current code I used to…
2
votes
2 answers

Keep same dataset augmentation for input and output in Tensorflow

I have a batch dataset which contains image as input and output. Code is like this: os.chdir(r'E:/trainTest') def process_img(file_path): img = tf.io.read_file(file_path) img = tf.image.decode_png(img, channels=3) img =…
2
votes
1 answer

Data Augmentation: What exactly does steps_per_epoch mean?

I am newbie to Deep Learning. I have one basic doubt. It might sound stupid for you. I am working on Road Extraction from Satellite Images. I have 1080 sample images only. That's why I applied Data Augmentation. Following is the code for Data…
2
votes
2 answers

In Colab doing image data augmentation with "imgaug" is not working as intended

I am augmenting my image data-set which also contains key-points. For this reason I am using imgaug library. Following is the augmentation code: kps = KeypointsOnImage(__keypoints, shape=_image.shape) seq = iaa.Sequential([ iaa.Affine( …
2
votes
1 answer

Keras ImageDataGenerator : how to use data augmentation with images paths

I am working on a CNN model and I would like to use some data augmentation, but two problems arise : My labels are images (my model is some kind of autoencoder, but the expected output images are different from my input images), thus I cannot use…
RandomGuy
  • 1,076
  • 6
  • 17