Adversarial Training of Two-Layer Polynomial and ReLU Activation Networks via Convex Optimization

Daniel Kuelbs, Sanjay Lall, Mert Pilanci · Submission to ICLR 2025 · Withdrawn

TL;DR

This paper introduces an exact convex semidefinite programming (SDP) formulation for adversarial training of two-layer polynomial activation neural networks, proving zero duality gap with the nonconvex min-max problem. By pairing this theory with scalable GPU implementations, the authors demonstrate that retraining just the final two layers of a Pre-Activation ResNet-18 via convex adversarial optimization outperforms Sharpness-Aware Minimization (SAM) against $\ell_\infty$ attacks on CIFAR-10.

What Problem Does This Paper Address?

Standard adversarial training (such as PGD-based robust optimization) is computationally demanding and notoriously sensitive to training hyperparameters (e.g., learning rates and optimizer choices) due to the nonconvex, highly non-linear loss landscape. While recent breakthroughs showed that two-layer ReLU and polynomial networks can be reformulated as global convex optimization problems, an exact convex formulation for adversarial training of polynomial networks remained an open problem.

Furthermore, deploying convex neural network formulations to large-scale deep learning tasks has historically been bottlenecked by scalability constraints.

Methods

  • Semidefinite Program (SDP) for Robust Polynomial Networks: The authors frame the worst-case 2-layer polynomial network objective under $\ell_2$ perturbations of radius $r$. Using Fenchel duality and the S-procedure (both inequality and equality variants), they transform the adversarial inner maximization problem into linear matrix inequalities (LMIs).
  • Global Optimality Guarantee (Theorem 3.1): They prove that the convex SDP achieves the exact same optimal objective value as the nonconvex min-max adversarial training problem once the network width $m \ge \text{rank}(Z^\star) + \text{rank}({Z'}^\star)$. The optimal weights are directly recoverable via neural decomposition.
  • Exact Decision Boundary Distance: Leveraging the quadratic nature of polynomial networks and the S-procedure, the authors formulate an SDP to calculate the exact shortest $\ell_2$-distance from any sample to the decision boundary.
  • Scalable Penalized Implementation for Deep Models: Because interior-point SDP solvers do not scale to massive vision datasets, the authors formulate an unconstrained, penalty-based objective for adversarial ReLU networks compatible with standard deep learning frameworks (PyTorch, Adam). They use this to retrain the top two layers of a Pre-Activation ResNet-18.

Datasets

  • Wisconsin Breast Cancer Dataset: Tabular binary classification dataset used for exact small-scale SDP solving via SCS.
  • Ionosphere Dataset: Radar dataset used for exact small-scale SDP benchmark comparisons.
  • CIFAR-10: Standard vision benchmark evaluated under both low-data (1% random training subset) and full-data regimes against Fast Gradient Sign Method (FGSM) $\ell_\infty$ attacks.
  • No new benchmarks were introduced.

Key Insights and Ideas

  • Inductive Bias vs. Data Abundance: Polynomial networks have higher bias and lower variance than ReLU networks. Under extreme data scarcity (the 1% CIFAR-10 split), the robust polynomial head significantly outperformed the ReLU model under adversarial attack. In contrast, when trained on the full CIFAR-10 dataset, the more expressive ReLU model achieved superior performance.
  • Analytic Worst-Case Penalization: Instead of spending multiple backward passes generating adversarial samples at every training step (like PGD), the convex program directly and analytically constrains the worst-case bound within the perturbation ball.
  • Over-smoothing and Ball Collisions: Increasing the robust perturbation radius $r$ steadily pushes the decision boundary further away from data points. However, past a critical threshold (e.g., $r \approx 2.3$ on Breast Cancer), perturbation balls of opposing classes overlap, collapsing the classifier into predicting only the majority class.

Key Results

  • Small-Scale Datasets (Exact Solver):
  • Wisconsin Breast Cancer: At an FGSM $\ell_\infty$ attack magnitude of $0.90$, the robust polynomial network retained 76.4% test accuracy, whereas the standard polynomial network collapsed to 15.0% (clean accuracy remained identical at $99.3\%$).
  • Ionosphere: At $\ell_\infty = 0.25$, robust accuracy reached 64.8% versus 52.1% for standard training.
  • CIFAR-10 ResNet-18 Feature Head Retraining:
  • 1% Data Regime: The robust polynomial network achieved 30.8% robust accuracy at $\epsilon = 8/255$, vastly outperforming the ReLU head (16.8%) and SAM trained on the entire dataset (16.9%).
  • Full Dataset Regime: The convex adversarial ReLU head achieved 40.05% robust accuracy at $\epsilon = 8/255$, outperforming SAM (16.9%) and standard training (17.0%), with minimal clean accuracy degradation ($92.0\%$ vs $92.8\%$ for SAM).

Limitations and Future Work

  • Network Depth: The exact convex SDP reformulation is mathematically restricted to two-layer architectures; application to deep networks currently requires freezing earlier feature representations and retraining only the final two layers.
  • Computational Cost of Exact SDPs: Exact cone solvers (e.g., SCS) scale poorly with input dimensions and dataset size, restricting exact solving to small tabular datasets.
  • Future Work: The authors propose extending convex adversarial programs directly to deeper multi-layer architectures, exploring layer-wise convex adversarial pretraining, and adapting the framework to regression tasks.

Summary updated

Abstract

Training neural networks which are robust to adversarial attacks remains an important problem in deep learning, especially as heavily overparameterized models are adopted in safety-critical settings. Drawing from recent work which reformulates the training problems for two-layer ReLU and polynomial activation networks as convex programs, we devise a convex semidefinite program (SDP) for adversarial training of two-layer polynomial activation networks and prove that the convex SDP achieves the same globally optimal solution as its nonconvex counterpart. The convex adversarial SDP is observed to improve robust test accuracy against $\ell_\infty$ attacks relative to the original convex training formulation on multiple datasets. Additionally, we present scalable implementations of adversarial training for two-layer polynomial and ReLU networks which are compatible with standard machine learning libraries and GPU acceleration. Leveraging these implementations, we retrain the final two fully connected layers of a Pre-Activation ResNet-18 model on the CIFAR-10 dataset with both polynomial and ReLU activations. The two `robustified' models achieve significantly higher robust test accuracies against $\ell_\infty$ attacks than a Pre-Activation ResNet-18 model trained with sharpness-aware minimization, demonstrating the practical utility of convex adversarial training on large-scale problems.
BibTeX
@misc{kuelbs2024adversarial,
  author = {Daniel Kuelbs and Sanjay Lall and Mert Pilanci},
  title = {{Adversarial Training of Two-Layer Polynomial and ReLU Activation Networks via Convex Optimization}},
  year = {2024},
  eprint = {2405.14033},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.14033},
}
Figure