Conventional wisdom suggests that adversarial reprogramming—repurposing a frozen neural network for a new task by only modifying its inputs—fails on untrained networks and relies heavily on the features learned during original training. This paper turns that assumption on its head, proving theoretically and demonstrating empirically that randomly initialized networks can be successfully reprogrammed, while extensively training a network can actually destroy its reprogrammability.
The Mechanics of Adversarial Reprogramming
Adversarial reprogramming allows an attacker (or a resourceful engineer) to take a neural network trained for Task A (e.g., ImageNet classification) and force it to perform Task B (e.g., MNIST digit recognition) simply by adding a carefully crafted, static "adversarial program" to the input images. The network's weights remain completely frozen.
Prior research concluded two things: first, reprogramming usually fails on untrained networks with random weights; second, the original task the network was trained on is crucial for success. The authors challenge these claims, asking: Can neural networks with random weights be adversarially reprogrammed, and how does the training process actually impact a network's reprogrammability? Disentangling the architecture from the training weights is vital for understanding the security risks and potential resource-saving applications of this phenomenon.
Methodology
The authors tackle the problem through both theoretical proofs and empirical experiments.
Theoretical Analysis: They analyze two-layer ReLU neural networks with random weights. Assuming the network width is no greater than the input dimension, they use matrix inversion to construct adversarial programs. To understand the impact of training, they analyze the gradient flow of these networks on orthogonally separable datasets using exponential or logistic loss.
Empirical Experiments: The team tested six realistic, untrained CNN architectures (ResNet variants, Inception-v3, EfficientNet-B0) initialized with random weights on tasks like MNIST.
A key breakthrough was the Batch Norm Trick. Default initializations of Batch Normalization layers (mean 0, variance 1) cripple random networks. By simply passing a single batch of random images through the untrained network to initialize the moving mean and variance, the random networks become viable for reprogramming.
They also evaluated different Input Combination Schemes to merge the adversarial program with the input image:
- Overwriting (Scheme 1): Scaling the input image and pasting it into the center of the adversarial program.
- Convex Combination (Scheme 2): Scaling the input image to the full size of the adversarial program and blending them together using a weighted ratio (alpha blending).
Key Insights and Results
- Training can actually hurt: The theoretical analysis reveals a fascinating dynamic: training a network to infinity on orthogonally separable data causes the weights to converge toward maximum-margin directions. Once the weights are locked into these highly specific directions, adversarial reprogramming fails, and accuracy drops to random guessing (50%).
- Random networks are highly capable: As long as batch normalization layers are properly initialized to reflect the actual distribution of the random weights, untrained networks are highly susceptible to adversarial reprogramming. For two-layer ReLU networks with random weights, expected reprogramming accuracy approaches 100% for sufficiently large input dimensions.
- Blending beats pasting: The novel convex combination approach (Scheme 2) yields significantly better and more reliable results than the traditional overwriting method. Using this scheme (with the input image weighted at $\approx 4.6\%$), random, untrained networks achieved remarkably high test accuracies on MNIST:
- EfficientNet-B0: 91.8%
- ResNet-50: 91.1%
- ResNet-101V2: 90.9%
- Inception-v3: 90.2%
- ResNet-50V2: 88.8%
- ResNet-152V2: 72.0%
These numbers are only slightly below what prior work achieved using networks fully trained on ImageNet, proving that pre-training is far less important than previously believed.
Limitations and Future Work
The mathematical proofs for random networks assume the network's hidden layer width is no greater than its input dimension. Future work could relax this assumption and extend the theory to deeper networks. Additionally, while experiments showed that architectures like EfficientNet-B0 are highly susceptible to reprogramming, others like ResNet-152V2 are notably less so. The exact architectural causes for this discrepancy remain an open question. The authors propose testing adversarial reprogramming on more difficult tasks and exploring its effects on modern Vision Transformer (ViT) architectures.
Summary updated