Linearity Grafting: Relaxed Neuron Pruning Helps Certifiable RobustnessLinearity Grafting: Relaxed Neuron Pruning Helps Certifiable Robustness
The authors propose linearity grafting, which replaces unstable and insignificant ReLU neurons in adversarially trained networks with learnable linear functions; the authors report a VA improvement of up to 82.30% on CIFAR-10.
Defender's goal: prove that the network output f(x)>0 under l∞-norm bounded perturbations (ε=2/255 for CIFAR-10/SVHN, ε=0.1 for MNIST). The defense modifies the network after pretraining: performs linearity grafting on a FAT adversarially trained model, then verifies with a complete verifier (α,β-CROWN).
- Certifiable robustness is important for safety-critical scenarios, but the large amount of nonlinearity in large networks (unstable ReLU neurons) makes complete verification computationally expensive, and certified robust training is slow to train and harms standard accuracy.
- The authors propose linearity grafting: starting from a fast adversarial training (FAT) model, select unstable and unimportant ReLU neurons by instability and importance scores, replace them with a learnable linear function a×x+b and fine-tune, then verify with the complete verifier α,β-CROWN.
- On four architectures across MNIST/SVHN/CIFAR-10, grafting improves verified accuracy and reduces the proportion of unstable neurons; for example, on CNN-B+CIFAR-10 (ε=2/255), VA rises from 37.40% to 50.40% (Table 1); and it makes the 17.2M-parameter ConvHuge fully verifiable.
- The authors do not have a dedicated limitations section; the experiments cover only MNIST/SVHN/CIFAR-10 and convolutional/ResNet architectures, VA is computed only on the first 1000 images of the test set, and for non-ReLU networks there are only preliminary results for the sigmoid three-layer CNN (Table A9).
- Evaluated models
- ConvBigCNN-BResNet-4BConvHugeSigmoid 3-layer CNN
- Benchmarks
- MNISTSVHNCIFAR-10
- Metrics
- UNRVASARATime
Linearity Grafting restores model performance while maintaining certifiability by linearizing unimportant ReLU neurons and optimizing the slope and intercept of the replaced linear activations. Experiments show that the method tightens certification bounds, achieves over 30% certifiable robustness improvement on CIFAR-10 models without certified robust training, and extends complete verification to adversarially trained models with 17M parameters.
Paper analysis
What problem does this paper attempt to solve?
To address the problem that certifiable robustness verification of large networks is expensive and certified training is too slow, the authors propose linearity grafting.
Core problem: certifiable robustness of deep networks is computationally expensive, with the main bottleneck being the large amount of nonlinearity in the network (unstable ReLU neurons), while existing certified robust training is slow to train and harms standard accuracy.
- Problem setting and importance: the authors argue that deploying DNNs in safety-critical scenarios requires proving the network's robustness under all bounded input perturbations; as networks grow larger, complete verification becomes time-consuming and expensive due to the large amount of nonlinearity from activation functions such as ReLU.
- Shortcomings of existing methods (per the paper): (i) existing verification methods (linear relaxation, semidefinite relaxation, BaB) either give bounds that are too loose or have complexity that grows with scale; (ii) many certified robust training methods improve certifiability by reducing unstable ReLUs, which often leads to a drop in standard accuracy, and training is long—the paper cites Xu et al. (2020a) using 2,000 epochs and Zhang et al. (2019b) using 3,200 epochs on CIFAR-10, far longer than the 100~200 epochs of standard adversarial training.
- Core observation: the authors state that introducing appropriate linearity can benefit certifiable robustness in multiple ways: tightening bounds, reducing unstable ReLU neurons, and improving verification scalability; and they consider sparsity (pruning) to be only a special case of linearity—zeroing out a neuron is equivalent to grafting a linear function with zero slope and zero intercept, which may overly restrict the network's expressive capacity.
- Paper's proposal: linearity grafting—starting from an adversarially trained model, replace unstable & insignificant ReLU neurons with learnable linear activations a×x+b, fine-tune the slopes and intercepts, then verify with a complete verifier; the authors state that competitive certified accuracy can be obtained without certified robust training, and that complete verification can be scaled to adversarially trained models with 17M parameters.
- Threat model:
- Defender's goal: prove that the network satisfies f(x)>0 under l∞-norm bounded perturbations (i.e., the prediction is not changed), with perturbation radii such as ε=2/255 for CIFAR-10/SVHN and ε=0.1 for MNIST.
- Defender's capability: modify the network structure (replace activation functions) after pretraining and fine-tune parameters, then invoke a complete verifier.
- Victim system: convolutional network/ResNet classifiers trained with fast adversarial training (FAT).
- Success criterion: the proportion of test samples for which the complete verifier (α,β-CROWN) gives a verified conclusion within the timeout (VA).
What related research exists?
Related work falls into three groups: network verification (complete/incomplete verifier), pruning, and the combination of pruning and robustness.
Network Verification
- Complete verifier: early methods were limited to small-scale problems and relied on solvers such as MILP (Tjeng et al., 2017) or SMT (Katz et al., 2017); BaB-type methods branch on ReLU neurons or inputs (Bunel et al., 2017; Wang et al., 2018b). Recently, BaDNB (De Palma et al., 2021) replaced the LP solver with a GPU iterative solver, and β-CROWN (Wang et al., 2021) completely removed the dependence on the LP solver using optimizable constraints.
- Incomplete verifier: faster but weaker, relying on duality (Dvijotham et al., 2018; Wong & Kolter, 2018), linear relaxation (Zhang et al., 2018), or semidefinite relaxation (Raghunathan et al., 2018b); cheap incomplete verifiers can be used during training, forming certified defense (Wong & Kolter, 2018; Gowal et al., 2018; Shi et al., 2021).
- Paper's positioning: this paper does not rely on certified defense; instead, it performs post-training grafting on adversarially trained models, then combines with a stronger complete verifier to obtain certified robustness.
Pruning
- Unstructured pruning: zeroes out unimportant parameters by heuristics such as weight magnitude (Han et al., 2015a), gradients (Molchanov et al., 2019), or hessian (LeCun et al., 1990); performance is good but hard to accelerate.
- Structured pruning: removes channels (Liu et al., 2017) or layers (Wang et al., 2018e) by importance scores; hardware-friendly but with performance loss; Dhillon et al. (2018) and Ye et al. (2020) specifically reduce the number of neurons to improve empirical robustness and accelerate.
Pruning and Robustness
- Gui et al. (2019), Sehwag et al. (2019; 2020), etc. pursue empirically robust and efficient subnetworks; Wang et al. (2018d) and Dhillon et al. (2018) treat compression as an empirical defense.
- Xiao et al. (2018) was the first to use weight sparsity to accelerate LP/MILP verification of MLPs; the paper points out that sparse weights do not necessarily produce zero or stable activations, especially for convolutional networks. Han et al. (2021) performs certified defense against adversarial patches by removing surface-layer neurons.
Baselines and Benchmarks: the baselines compared in the experiments are SAP (Dhillon et al., 2018), GAP (Ye et al., 2020), Hydra (Sehwag et al., 2020), Random Grafting, and the unpruned Baseline; the certified robust training comparison is AutoLiRPA (Xu et al., 2020a). The benchmarks are MNIST, SVHN, and CIFAR-10.
The authors state that the fundamental difference between this paper and existing work lies in recognizing two points: (i) linearity is the core factor in the difficulty of robustness certification; (ii) sparsity is only a special case of linearity, so grafting directly reduces ReLU instability rather than merely zeroing out.
How does the paper address this problem?
Four-step process: FAT adversarial training → select unstable and insignificant neurons by score → replace with learnable linear functions and fine-tune → verify with a complete verifier.
Overall idea: linearity grafting attributes verification difficulty to unstable ReLU neurons, and by replacing the unimportant ones among them with learnable linear activations, reduces nonlinearity while preserving expressive capacity, making the complete verifier feasible.
Problem Formulation
- The verification problem is written as min f(x) := z(L)(x), subject to the forward propagation of each layer and x ∈ C, where C is the l∞ ball centered at x0 with radius ε; it is called verified if f(x)>0 for all x∈C.
- Given intermediate-layer bounds l≤z≤u: if l≥0 or u≤0, the ReLU is in the linear region (always active or inactive); if l≤0≤u, it is an unstable neuron, the main source of certification obstacles.
- BaB-type complete verifiers split the domain in two by unstable neurons and estimate bounds within subdomains using an incomplete verifier; the number of unstable neurons directly determines computational and memory complexity, and too many leads to empty bounds and zero verified accuracy.
Starting Point: Adversarially Trained Model
- Start from an empirically robust model obtained from a cheap adversarial defense; such models are usually not certifiable; the goal is to improve their certifiable robustness without explicit certified defense training.
- Specifically, fast adversarial training (FAT, Wong et al., 2020) plus GradAlign regularization (Andriushchenko & Flammarion, 2020) is used, with training loss L := LFAT + λ × RGA, λ=0.2 (following the default).
Neuron Selection: Unstable and Insignificant
- Rank and normalize each neuron by how many images it is unstable on, obtaining an instability score ru∈[0,1]; compute importance by a heuristic (e.g., activation gradient magnitude) and normalize to obtain an importance score rs∈[0,1].
- Select neurons by γ×ru − rs, where γ adjusts the weight of instability; in the implementation, γ decays from 2 to 0 with the total number grafted, e.g., when grafting 20%, γ=2→1.5→1→0 for each 5% in turn.
- Figure 2 divides the ru, rs distributions into four quadrants, with quadrant IV (insignificant and unstable) being the target region; the authors state that GAP's activation gradient is the best-performing importance proxy (Figure A8), so it is used to compute rs.
Grafting and Fine-tuning
- Replace the selected ReLUs with a parameterized linear function Ag(x) := a×x + b, with each neuron having its own trainable slope a and intercept b; the authors state that this directly discards redundant nonlinearity, injects learnable linearity, and the grafted neurons are not forced to be inactive.
- During fine-tuning, the initial learning rate is 0.01 for a, b and 0.001 for the original network parameters, with cosine annealing for 100 epochs; the ablation (Table 3) adopts the scheme of updating the weights W simultaneously.
- After initialization analysis (Figure 6), the authors conclude that a∈[0.0,0.5], b∈[−0.5,0.5] is the "safe zone" for initialization.
Verification
- Certification is done with the SOTA complete verifier α,β-CROWN (Zhang et al., 2018; Xu et al., 2020a; Wang et al., 2021), to which custom activation support was added (each neuron can optionally be a ReLU or a linear function).
- The authors state that unlike cheap certification such as IBP, the complete verifier is stronger and does not require the model to accommodate weak certification methods, thus achieving a better trade-off between verified accuracy and standard accuracy.
What experiments did the paper conduct?
On four architectures across MNIST/SVHN/CIFAR-10, grafting improves VA, reduces UNR, and makes the 17.2M ConvHuge fully verifiable.
Experimental Setup
- Models tested: 7-layer ConvBig for MNIST/SVHN; 4-layer CNN-B, 11-layer ResNet-4B, ConvBig, and the 17.2M-parameter 7-layer ConvHuge for CIFAR-10; the appendix additionally has a sigmoid 3-layer CNN.
- Datasets: MNIST, SVHN, CIFAR-10; target perturbation ε=2/255 (ε=0.1 for MNIST), with ε=8/255 in appendix Table A7.
- Baselines: Baseline (no treatment), SAP, GAP, Hydra, Random Grafting (all 50%); the certified robust training comparison is AutoLiRPA (Xu et al., 2020a).
- Metrics: UNR (proportion of unstable neurons), VA (verified accuracy), SA (standard accuracy), RA (robust accuracy under PGD-100, 100 restarts), Time (average verification time).
- Evaluation method: VA, Time, and UNR are computed by the complete verifier α,β-CROWN with a 300-second timeout; SA and RA are evaluated on the full test set, while VA is computed only on the first 1,000 images of the test set due to computational cost; verification time statistics exclude samples that were misclassified or successfully attacked.
- Training: FAT+GradAlign (λ=0.2) for 200 epochs, learning rate 0.1 decayed tenfold at epochs 100 and 150, batch size 128, SGD (momentum 0.9, weight decay 5×10⁻⁴).
Main Results
According to Table 1 (ε=2/255, ε=0.1 for MNIST), VA/SA (%) of 50% grafting vs. Baseline for each model:
Swipe horizontally to read the table
Model (dataset) Baseline VA Grafting(50%) VA Baseline SA Grafting(50%) SA ConvBig (MNIST) 0.10 82.30 99.29 98.68 ConvBig (SVHN) 16.70 57.80 89.71 78.75 CNN-B (CIFAR-10) 37.40 50.40 79.95 74.08 ResNet-4B (CIFAR-10) 0.80 38.10 76.69 60.13 ConvBig (CIFAR-10) 1.30 39.12 84.90 62.23 ConvHuge (CIFAR-10) -(OOM) 28.30 90.68 62.62 - The authors state that grafting brings certified accuracy improvements and UNR reductions on models not trained with certified defense, at the cost of lower SA, but with a better trade-off, especially for (ConvBig, MNIST/SVHN).
- Compared with the three pruning baselines, the authors state that grafting has advantages in UNR, VA, and the SA/VA trade-off; in Table 1 on CIFAR-10, SAP has the highest VA among pruning baselines but lower SA, GAP has the highest SA but the lowest VA, and Hydra is in between.
- The ConvHuge (17.2M) Baseline runs out of memory (OOM) on a 48GB GPU due to too many unstable neurons and cannot be verified; after 80% grafting, VA reaches 32.30% and Time is 4.06s, but SA drops to 40.80% (Table 1).
Grafting Ratio and Verification Time
- 30%→50%: VA rises further and UNR decreases; 50%→80%: the authors state that too much linearity begins to harm generalization and robustness, especially on CIFAR-10 (e.g., CNN-B's SA drops from 74.08% to 61.20%, Table 1).
- The authors report that complete verification time decreases by 5.99%~94.08% for most grafted networks; the exception is 30% grafting on (ResNet-4B / ConvBig, CIFAR-10), which is slower than Baseline, which the authors explain as the Baseline's empty bounds triggering the verifier to give up early.
- Figure 3 shows that after grafting the unstable-neuron distribution shifts toward zero; Figure 4 shows that the average lower bound of grafted networks after BaB is tighter, with the authors stating that bounds are tightened by 5~744 times.
Comparison with Certified Robust Training and Other Ablations
- Comparison with certified training (Table 6): on CNN-B+CIFAR-10 (ε=2/255), FAT+Grafting(50%) has VA 50.40%, SA 74.08%, and 1.13h training; AutoLiRPA certified robust training has VA 47.55%, SA 58.00%, and 16.26h training. The authors state that the former has 2.85% higher VA, 16.08% higher SA, and saves 92.87% of training time.
- Grafting criterion ablation (Table 2, ConvBig+CIFAR-10, 50%): using only −rs gives VA 2.10%/SA 82.35%, using only ru gives VA 38.70%/SA 59.39%, and γ×ru−rs with γ linearly decaying 2→0 gives VA 39.12%/SA 62.23; the authors state that decaying γ shifts toward the importance score when grafting more neurons, preserving expressive capacity.
- Grafting zero vs a×x+b (Table 5, CNN-B, 50%): Ag(x)=0 gives VA 48.40%/SA 73.19%, Ag(x)=a×x+b gives VA 50.40%/SA 74.08%, and the authors state that the learnable linear function is better on all metrics; gradual grafting gives VA 49.00%/SA 75.43%, preserving more SA but sacrificing VA.
Other Ablations and Analyses
- Fine-tuning weights (Table 3, ConvBig 50%): updating W simultaneously gives VA 39.12%/RA 47.73%, tuning only a, b gives VA 36.20%/RA 44.33%.
- Combination with existing regularizers (Table 4, CNN-B 50%): adding ReLU Stability Reg. gives VA 51.90%, adding l1 Reg. gives VA 51.90%, adding Small Weight Pruning gives VA 52.50%, adding all gives VA 52.55% (grafting alone is 50.40%).
- Initialization (Figure 6): the authors state that performance is more sensitive to slope a, especially for a∈[0.5,0.8].
- Grafting location (Figure 7): grafted neurons are mainly concentrated in layers z(1)~z(3) and z(6), with learned slopes distributed in [0.1,0.3] and intercepts centered at 0.
- ε=8/255 (Table A7, CNN-B): Grafting(50%) VA 4.70% (Baseline 0.30%), Grafting(80%) VA 14.90%/SA 46.76%.
- Corner case (Table A8, CNN-B, PIE corner-case set): after grafting, VA 20.72% (+11.71%), SA 51.35% (−2.70%).
- Non-ReLU (Table A9, sigmoid 3-layer CNN): after grafting, VA 39.46% (+0.84%), GAP is 35.41% (−3.21%); the authors state that the small improvement is mainly because existing verifiers have limited support for non-ReLU activations.
What are some points that can be further explored?
The authors propose designing verification-friendly architectures that mix linear/nonlinear as a future direction; the experiments cover three datasets and four main architectures.
Limitations and future directions noted by the authors
- Future direction (Conclusion): The authors state that grafting motivates them to design verification-friendly architectures in the future that mix linear and nonlinear activation functions.
- Non-ReLU support (Appendix A1): The authors state that the grafting idea can be generalized to other nonlinear functions, but on sigmoid networks the VA improvement is small (+0.84%, Table A9); the authors believe this is mainly because existing verifiers have limited support for non-ReLU activations.
- Cost of the grafting ratio (Sec. 5.1): The authors point out that from 50%→80%, too much injected linearity begins to harm generalization and robustness, especially on CIFAR-10; ConvHuge needs grafting above 50% to obtain satisfactory VA, and SA decreases.
- Computational overhead (Appendix A1): The authors state that grafting does not speed up model computation; the additional binary mask increases training from 0.076s to 0.123s per batch (ConvBig).
- Potential misuse (Appendix Societal impact): The authors state that the method could be misused to identify DNN weaknesses and guide malicious attacks.
Scope of experiments
- The models tested are the four main architectures ConvBig, CNN-B, ResNet-4B, ConvHuge, plus the sigmoid 3-layer CNN in the appendix, 5 in total; the datasets are MNIST, SVHN, CIFAR-10 (Sec. 5).
- The perturbation setting is l∞ with ε=2/255 (0.1 for MNIST) and ε=8/255 in the appendix (CNN-B only, Table A7); the empirical attack evaluation is PGD-100.
- VA is computed only on the first 1,000 images of the test set, with a 300-second timeout; SA and RA are evaluated on the full test set (Sec. 5).
- The verifier used is only α,β-CROWN (β-CROWN for Table A7); the certified training comparison is only AutoLiRPA (Xu et al., 2020a) (Table 6).
- The paper does not report the number of repetitions or variance of VA measurements; for non-ReLU networks there are only preliminary results for the sigmoid 3-layer CNN (Table A9).
Summarize the main content of the paper
linearity grafting: replace unstable and unimportant ReLUs with a learnable linear function, improving certified accuracy without certified training.
A defense paper on certified robustness: in large networks, a large number of unstable ReLU neurons makes complete verification expensive or even infeasible, and certified robust training is slow to train and harms accuracy.
- Method: linearity grafting starts from a FAT adversarially trained model, selects unstable and unimportant neurons by instability score ru and importance score rs (γ×ru−rs, with γ decaying from 2 to 0), replaces them with a learnable linear activation a×x+b and fine-tunes, then verifies with the complete verifier α,β-CROWN; ordinary pruning is a special case equivalent to grafting the zero function.
- Main results (Table 1, ε=2/255): 50% grafting raises VA from 0.10% to 82.30% on ConvBig+MNIST, and from 37.40% to 50.40% on CNN-B+CIFAR-10; the 17.2M-parameter ConvHuge originally could not be verified due to OOM, and after 80% grafting VA reaches 32.30%.
- Efficiency (Table 6): The authors report that FAT+Grafting saves 92.87% of training time compared with AutoLiRPA certified robust training (1.13h vs 16.26h), with VA higher by 2.85% and SA higher by 16.08%.
- Costs and exceptions: SA decreases as the grafting ratio rises (e.g., SA drops to 61.20% at 80% for CNN-B); at ε=8/255 VA is only 4.70% (50%); on sigmoid networks VA improves by only 0.84%.
- Authors' conclusion: The authors believe that appropriate linearity is beneficial for certified robustness, that grafting improves robustness verification in VA, verification speed and scalability, and they propose future verification-friendly architectures that mix linear and nonlinear functions.
Related papers
- Stratified Adversarial Robustness with RejectionDefensesarXiv
Show 3 more papers
- Training verified learners with learned verifiersDefensesarXiv
- Machine UnlearningDefensesS&P 2021