A fast image augmentation library in Julia for machine learning.
Author Evizero
98 Stars
Updated Last
4 Months Ago
Started In
May 2017


License Docs-stable Docs-dev pkgeval unittest codecov

A fast Julia library for increasing the number of training images by applying various transformations.

Augmentor is a real-time image augmentation library designed to render the process of artificial dataset enlargement more convenient, less error prone, and easier to reproduce. It offers the user the ability to build a stochastic image-processing pipeline -- which we will also refer to as augmentation pipeline -- using image operations as building blocks. For our purposes, an augmentation pipeline can be understood as a sequence of operations for which the parameters can (but need not) be random variables.

julia> pl = ElasticDistortion(6, scale=0.3, border=true) |>
            Rotate([10, -5, -3, 0, 3, 5, 10]) |>
            ShearX(-10:10) * ShearY(-10:10) |>
            CropSize(28, 28) |>
5-step Augmentor.ImmutablePipeline:
 1.) Distort using a smoothed and normalized 6×6 grid
 2.) Rotate by θ  [10, -5, -3, 0, 3, 5, 10] degree
 3.) Either: (50%) ShearX by ϕ  -10:10 degree. (50%) ShearY by ψ  -10:10 degree.
 4.) Crop a 28×28 window around the center
 5.) Zoom by I  {0.9×0.9, 1.0×1.0, 1.1×1.1, 1.2×1.2}

julia> augment(img, pl)

The Julia version of Augmentor is engineered specifically for high performance applications. It makes use of multiple heuristics to generate efficient tailor-made code for the concrete user-specified augmentation pipeline. In particular Augmentor tries to avoid the need for any intermediate images, but instead aims to compute the output image directly from the input in one single pass.

Augmentor.jl is the Julia implementation for Augmentor. The Python version of the same name is available here.

Package Overview

Augmentor.jl provides:

  • predefined augmentation operations, e.g., FlipX
  • |> operator to compose operations into a pipeline
  • higher-lvel functions (augment, augment! and augmentbatch!) that works on a pipeline and image(s).

Check the documentation for a full list of operations.

Citing Augmentor

If you use Augmentor for academic research and wish to cite it, please use the following paper.

Marcus D. Bloice, Christof Stocker, and Andreas Holzinger, Augmentor: An Image Augmentation Library for Machine Learning, arXiv preprint arXiv:1708.04680,, 2017.


This package makes heavy use of the following packages in order to provide it's main functionality. To see at full list of utilized packages, please take a look at the REQUIRE file.