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
1
vote
0 answers

Pytorch: Segmentation model's dice score is not improving if i use augmentation

I am doing a brain MRI segmentation task using Unet model. My problem is it does no matter what transformation i use during training my val dice score after few epochs stucks around 77% score. I already have a successfuly trained model with 93% dice…
1
vote
1 answer

PyTorch: Visualize image batch from DataLoader

I have a dataset containing a single image and I am simply applying the YOCO technique to visualize images generated by YOCO. I just get a single output sometimes the output is the same image as the input and sometimes flip+cut. I have no idea why…
Khawar Islam
  • 2,556
  • 2
  • 34
  • 56
1
vote
1 answer

Why is seeding mandatory for stateless random flipping in tensorflow image operations?

I am implementing custom data augmentation layer in my model where I am trying to use the function tf.image.stateless_random_flip_left_right. Tensorflow Documentation says this function can, Randomly flip an image horizontally (left to right)…
1
vote
0 answers

Tensorflow Object Detection (TFOD), data augmentation error: image_size must contain 3 elements

I use a TFOD object detection framework, and visualize all data augmentation functions. There are several functions, that throw the exception: InvalidArgumentError: image_size must contain 3 elements[1] [Op:SampleDistortedBoundingBoxV2] These…
1
vote
0 answers

Detectron2: Custom Data Augmentation Implementation

I am working on an underwater image detection problem using detection2. I have applied an image enhancement augmentation offline (by storing the newly processed data in a separate folder). But I need to apply the image enhancement on the fly, such…
1
vote
0 answers

Data augmentation with tf.keras throwing "no such file or directory" error at for loop with .flow()

I am currently writing a script to augment a dataset for me using tf.keras (code given below). I'm pretty new to tf and data augmentation so I've been following a tutorial (https://blog.devgenius.io/data-augmentation-programming-e9a4703198be) pretty…
1
vote
0 answers

Random flip and reverse flip in GAN inside the Model

I would like to use tensorflows random flip to train the generator part of a gan network only. For that i would like a way to either flip the image randomly at the begining of the model and the end. I don't want to augment the dataset because right…
1
vote
0 answers

Issue by adding gaussian noise to an image because of white background

I am using skimage to perfom some random noise to my images in order to perform data augmentation, but while im doing it im adding noise to the white background. How could I exclude the background from the computation? The following lines of code…
1
vote
0 answers

AttributeError: 'NoneType' object has no attribute 'shape' in data augmentaton

I am trying to make data augmentation for my semantic segmentation task but i got this error , could any one help me. this error appear in the line of augmented = aug(image=x, mask=y) I am trying to make data augmentation for my semantic…
1
vote
1 answer

Apply a transformation model (data augmentation) in images in Tensorflow

I am a newbie in some sequential models in Tensorflow with Python. I have a transformation sequential model like the one below. It applies randomly to a given image input some operations with random parameters. import tensorflow as tf from…
mad
  • 2,677
  • 8
  • 35
  • 78
1
vote
1 answer

Type error on Python: not all arguments converted during string formatting

i am trying to multiply the image for image data set using pytorch random transform. the code used to work however today it seems to produce error for formatting. the loop for the data into a larger sample. or _ in range(80): for img, label in…
haeliezer
  • 13
  • 4
1
vote
3 answers

How to rotate a rectangle/bounding box together with an image

I'm working on a data augmentation and im trying to generate synthetic version of every image in my dataset. So i need to rotate images and together with bounding boxes as well in the images. im only going to rotate images by 90, 180, 270…
1
vote
1 answer

No val_loss and val_accuracy keys when I've already had validation_data in model.fit()'s argument

Here's the image augmentation code: batch_size = 16 train_datagen = ImageDataGenerator(rescale=1./255, validation_split=0.2) # test_datagen = ImageDataGenerator(rescale=1./255) # Use flow from dataframe train_generator =…
1
vote
1 answer

How to fix failed assertion `output channels should be divisible by group' when trying to fit the model in Keras?

I'm trying to use ImageDataGenerator() for my image datasets. Here is my image augmentation code: batch_size = 16 train_datagen = ImageDataGenerator( rescale=1./255, shear_range=0.2, zoom_range=0.2, …
1
vote
3 answers

How to add data augmentation with albumentation to image classification framework?

I am using pytorch for image classification using this code from github. I need to add data augmentation before training my model, I chose albumentation to do this. here is my code when I add albumentation: data_transform = { "train":…