Skip to content

AugLy: A Data Augmentation Library for RobustnessAugLy: Data Augmentations for Robustness

arXiv· arXiv:2201.06494· Zoe Papakipos, Joanna BittonMeta AIIndexed by this site · 27 days ago· Originally publishedTools

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

The authors release the multimodal data augmentation library AugLy (100+ augmentations across audio/image/text/video), and use it to evaluate the robustness of ImageNet models to real online perturbations.

Questions
Classic data augmentation libraries are mostly single-modality and aimed at training-time regularization, and do not cover the perturbations users actually perform online (such as overlaying text, emoji, screenshot forwarding), which can be used to bypass detection models.
Methods
The authors build the open-source library AugLy, providing over 100 augmentations across four sub-libraries—audio, image, text, video—under a unified API, including composition, probabilistic application, and multimodal augmentation operators, and can output metadata.
Experiments and results
The authors compare each sub-library with existing libraries on augmentation count and runtime, and evaluate three models on 250 ImageNet images: the authors state VGG16 and Resnet152 are generally vulnerable to all augmentation types, while Efficientnet-L2 is more robust except for blur and random noise.
Limitations and future work
The paper does not specifically discuss limitations. On runtime, most other libraries are faster (the authors attribute this to implementation choices of PIL and FFMPEG); the robustness evaluation covers only 3 image classification models and 250 images per dataset, and does not involve model evaluation in other modalities.
Experimental setupVGG16、Resnet152 et al. · ImageNet validation set、ImageNet V2 · top-5 accuracy 变化、增强运行时间(秒) et al.
Evaluated models
VGG16Resnet152Efficientnet-L2 (Noisy Student)
Benchmarks
ImageNet validation setImageNet V2
Metrics
top-5 accuracy 变化增强运行时间(秒)增强数量
AI summaryResearchers release AugLy, a data augmentation library focused on adversarial robustness, covering multiple modalities: audio, image, text, and video, with code open-sourced at github.com/facebookresearch/AugLy. Its augmentation operations draw on the behavior of real users on social media platforms, some of which are not yet supported by existing data augmentation libraries. AugLy is particularly suited for evaluating robustness and systematically generating adversarial attacks; the paper describes how it works, benchmarks it against existing libraries, and uses it to evaluate the robustness of multiple state-of-the-art models.

Researchers release AugLy, a data augmentation library focused on adversarial robustness, covering multiple modalities: audio, image, text, and video, with code open-sourced at github.com/facebookresearch/AugLy. Its augmentation operations draw on the behavior of real users on social media platforms, some of which are not yet supported by existing data augmentation libraries. AugLy is particularly suited for evaluating robustness and systematically generating adversarial attacks; the paper describes how it works, benchmarks it against existing libraries, and uses it to evaluate the robustness of multiple state-of-the-art models.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Existing augmentation libraries do not cover real online perturbations; the authors propose the multimodal augmentation library AugLy for robustness evaluation.

    Core problem: classic data augmentation cannot simulate the data perturbations users actually perform online, so models' robustness to such perturbations cannot be trained or evaluated.

    • Scenario and motivation: online content is often manipulated and reposted, such as sharing screenshots, overlaying text or images on pictures to make memes; detecting whether two pieces of media are near-duplicate copies is therefore not simple, and the authors note that adversaries may deliberately submit obfuscated data to bypass detection models.
    • Shortcomings of existing methods: the authors state most augmentation libraries focus on a single modality, providing simple transformations such as mirroring, rotation, cropping, and brightness, and lack perturbations common online such as overlaying text, overlaying emoji, and social media screenshots; they are also mostly aimed at training-time regularization rather than robustness evaluation.
    • Core observation: the perturbations real users routinely apply to data (overlaying text, emoji, screenshot transformations, inserting punctuation or similar characters in text) should be included in the augmentation set, to evaluate and improve model robustness.
    • What the paper proposes: the open-source multimodal data augmentation library AugLy, covering four modalities—audio, image, text, video—with over 100 augmentations in total, under a unified API; the authors state that to their knowledge this is the first multimodal data augmentation library. The paper also provides functional and runtime comparisons with existing libraries, and a robustness evaluation of three ImageNet models.
  2. What related research exists?

    Related work is divided into four groups: single-modality augmentation libraries, augmentation strategy search, fairness perturbation research, and baseline libraries for each modality as comparisons.

    Single-modality augmentation libraries

    • Image libraries imgaug, torchvision, Albumentations and text libraries nlpaug, TextAttack, textflint—the authors state that most libraries cover only a single modality and have limited augmentation types; audio (librosa, torchaudio, etc.) and video (moviepy, pytorchvideo, vidaug) libraries also exist but have fewer augmentations.
    • textflint—the authors point out that AugLy is one of the few libraries, like textflint, that focuses on robustness evaluation rather than training-time data expansion.

    Augmentation strategies and training methods

    • AugMix—finds a set of augmentations and training on them can improve test-time robustness.
    • AutoAugment—finds the "optimal" set of training augmentations in a more automated way.

    Perturbation research in AI fairness

    • Multiple studies in NLP that evaluate model bias toward protected categories such as gender and ethnicity by augmenting text; AugLy correspondingly provides "fairness augmentations", and the authors consider robustness to perturbations of protected categories an important aspect of robustness.

    Comparison baselines and benchmarks

    • Baseline libraries: audio compared with pydub, torchaudio, audiomentations; image compared with imgaug, torchvision, Albumentations; text compared with nlpaug, TextAttack, textflint; video compared with moviepy, pytorchvideo, vidaug, comparing augmentation counts and runtime (Figure 5–12).
    • Robustness evaluation benchmarks: ImageNet validation set and ImageNet V2 (the latter described by the authors as a held-out test set without overfitting risk).

    The authors position AugLy as: a library covering four modalities under a unified API, reproducing real perturbations from the internet, and aimed at robustness evaluation, thereby distinguishing it from the above single-modality, training-oriented libraries.

  3. How does the paper address this problem?

    AugLy provides 100+ augmentations via four isomorphic sub-libraries plus a unified API, supporting composition, probabilistic application, and multimodal operations.

    Overall approach: build the open-source library AugLy, implementing perturbations that real users on the internet would make as programmable data augmentations, for robustness evaluation and systematic generation of adversarial perturbations, and also usable for regular training augmentation.

    Library structure

    • Four sub-libraries: audio, image, text, video, each corresponding to one modality and following the same interface.
    • Unified interface: each augmentation provides both a functional and a class-based calling form, and provides an intensity function that computes the transformation strength from the parameters.
    • Metadata: optional output metadata recording how the data was transformed, facilitating comparison of model performance by augmentation type and intensity.

    Composition and multimodal operators

    • Composition operator: Compose chains multiple augmentations in sequence; supports applying an augmentation with a given probability (e.g., Rotate(p=0.5)).
    • Multimodal augmentation: can augment a video's audio and visuals simultaneously (e.g., AugmentAudio applies an audio augmentation function to the video's audio track and then recombines).

    Augmentation content design

    • Basic + new: provides both basic augmentations already supported by existing libraries and new transformations taken directly from online observations, such as overlaying an image or video onto a social media interface to simulate a user screenshotting and reposting; the authors state this helps systems recognize that content remains the same after interface elements are added.
    • Text side: provides syntax-level (character-level) augmentations commonly used online to evade detection, such as inserting punctuation, zero-width characters, bidirectional characters, and changing fonts; the authors note that nlpaug and TextAttack focus mainly on semantic-level (word-level) augmentations.
    • Fairness augmentations: provides fairness augmentations targeting protected categories.

    Robustness evaluation protocol

    • Procedure: sample 250 images from each dataset, first compute the original top-5 accuracy, then compute the post-augmentation top-5 accuracy for each augmentation, measuring the model's vulnerability to that augmentation by the change relative to the baseline (unaugmented).
    • Parameter setting: the authors state they selected a diverse set of augmentations, with parameters set so that the perturbation is noticeable but the image content remains recognizable to the human eye (Figure 14 gives examples of four categories: spatial, color, overlay, pixel-level).
    • Efficiency benchmark: using AugLy v0.2.1, time each augmentation and its corresponding implementation in other libraries (seconds); the full list is in the appendix (Figure 17–20).
  4. What experiments did the paper conduct?

    Two sets of experiments: comparison of augmentation count and runtime with 13 existing libraries; robustness evaluation of 3 models on 250 ImageNet images.

    Experimental setup

    • Models evaluated: VGG16, Resnet152, Efficientnet-L2 (Noisy Student), 3 ImageNet classification models in total.
    • Datasets: ImageNet validation set and ImageNet V2 ("matched frequency"), 250 images sampled from each dataset.
    • Metrics: the top-5 accuracy change caused by each augmentation (relative to the unaugmented baseline); library comparison uses augmentation count and runtime per augmentation (seconds).
    • Baseline libraries: audio pydub, torchaudio, audiomentations; image imgaug, torchvision, Albumentations; text nlpaug, TextAttack, textflint; video moviepy, pytorchvideo, vidaug.
    • Implementation details: the benchmark uses AugLy v0.2.1; the paper does not report the number of repetitions or the hardware for the timing experiments.

    Main results: augmentation count comparison (per Figure 5, 7, 9, 11)

    ModalityAugLyComparison libraries (augmentation count)
    Audio20pydub 10; audiomentations 25; torchaudio 58
    Image34torchvision 28; Albumentations 54; imgaug 179
    Text16TextAttack 13; nlpaug 16; textflint 55
    Video43pytorchvideo 19; moviepy 30; vidaug 40
    • The authors state AugLy's total augmentation count is not the largest, but it includes real online perturbations that other libraries lack (e.g., image OverlayText, OverlayEmoji, OverlayOntoScreenshot; video audio augmentations and overlay-type augmentations).
    • The authors note that none of the three image libraries includes overlay-type augmentations, which they consider a gap: models are not invariant to operations encountered in the real world, and users can bypass harmful content detection models by overlaying emoji and similar means.

    Runtime benchmark

    • Image (Figure 8): Albumentations takes the least time on most comparable augmentations (e.g., Blur 0.005 seconds vs. AugLy 0.097 seconds); the authors state this is very likely because it uses NumPy arrays rather than PIL, and say they continue to use PIL for easy integration with torchvision's Compose() and code readability.
    • Video (Figure 12): other libraries are faster; the authors state they continue to use the FFMPEG CLI to efficiently handle large videos and save memory, rather than passing videos stored in memory as pytorchvideo and vidaug do.
    • Audio and text (Figure 6, 10): seconds are given per augmentation for AugLy and the corresponding implementations, e.g., audio PitchShift AugLy 1.238 seconds, torchaudio 0.372 seconds, audiomentations 0.651 seconds; text SimulateTypos AugLy 0.276 seconds, nlpaug 0.101 seconds, TextAttack 0.006 seconds, textflint 4e-4 seconds.

    ImageNet robustness evaluation

    • What was measured: the top-5 accuracy change before and after each augmentation for the three models on 250 sampled images (Figure 13, ImageNet validation set).
    • Results: the authors state VGG and ResNet are generally vulnerable to all AugLy augmentation types; EfficientNet is more robust to most augmentations, but blur and random noise cause larger accuracy drops. (The converted text does not contain the per-augmentation values in the figures.)
    • Authors' interpretation: combined with the training augmentations the authors list for each model (VGG: crop, hflip, color jitter; ResNet additionally scale; EfficientNet uses AutoAugment, including broader augmentations such as cutout), the authors consider the range of training augmentations explains the differences, and note that none of the three models was trained on pixel-level augmentations such as blur, random noise, and pixelization, which the authors state very likely explains the three models' vulnerability to such augmentations.

    ImageNet V2 validation

    • What was measured: likewise computes the top-5 accuracy change for each augmentation on 250 sampled images from ImageNet V2 (Figure 15), and compares the drop for EfficientNet per augmentation across the two datasets (Figure 16).
    • Results: the authors state VGG and ResNet remain vulnerable to varying degrees to all augmentations on V2, while EfficientNet's drops are smaller except for blur and random noise; for EfficientNet the accuracy drops for each augmentation are close across the two datasets.
    • Authors' interpretation: the authors state there is no indication that the models overfit the validation set.

    Other ablations and analyses

    • The paper has no independent ablation experiments; the appendix (Figure 17–20) gives the complete runtime tables for all augmentations across the four modalities, and the main-text figures are a subset.
  5. What are some points that can be further explored?

    The paper does not specifically discuss limitations; the experiments cover 3 image classification models, 250 images per dataset, and a four-modality library comparison.

    Limitations and future directions noted by the authors

    • The paper does not specifically discuss limitations, and has no Limitations or Future Work section.
    • Statements related to efficiency (from Section 4 and the conclusion, not self-listed by the authors as limitations): the authors acknowledge that other libraries are faster in runtime, and explain the design rationale for continuing to use PIL (images) and the FFMPEG CLI (video).

    Scope of experimental coverage

    • Models tested: the robustness evaluation covers only 3 image classification models in total: VGG16, Resnet152, Efficientnet-L2 (Noisy Student); no model robustness evaluation was done for audio, text, or video modalities (Section 5).
    • Data scale: 250 images sampled per dataset, with the datasets being ImageNet validation set and ImageNet V2; the paper does not report the number of repetitions (Section 5).
    • Augmentation parameters: the authors state that parameters were set so that perturbations are obvious but the content remains recognizable to the human eye, without giving specific parameter values for each augmentation (Section 5).
    • Library comparison: 3 existing libraries compared per modality, comparing augmentation counts and runtime; timing is based on AugLy v0.2.1, and the paper does not report the hardware used for timing or the number of repetitions (Section 4).
    • Existing use: the authors mention that AugLy has been used to train SimSearchNet, evaluate models in the 2019 Deepfake Detection Challenge, and build the DISC21 dataset, but the paper does not give quantitative results for these uses (Section 3.2).
  6. Summarize the main content of the paper

    AugLy is a robustness-oriented multimodal augmentation library; benchmark comparisons plus ImageNet evaluation demonstrate its use.

    AugLy is an open-source multimodal data augmentation library proposed by Meta AI, aimed at adversarial robustness evaluation.

    • Problem: classic augmentation libraries are mostly single-modality and aimed at training-time regularization, and do not cover the perturbations users actually perform online (overlaying text, emoji, screenshot reposting, inserting special characters, etc.), which may be used to bypass detection models.
    • Method: AugLy provides over 100 augmentations across four sub-libraries—audio, image, text, video—under a unified API, supporting functional/class-based calls, intensity functions, metadata output, Compose composition, probabilistic application, and multimodal augmentation (e.g., processing a video's visuals and audio track simultaneously).
    • Library comparison: for each modality, compares augmentation count and runtime with 3 existing libraries; AugLy does not have the most augmentations (e.g., image 34 vs. imgaug 179), but includes overlay and screenshot-type augmentations that other libraries lack; on runtime, most other libraries are faster, which the authors attribute to implementation choices of PIL and FFMPEG.
    • Robustness evaluation: on 250 sampled images each from the ImageNet validation set and ImageNet V2, measures the vulnerability of VGG16, Resnet152, and Efficientnet-L2 (Noisy Student) to each augmentation by top-5 accuracy change; the authors state VGG and ResNet are generally vulnerable, EfficientNet is more robust except for blur and random noise, and results on the two datasets are close with no sign of overfitting.
    • Authors' conclusion: the authors consider retraining on augmented data an effective way to build defenses against multiple attack types, and AugLy can be used to discover robustness gaps in pretrained models.
Read originalarxiv.org