Coder Social home page Coder Social logo

deepaugment's Introduction

DeepAugment

DOI

pypi License: MIT Code style: black

DeepAugment discovers augmentation strategies tailored for your images. It uses Bayesian Optimization for optimizing data augmentation hyperparameters. The tool:

  1. reduces error rate of CNN models (shown 60% decrease in error for CIFAR-10 on WRN-28-10 compared to no augmentation)
  2. saves time by automating the process

Resources: blog post, slides

Installation/Usage

Tutorial: google-colab

$ pip install deepaugment

Simple usage (with any dataset)

from deepaugment.deepaugment import DeepAugment

deepaug = DeepAugment(my_images, my_labels)

best_policies = deepaug.optimize(300)

Simple usage (with CIFAR-10 on keras)

deepaug = DeepAugment("cifar10")

best_policies = deepaug.optimize(300)

Advanced usage

from keras.datasets import fashion_mnist

# my configuration
my_config = {
    "model": "basiccnn",
    "method": "bayesian_optimization",
    "train_set_size": 2000,
    "opt_samples": 3,
    "opt_last_n_epochs": 3,
    "opt_initial_points": 10,
    "child_epochs": 50,
    "child_first_train_epochs": 0,
    "child_batch_size": 64
}

(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()
# X_train.shape -> (N, M, M, 3)
# y_train.shape -> (N)
deepaug = DeepAugment(iamges=x_train, labels=y_train, config=my_config)

best_policies = deepaug.optimize(300)

Results

CIFAR-10 best policies tested on WRN-28-10

  • Method: Wide-ResNet-28-10 trained with CIFAR-10 augmented images by best found policies, and with unaugmented images (everything else same).
  • Result: 60% reduction in error (8.5% accuracy increase) by DeepAugment

Design goals

DeepAugment is designed as a scalable and modular partner to AutoAugment (Cubuk et al., 2018). AutoAugment was one of the most exciting publications in 2018. It was the first method using Reinforcement Learning for this problem. AutoAugmentation, however, has no complete open-sourced implementation (controller module not available) preventing users to run it for their own datasets, and takes 15,000 iterations to learn (according to paper) augmentation policies, which requires massive computational resources. Thus most people could not benefit from it even if its source code would be fully available.

DeepAugment addresses these two problems. Its main design goals are:

  1. minimize the computational complexity of optimization while maintaining quality of results
  2. be modular and user-friendly

First goal is achieved by following changes compared to AutoAugment:

  1. Bayesian Optimization instead of Reinforcement Learning
    • which requires much less number of iterations (~100 times)
  2. Minimized Child Model
    • decreasing computational complexity of each training (~20 times)
  3. Less stochastic augmentation search space design
    • decreasing number of iterations needed

For achieving the second goal, user interface is designed in a way that it gives user broad configuration possibilities and model selections (e.g. selecting the child model or inputting a self-designed child model).

Importance

Practical importance

DeepAugment makes optimization of data augmentation scalable, and thus enables users to optimize augmentation policies without needing massive computational resources. As an estimate of its computational cost, it takes 4.2 hours (500 iterations) on CIFAR-10 dataset which costs around $13 using AWS p3.x2large instance.

Academic importance

To our knowledge, DeepAugment is the first method which utilizes Bayesian Optimization for the problem of data augmentation hyperparameter optimization.

How it works

Three major components of DeepAugment are controller, augmenter, and child model. Overall workflow is that controller samples new augmentation policies, augmenter transforms images by the new policy, and child model is trained from scratch by augmented images. Then, a reward is calculated from child model's training history. This reward is returned back to the controller, and it updates its surrogate model with this reward and associated augmentation policy. Then, controller samples new policies again and same steps repeats. This process cycles until user-determined maximum number of iterations reached.

Controller can be set for using either Bayesian Optimization (default) or Random Search. If set to Bayesian Optimization, samples new policies by a Random Forest Estimator and Expected Improvement acquisition function.

simplified_workflow

Why Bayesian Optimization?

In hyperparameter optimization, main choices are random search, grid search, bayesian optimization (BO), and reinforcement learning (RL) (in the order of method complexity). Google's AutoAugment uses RL for data augmentation hyperparameter tuning, but it takes 15,000 iterations to learn policies (which means training the child CNN model 15,000 times). Thus, it requires massive computational resources. Bayesian Optimization on the other hand learns good polices in 100-300 iterations, making it +40X faster. Additionally, it is better than grid search and random search in terms of accuracy, cost, and computation time in hyperparameter tuning(ref) (we can think optimization of augmentation policies as a hyperparameter tuning problem where hyperparameters are concerning with augmentations instead of the deep learning architecture). This result is not surprising since despite Grid Search or Random Search BO selects new hyperparameter as informed with previous results for tried hyperparameters.

optimization-comparison

How does Bayesian Optimization work?

Aim of Bayesian Optimization (BO) is finding set of parameters which maximize the value of an objective function. It builds a surrogate model for predicting value of objective function for unexplored parameters. Working cycle of BO can be summarized as:

  1. Build a surrogate model of the objective function
  2. Find parameters that perform best on the surrogate (or pick random hyperparameters)
  3. Execute objective function with these parameters
  4. Update the surrogate model with these parameters and result (value) of objective function
  5. Repeat steps 2-4 until maximum number of iterations reached

For more detailed explanation, read this blogpost explaining BO in high-level, or take a glance at this review paper

Augmentation policy

A policy describes the augmentation will be applied on a dataset. Each policy consists variables for two augmentation types, their magnitude and the portion of the data to be augmented. An example policy is as following:

example policy

There are currently 20 types of augmentation techniques (above, right) that each aug. type variable can take. All techniques are (this list might grow in later versions):

AUG_TYPES = [ "crop", "gaussian-blur", "rotate", "shear", "translate-x", "translate-y", "sharpen", "emboss", "additive-gaussian-noise", "dropout", "coarse-dropout", "gamma-contrast", "brighten", "invert", "fog", "clouds", "add-to-hue-and-saturation", "coarse-salt-pepper", "horizontal-flip", "vertical-flip"]

Child model

source

Child model is trained over and over from scratch during the optimization process. Its number of training depends on the number of iterations chosen by the user, which is expected to be around 100-300 for obtaining good results. Child model is therefore the computational bottleneck of the algorithm. With the current design, training time is ~30 seconds for 32x32 images on AWS instance p3.x2large using V100 GPU (112 TensorFLOPS). It has 1,250,858 trainable parameters for 32x32 images. Below is the diagram of child model: child-cnn

Other choices for child CNN model

Standard Child model is a basic CNN where its diagram and details given above. However, you are not limited with that model. You can use your own keras model by assigning it into config dictionary as:

my_config = {"model": my_keras_model_object}
deepaug = DeepAugment(my_images, my_labels, my_config)

Or use an implemented small model, such as WideResNet-40-2 (while it is bigger than Basic CNN):

my_config = {"model": "wrn_40_2"} # depth(40) and wideness-factor(2) can be changed. e.g. wrn_20_4

Or use a big model (not recommended unless you have massive computational resources):

my_config = {"model": "InceptionV3"}
my_config = {"model": "MobileNetV2"}

Reward function

source

Reward function is calculated as mean of K highest validation accuracies of the child model which is not smaller than corresponding training accuracy by 0.05. K can be determined by the user by updating opt_last_n_epochs key in config as argument to DeepAugment() class (K is 3 by default).

Configuration options

DeepAugment can be given a config dictionary during initialization. It is expected to have following keys:

  • model: child model type. Options: "basiccnn", "inceptionv3", "mobilenetv2", "wrn__", or keras.models.Model object
  • method: "bayesian_optimization" or "random" (for random search)
  • train_set_size: size of the training set during optimization. It should be small enough that computation will not take too long.
  • opt_samples: number of samples optimizer will run for each augmentation-policy. Training of the child model is stochastic and validation accuracy results might be slightly different from run to run. The tool trains child model three times by default and takes average, in order to have more robust accuracy results.
  • opt_last_n_epochs: number of non-overfitting epochs whose validation accuracy average will be used as reward. For each training, opt_last_n_epochs highest validation accuracies (where its difference to training accuracy is not more than 10%) are averaged and taken as reward.
  • opt_initial_points: number of random initial policies will be tried by Bayesian Optimizer. It will be the n_initial_points argument for skopt Optimizer (see its documentation)
  • child_epochs: number of epochs for the child model
  • child_first_train_epochs: if not 0, child model is pre-trained without any augmentation and its resulting weights are load for each training with augmentation. The purpose is training child model 10-20 epochs once and thereby saving 10-20 epochs for each training of optimizer iterations which is +100 times.
  • child_batch_size: batch size for the child model
  • per_aug_weights_path: path for pre-augmented training weights. Unneccessary if child_first_train_epochs=0
  • logging: logging object for getting news about the optimization.
  • notebook_path: path for recording all trainings in all iterations. For each iteration, training history, trial-no, sample-no, calculated reward and mean recent validation accuracy is recorded. Records is updated at each trial for ensuring records are not lost in case optimization interrupted unintentionally. Records can be found at "/reports/experiments//notebook.csv"

Default configurations are as following:

DEFAULT_CONFIG = {
    "model": "basiccnn", # 
    "method": "bayesian_optimization",
    "train_set_size": 2000,
    "opt_samples": 3,
    "opt_last_n_epochs": 3,
    "opt_initial_points": 10,
    "child_epochs": 50,
    "child_first_train_epochs": 0,
    "child_batch_size": 64,
    "pre_aug_weights_path": "pre_aug_weights.h5",
    "logging": logging,
    "notebook_path": f"{EXPERIMENT_FOLDER_PATH}/notebook.csv",
}

Versioning rules

A three-number system is used, like 1.2.3. Each increment of version is one of the following types:

  • minor: if bugs are fixed, or documentation changed significantly. 1.2.3 -> 1.2.4
  • major: if a feature implemented differently, or a new feature added. 1.2.3 -> 1.3.0
  • disruptive: if a feature is removed or renamed. 1.2.3 -> 2.0.0 (Backward compatibility is not guaranteed)

Note: Versions from 0.0.0 to 1.0.0 are considered as alpha phase and do not follow this strategy.

Data pipeline

data-pipeline-2

data-pipeline-1

Class diagram

Created by pyreverse classes_deepaugment

Package diagram

Created by pyreverse package-diagram

References

[1] Cubuk et al., 2018. AutoAugment: Learning Augmentation Policies from Data (arxiv)

[2] Zoph et al., 2016. Neural Architecture Search with Reinforcement Learning (arxiv)

[3] Shahriari et al., 2016. A review of Bayesian Optimization (ieee)

[4] Dewancker et al. Bayesian Optimization Primer (white-paper)

[5] DeVries, Taylor 2017. Improved Regularization of CNN's with Cutout (arxiv)

Blogs:

  • A conceptual explanation of Bayesian Optimization (towardsdatascience)
  • Comparison experiment: Bayesian Opt. vs Grid Search vs Random Search (mlconf)

Libraries:


Contact

Baris Ozmen, [email protected]

deepaugment's People

Contributors

barisozmen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deepaugment's Issues

Explore raw data

Do an explorative analysis on jupyter notebook and put it to /notebooks/explore-raw-data

Notebook should iterate followings:

  1. Explore raw training data from DOTA, and report followings:

    • Distribution of ground sample distances (gsd) of images
    • Distribution of image sources (GoogleEarth or others)
    • Frequency of each object type across all images
    • Number of objects per image
    • Co-occurrences and mutual exclusivity of object types across images
    • Are images augmented?
  2. Show some image samples

  3. Write an overall summary of explorative analysis. And add necessary information from DOTA paper in it.

Use black code formetter

https://github.com/ambv/black

black formats code in PEP 8 style:

Black ignores previous formatting and applies uniform horizontal and vertical whitespace to your code. The rules for horizontal whitespace can be summarized as: do whatever makes pycodestyle happy. The coding style used by Black can be viewed as a strict subset of PEP 8.

Required Dependencies

Hello my friend,

Wich version of Tensorflow is needed?
(For GPU support)
Wich Python Version works best?

pip install doesn't work

Explore 16 data transformation with PIL

They are listed here:

'''
def ShearX(img, v): # [-0.3, 0.3]
return img.transform(img.size, PIL.Image.AFFINE, (1, v, 0, 0, 1, 0))

def ShearY(img, v): # [-0.3, 0.3]
return img.transform(img.size, PIL.Image.AFFINE, (1, 0, 0, v, 1, 0))

def TranslateX(img, v): # [-150, 150] => percentage: [-0.45, 0.45]
v = v*img.size[0]
return img.transform(img.size, PIL.Image.AFFINE, (1, 0, v, 0, 1, 0))

def TranslateY(img, v): # [-150, 150] => percentage: [-0.45, 0.45]
v = v*img.size[1]
return img.transform(img.size, PIL.Image.AFFINE, (1, 0, 0, 0, 1, v))

def Rotate(img, v): # [-30, 30]
return img.rotate(v)

def AutoContrast(img, _):
return PIL.ImageOps.autocontrast(img)

def Invert(img, _):
return PIL.ImageOps.invert(img)

def Equalize(img, _):
return PIL.ImageOps.equalize(img)

def Flip(img, _): # not from the paper
return PIL.ImageOps.mirror(img)

def Solarize(img, v): # [0, 256]
return PIL.ImageOps.solarize(img, v)

def Posterize(img, v): # [4, 8]
v = int(v)
return PIL.ImageOps.posterize(img, v)

def Contrast(img, v): # [0.1,1.9]
return PIL.ImageEnhance.Contrast(img).enhance(v)

def Color(img, v): # [0.1,1.9]
return PIL.ImageEnhance.Color(img).enhance(v)

def Brightness(img, v): # [0.1,1.9]
return PIL.ImageEnhance.Brightness(img).enhance(v)

def Sharpness(img, v): # [0.1,1.9]
return PIL.ImageEnhance.Sharpness(img).enhance(v)

def Cutout(img, v): # [0, 60] => percentage: [0, 0.2]
w, h = img.size
v = v*img.size[0]
x0 = np.random.uniform(w-v)
y0 = np.random.uniform(h-v)
xy = (x0, y0, x0+v, y0+v)
color = (127, 127, 127)
img = img.copy()
PIL.ImageDraw.Draw(img).rectangle(xy, color)
return img

def SamplePairing(imgs): # [0, 0.4]
def f(img1, v):
i = np.random.choice(len(imgs))
img2 = PIL.Image.fromarray(imgs[i])
return PIL.Image.blend(img1, img2, v)
return f
'''

deepAugment for regression

Is it possible to add simply add ChildCNN for regression - using MSE instead of accuracy? Or will that also require change to the Controller?

Dropout Cause significant performance change between each trainning

Using Dropout in child_model shows great works on prevent overfitting, however it also cause the final performance on model change significantly during each training with same hyper-params. It is too random that cause that we need using more sampling times to estimate final performance on one hyper-params which is very time consuming. Any ideal for solving this problem.

Build data processing pipeline v0.1

Data preprocess should be like:

  1. Remove images having width or height less than 608*
  2. Split images using SplitImg.py module of DOTA_devkit, where subsize=608 and gap=0.
  3. Remove any image whose after-split dimensions are not order of 608
  4. Convert oriented bounding boxes (OBB) to horizontal bounding boxes (HBB)

For pipeline v0.1, only use 20 images for training set, where 10 of them having "planes" in it. All images from test set. MVP targets only to detect planes.

Unable to run with fashion_mnist

Hi,

Could you please explain about sample script that use fashion_mnist dataset
As I know, fashion_mnist is gray dataset, how convert to to 3 channel images as requirement ?

#below is code i used:

from keras.datasets import fashion_mnist
from deepaugment.deepaugment import DeepAugment
my_config = {
"model": "basiccnn",
"method": "bayesian_optimization",
"train_set_size": 2000,
"opt_samples": 3,
"opt_last_n_epochs": 3,
"opt_initial_points": 10,
"child_epochs": 50,
"child_first_train_epochs": 0,
"child_batch_size": 64
}
(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()
X_train = x_train.reshape(x_train.shape[0], x_train.shape[1], x_train.shape[2], 1)
deepaug = DeepAugment(images=X_train, labels=y_train, config=my_config)
best_policies = deepaug.optimize(300)

I have tried to reshape X_train = x_train.reshape(x_train.shape[0], x_train.shape[1], x_train.shape[2], 3), but it cann't
The error I faced

0, 0.1327777779367234, ['rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0]
trial: 1
['gamma-contrast', 0.8442657485810175, 'coarse-salt-pepper', 0.8472517387841256, 'brighten', 0.38438170729269994, 'translate-y', 0.056712977317443194, 'translate-y', 0.47766511732135, 'add-to-hue-and-saturation', 0.47997717237505744, 'emboss', 0.8360787635373778, 'sharpen', 0.6481718720511973, 'emboss', 0.9571551589530466, 'rotate', 0.8700872583584366]
/home/kaka/PycharmProjects/DeepAugment /venv/lib/python3.6/site-packages/imgaug/augmenters/color.py:448: UserWarning: Received an image with shape (H, W, C) and C=1 in ChangeColorspace._augment_image(). Expected C to usually be 3 -- any other value will likely result in errors. (Note that this function is e.g. called during grayscale conversion and hue/saturation changes.)
"changes.)" % (image.shape[2],)

Loss turns into 'nan'

I'm experimenting with wrn-16-8 (WideResNet) at this repo. During training, loss suddenly turned into nan. I guess it's a numerical calculation problem.

screen shot 2019-02-03 at 12 29 36 am

"notebook.csv" format is different

Hi, thank you for sharing this code!
I have training on my own data with the following code:


cnn_config = {"model":model,
"child_batch_size": 32,
"child_epochs": 50}
deepaug = DeepAugment(images=x_train, labels=y_train, config=cnn_config)
best_policies = deepaug.optimize(100)


The columns names in the CSV file are different from the names of the columns that you display on "notebooks/result-analyses/*".

My columns names are:
acc | loss | val_acc | val_loss | trial_no | A_aug1_type | A_aug1_magnitude | A_aug2_type | A_aug2_magnitude | B_aug1_type | B_aug1_magnitude | B_aug2_type | B_aug2_magnitude | C_aug1_type | C_aug1_magnitude | C_aug2_type | C_aug2_magnitude | D_aug1_type | D_aug1_magnitude | D_aug2_type | D_aug2_magnitude | E_aug1_type | E_aug1_magnitude | E_aug2_type | E_aug2_magnitude | sample_no | mean_late_val_acc | epoch

while yours are:
acc | loss | val_acc | val_loss | trial_no | aug1_type | aug1_magnitude | aug2_type | aug2_magnitude | aug3_type | aug3_magnitude | portion | sample_no | mean_late_val_acc

Do I have to run more code lines to get the same file as yours?

Compatibily with Tensorflow 1.13.x

I've just discovered your projet and I would like to add it in my ML pipeline using Tensorflow 1.13.1 but the requirement of my projet doesn't match yours. Is it planned to support an upper version of Tensorflow ?

Thanks !

list index out of range when using child_first_train_epochs

When setting child_first_train_epochs (I tried with 15 and 20), the following error occurs after training 'child_first_train_epochs' number of epochs:

Traceback (most recent call last):
  File "run_deepaugment.py", line 51, in <module>
    deepaug = DeepAugment(images=x_train, labels=y_train.reshape(TRAIN_SET_SIZE, 1), config=my_config)
  File "/home/ec2-user/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/deepaugment/lib/decorators.py", line 106, in wrapper
    return func(*args, **kwargs)
  File "/home/ec2-user/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/deepaugment/deepaugment.py", line 120, in __init__
    self._do_initial_training()
  File "/home/ec2-user/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/deepaugment/deepaugment.py", line 202, in _do_initial_training
    -1, ["first", 0.0, "first", 0.0, "first", 0.0, 0.0], 1, None, history
  File "/home/ec2-user/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/deepaugment/notebook.py", line 38, in record
    new_df["B_aug2_magnitude"] = trial_hyperparams[7]
IndexError: list index out of range

Here is my config used:

my_config = {
    'model': 'wrn_16_2',
    'train_set_size': int(TRAIN_SET_SIZE*0.75),
    'child_epochs': 60,
    'child_batch_size': 64,
    'child_first_train_epochs': 20,
    'opt_samples': 1,
}

Where TRAIN_SET_SIZE is a custom dataset of 3000 examples
The code runs fine if I omit the child_first_train_epochs setting

monitor progress

HI @barisozmen thanks for sharing the code for deepaugment
I would like to try this on my dataset.
which value would you recommend to monitor on?
have you considered to implement tensorboard/ tensorboardX in the code for easy validate of the process?

thanks!

AssertionError when do augment policy

I write a simple script like this:

import os
from deepaugment import DeepAugment
from keras.datasets import cifar10

(x_train, y_train), (x_test, y_test) = cifar10.load_data()
deepaug = DeepAugment(x_train, y_train)
best_policies = deepaug.optimize(300)

after run it, about one minute, I got a AssertionError:

...
...
Epoch 48/50
 - 1s - loss: 0.2101 - acc: 0.9382 - val_loss: 2.6119 - val_acc: 0.5540
Epoch 49/50
 - 1s - loss: 0.2101 - acc: 0.9347 - val_loss: 2.7725 - val_acc: 0.5430
Epoch 50/50
 - 1s - loss: 0.2075 - acc: 0.9388 - val_loss: 1.9880 - val_acc: 0.5510
fit()'s runtime:  55.3912 sec.
0, 0.567111111190584, ['rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0, 'rotate', 0.0]
('trial:', 1, '\n', ['gamma-contrast', 0.8442657485810175, 'coarse-salt-pepper', 0.8472517387841256, 'brighten', 0.38438170729269994, 'translate-y', 0.056712977317443194, 'translate-y', 0.47766511732135, 'add-to-hue-and-saturation', 0.47997717237505744, 'emboss', 0.8360787635373778, 'sharpen', 0.6481718720511973, 'emboss', 0.9571551589530466, 'rotate', 0.8700872583584366])
Traceback (most recent call last):
  File "test.py", line 29, in <module>
    best_policies = deepaug.optimize(300)
  File "/data/ansheng/cv_strategy/autoML/deep_augment/deepaugment-master/deepaugment/deepaugment.py", line 151, in optimize
    f_val = self.objective_func.evaluate(trial_no, trial_hyperparams)
  File "/data/ansheng/cv_strategy/autoML/deep_augment/deepaugment-master/deepaugment/objective.py", line 44, in evaluate
    self.data["X_train"], self.data["y_train"], *trial_hyperparams
  File "/data/ansheng/cv_strategy/autoML/deep_augment/deepaugment-master/deepaugment/augmenter.py", line 166, in augment_by_policy
    ), "first transform is unvalid"
AssertionError: first transform is unvalid

The code that throw Error is:

X_portion_aug = transform(hyperparams[i], hyperparams[i+1], X_portion)  # first transform
assert (
    X_portion_aug.min() >= -0.1 and X_portion_aug.max() <= 255.1
), "first transform is unvalid"

It seems the code after data-augmentation is out of range [0,255].

So if the function augment_by_policy() in augmenter.py has some bug?

List of relevant resources

Journal papers

  • AutoAugment: Learning Augmentation Policies from Data (link)
  • Smart Augmentation - Learning an Optimal Data Augmentation Strategy (link)
  • Adaptive data augmentation for image classification (link)
  • Learning to Compose Domain-Specific Transformations for Data Augmentation (link)
    • Cited by AutoAugment paper

AutoAugment implementations

  • Official (github)
    • Tensorflow used
    • does not have controller (RL) part
  • Unofficial (github)
    • Keras used
    • Have the controller part
  • Unofficial exploration on jupyter notebook (github)
    • Very good for learning
    • Pytorch used
    • Doesn't implement the whole
  • In tensorflow-hub (link)

Blogs

Videos

  • Seminar presentation (Youtube)
    • distills the situation and the model well!
    • discussion part gives a good critic, data augmentation might overfit for the validation set

Libraries

  • Tanda Learning to Compose Domain-Specific Transformations for Data Augmentation
  • Automold road augmentation library for self-driving cars
  • Albumentations general data augmentation library
  • Autosat Semantic segmentation on aerial and satellite imagery. Extracts features such as: buildings, parking lots, roads, water, clouds
  • NAS
  • autokeras

Ideas

Should child models trained with X_aug only, or with X + X_aug?

X : data as it is
X_aug: augmented version of X

Current plan:
Make an initial training (200 epochs) with X of the child model, then using trained weights:

  1. train 60 epochs with X_aug
  2. train 60 epochs with X + X_aug

Make an experiment for options 1 and 2, and see which one is better.

.

Explore raw data and report it here:
/notebooks/explore-raw-data.ipynb

augmented images output

Its unclear for me if this project produces the images or if it also does the training - outputting the final score. Is it possible to use this project like keras ImageDataGenerator?

Using deepaugment with large custom dataset (using generator)?

According to my observation, I don't see deepaugment support big dataset (which I cannot load all images and labels at a time and have to use data generator)? If I'm missing something, can you show how to use this repo with custom dataset which I have to use data generator?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.