Abstract
We introduce AugLy, a data augmentation library with a focus on adversarial robustness. AugLy provides a wide array of augmentations for multiple modalities (audio, image, text, & video). These augmentations were inspired by those that real users perform on social media platforms, some of which were not already supported by existing data augmentation libraries. AugLy can be used for any purpose where data augmentations are useful, but it is particularly well-suited for evaluating robustness and systematically generating adversarial attacks. In this paper we present how AugLy works, benchmark it compared against existing libraries, and use it to evaluate the robustness of various state-of-the-art models to showcase AugLy's utility.
Introduction
Most computer vision and natural language processing (NLP) models are trained and evaluated on "clean" datasets. However, the data encountered in real-world environments—particularly on social media—is far from pristine. Users organically perturb content by overlaying emojis, adding text to create memes, or resharing screenshots of posts. Furthermore, adversaries intentionally obfuscate data to evade detection systems for hate speech or copyright infringement.
Existing augmentation libraries often focus on a single modality and provide "classical" transformations like rotations or brightness adjustments. There is a significant gap between these academic augmentations and the complex, multimodal manipulations seen online. AugLy addresses this by providing a unified toolset to simulate these "organic" perturbations across four different media types: audio, image, text, and video.
The AugLy Library
AugLy is structured into four sub-libraries under a unified API, offering both function-based and class-based formats for easy integration into existing training pipelines, such as PyTorch.
Key technical features include:
- Internet-Native Transforms: Includes unique augmentations like
meme_format,overlay_emoji, andscreenshot(which places an image/video inside a simulated social media UI). - Multimodal Composition: Operators allow users to apply augmentations across modalities simultaneously—for instance, perturbing both the audio track and the visual frames of a video in one go.
- Intensity Functions: Each transform includes a way to measure the "strength" of the perturbation, allowing for granular robustness evaluations.
- Metadata Generation: The library outputs metadata describing exactly how the data was transformed, which is crucial for analyzing model failure points.
Evaluation Methodology
To evaluate AugLy's utility, we benchmarked the robustness of state-of-the-art models, including VGG16, ResNet152, and EfficientNet-L2, using the ImageNet validation set and ImageNet V2. These evaluations highlight the fragility of current models when faced with realistic social media perturbations.
While architectures like EfficientNet (trained with AutoAugment) show improved robustness to spatial changes, they remain highly susceptible to pixel-level noise, such as blur or random noise. In the text domain, AugLy emphasizes syntactic (character-level) perturbations—like inserting punctuation or swapping similar-looking characters (e.g., 'o' to '0')—which are common tactics used to evade filters but are often overlooked by semantic-focused libraries.
Results and Discussion
AugLy provides over 100 distinct augmentations, significantly more than many specialized libraries (e.g., 43 video augmentations compared to 19 in pytorchvideo). Our evaluations on ImageNet revealed dramatic drops in top-5 accuracy for VGG and ResNet when faced with "Internet-native" transforms.
As shown in the results, even highly accurate models are surprisingly vulnerable to simple organic perturbations. Overlaying a few emojis or stripes can significantly degrade performance, even if the original subject remains clear to a human observer. While AugLy is highly versatile, it remains computationally competitive; for image tasks, it utilizes PIL to ensure better readability and integration with torchvision.
Conclusion
AugLy is a powerful tool for evaluating model robustness in the "wild west" of social media. While this work demonstrates the vulnerability of current state-of-the-art models, the next step is to use these realistic perturbations within the training loop to improve production-grade AI. Future work will focus on further optimizing performance, particularly for video processing where memory conservation and speed remain primary challenges.
Summary updated