[Paper Review] Shield: Fast, Practical Defense and Vaccination for Deep Learning using JPEG Compression
Shield uses JPEG compression with vaccination and stochastic local quantization to defend against adversarial image attacks, achieving high robustness and fast runtime on ImageNet without model changes.
The rapidly growing body of research in adversarial machine learning has demonstrated that deep neural networks (DNNs) are highly vulnerable to adversarially generated images. This underscores the urgent need for practical defense that can be readily deployed to combat attacks in real-time. Observing that many attack strategies aim to perturb image pixels in ways that are visually imperceptible, we place JPEG compression at the core of our proposed Shield defense framework, utilizing its capability to effectively "compress away" such pixel manipulation. To immunize a DNN model from artifacts introduced by compression, Shield "vaccinates" a model by re-training it with compressed images, where different compression levels are applied to generate multiple vaccinated models that are ultimately used together in an ensemble defense. On top of that, Shield adds an additional layer of protection by employing randomization at test time that compresses different regions of an image using random compression levels, making it harder for an adversary to estimate the transformation performed. This novel combination of vaccination, ensembling, and randomization makes Shield a fortified multi-pronged protection. We conducted extensive, large-scale experiments using the ImageNet dataset, and show that our approaches eliminate up to 94% of black-box attacks and 98% of gray-box attacks delivered by the recent, strongest attacks, such as Carlini-Wagner's L2 and DeepFool. Our approaches are fast and work without requiring knowledge about the model.
Motivation & Objective
- Motivate the need for practical defenses against adversarial attacks in real-time settings.
- Propose a compression-based defense centered on JPEG to remove perturbations.
- Introduce vaccination and ensembling to improve robustness to compression.
- Incorporate stochastic quantization to hinder attack estimation of the defense.
- Demonstrate scalability and speed on ImageNet with extensive experiments.
Proposed method
- Apply JPEG compression as a preprocessing defense to remove perturbations while preserving benign accuracy.
- Vaccinate models by retraining on compressed images to improve robustness to compression artifacts.
- Introduce Stochastic Local Quantization (SLQ): randomly assign per-block JPEG quality to blocks during inference.
- Ensemble vaccinated models trained at different JPEG qualities to improve defense robustness.
- Evaluate against strong attacks (CW-L2, DeepFool, I-FGSM, FGSM) on ImageNet with ResNet-v2 50.
- Compare against denoising baselines (Median Filter, TVD) in terms of accuracy and speed.
Experimental results
Research questions
- RQ1How effective is JPEG-based preprocessing in neutralizing adversarial perturbations across different attack types?
- RQ2Does vaccination (training on compressed images) improve robustness to compression and attacks?
- RQ3Can stochastic per-block quantization (SLQ) and model ensembling yield stronger, faster defenses than single-quantization approaches?
- RQ4What are the trade-offs between defense effectiveness and benign-image accuracy, and how does Shield compare to existing denoising methods?
Key findings
- Eliminates up to 94% of black-box attacks and up to 98% of gray-box attacks for strong attacks like CW-L2 and DeepFool.
- JPEG-based preprocessing alone recovers substantial accuracy across attacks; Shield further improves results, especially under high perturbation.
- Vaccination and ensemble strategies offer favorable accuracy/compute trade-offs, matching or exceeding larger ensembles at lower cost.
- SLQ with randomized per-block quality enhances robustness by preventing attackers from estimating the transformation.
- JPEG-based defense is significantly faster than alternatives (JPEG ~107s for 50k images; TVD and MF slower).
- Shield maintains competitive benign-image accuracy while recovering much of the adversarially degraded accuracy.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.