Linearizing Models for Efficient yet Robust Private Inference

Sreetama Sarkar, Souvik Kundu, Peter A. Beerel

TL;DR

RLNet is a novel training framework that enables Private Inference (PI) to be both fast and robust. By strategically pruning high-latency ReLU operations and employing a dual-path architecture, RLNet achieves a "triple win": maintaining high clean accuracy while significantly boosting robustness against both natural image corruptions and adversarial attacks.

What Problem Does This Paper Address?

Private Inference allows a server to process a client's encrypted data without ever seeing the raw input, protecting both user privacy and model intellectual property. However, the cryptographic protocols involved (like Homomorphic Encryption) are computationally expensive. Specifically, ReLU (Rectified Linear Unit) layers—the standard non-linear activation in neural networks—are roughly 340x more latent than linear convolutional layers in a PI setting.

While researchers have previously developed "linearized" models (models with fewer ReLUs) to speed up PI, these models are notoriously fragile. They often fail when faced with natural perturbations (like rain, snow, or camera noise) or adversarial attacks (maliciously crafted pixel changes). This paper addresses the critical gap between inference efficiency and real-world robustness.

Methods

The authors introduce RLNet, a class of robust linearized networks. The core of their approach is a three-stage training pipeline:

  1. Robust Teacher Training: They first train an "All-ReLU" (AR) teacher model using a combination of Augmix (for natural robustness) and Adversarial Training (using PGD attacks).
  2. ReLU Mask Identification: They identify a "ReLU budget" and use a sensitivity-based approach to determine which ReLU units are most critical for performance. Less critical ReLUs are bypassed (linearized).
  3. Three-Way Robust Distillation: The "Partial-ReLU" (PR) student model is fine-tuned to mimic the teacher.

A key innovation is the use of Dual Batch Normalization (BN). Because clean/naturally noisy images and adversarial images come from very different distributions, RLNet uses two distinct paths through the model that share weights but use separate BN statistics ($\lambda=0$ for normal mode, $\lambda=1$ for adversarial mode).

Figure 3: RLNet framework: model architecture and inference path. Here, λ = 0 and 1 correspond to clean and adversarial paths respectively. We use the same path as clean for classifying against natural perturbations. This means that unless the perturbation is attacker-driven, we use the λ = 0 path for inference.

Datasets

The framework was evaluated on three standard image classification datasets:

  • CIFAR-10 & CIFAR-100: Standard benchmarks for small-scale image recognition.
  • Tiny-ImageNet: A more complex dataset with 200 classes.
  • Robustness Benchmarks: The authors used the "-C" variants (e.g., CIFAR-10-C), which include 15 types of natural corruptions at five severity levels, and various adversarial attacks like FGSM, PGD-20, and Auto-PGD.

Key Insights and Ideas

  • The "Triple Win Ticket": RLNet proves that you don't have to sacrifice robustness for efficiency. It simultaneously improves clean accuracy (CA), naturally perturbed accuracy (NPA), and adversarial accuracy (AdvA) compared to previous linearized models.
  • Dual BN is Sufficient: The authors discovered that while adversarial data needs its own BN statistics, clean and naturally augmented data are similar enough to share a single set of BN layers. This simplifies the architecture without losing performance.
  • Distribution Clustering: Visualizing the BN statistics (Figure 2) reveals two distinct clusters for normal vs. adversarial data, justifying the dual-path approach.
Figure 2: Running mean and variance of the last BN layer of ResNet18 trained on Tiny-ImageNet using dual BN

Key Results

RLNet significantly outperforms the state-of-the-art (SoTA) non-robust linearized models (like SeNet) across all metrics:

  • Efficiency: Achieves up to 11.14x reduction in ReLU operations.
  • Robustness Gains: Compared to non-robust models at similar ReLU budgets, RLNet improves adversarial accuracy by up to ~47% and naturally perturbed accuracy by up to ~16.4%.
  • Clean Performance: Even on standard, uncorrupted images, RLNet sees an accuracy boost of up to ~1.5%.
Radar plots comparing non-robust linearized models (left) to RLNet (right), showing how RLNet maintains a much larger "area" of performance across clean, natural, and adversarial metrics.

Limitations and Future Work

  • Mode Switching: Currently, the model requires a way to decide which path ($\lambda=0$ or $1$) to take during inference. While the authors suggest using prediction confidence, this adds a layer of complexity to deployment.
  • Architectural Scope: The study focuses on CNNs (ResNet and Wide ResNet). The authors note that exploring the robustness of Vision Transformers (ViTs) for latency-efficient Private Inference is a promising future direction, as ViTs are increasingly popular but have different non-linear bottlenecks.

Summary updated

BibTeX
@misc{sarkar2024linearizing,
  author = {Sreetama Sarkar and Souvik Kundu and Peter A. Beerel},
  title = {{Linearizing Models for Efficient yet Robust Private Inference}},
  year = {2024},
  eprint = {2402.05521},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.05521},
}
Figure