# Keeping the Bad Guys Out: Protecting and Vaccinating Deep Learning with JPEG Compression

Source: [Keeping the Bad Guys Out: Protecting and Vaccinating Deep Learning with JPEG Compression](<https://www.sota2.com/research/paper/68fa63531e209131ce9fe29d>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-28T13:56:33.579Z

Authors: Nilaksh Das, Madhuri Shanbhogue, Shang-Tse Chen, Fred Hohman, Li Chen, Michael E. Kounavis, Duen Horng Chau

Published: 2017-05-08T14:55:32.000Z

## Abstract

Deep neural networks (DNNs) have achieved great success in solving a variety of machine learning (ML) problems, especially in the domain of image recognition. However, recent research showed that DNNs can be highly vulnerable to adversarially generated instances, which look seemingly normal to human observers, but completely confuse DNNs. These adversarial samples are crafted by adding small perturbations to normal, benign images. Such perturbations, while imperceptible to the human eye, are picked up by DNNs and cause them to misclassify the manipulated instances with high confidence. In this work, we explore and demonstrate how systematic JPEG compression can work as an effective pre-processing step in the classification pipeline to counter adversarial attacks and dramatically reduce their effects (e.g., Fast Gradient Sign Method, DeepFool). An important component of JPEG compression is its ability to remove high frequency signal components, inside square blocks of an image. Such an operation is equivalent to selective blurring of the image, helping remove additive perturbations. Further, we propose an ensemble-based technique that can be constructed quickly from a given well-performing DNN, and empirically show how such an ensemble that leverages JPEG compression can protect a model from multiple types of adversarial attacks, without requiring knowledge about the model.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Adversarial Robustness on CIFAR-10 (L-inf, eps=4/255)](<https://www.sota2.com/research/sota/adversarial-robustness-on-cifar-10-l-inf-eps-4-255.md>): Adversarial Robustness; CIFAR-10 L-infinity, epsilon=4/255; Robust Accuracy (AA): 0.59.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/1705.02900>)

[PDF](<https://arxiv.org/pdf/1705.02900.pdf>)
