Understanding robust learning from the perspective of representation similarityUnderstanding Robust Learning through the Lens of Representation Similarities
The authors use representation similarity tools such as CKA to compare the per-layer representations of robust and non-robust vision networks, and state that robust networks lack layer specialization and that deep layers are more prone to overfitting.
- Adversarial robust training trades robustness for a drop in benign accuracy, slow convergence, and reliance on larger architectures; the authors consider understanding how the representations learned by robust networks differ from those of non-robust networks to be a way to diagnose these problems.
- Using Linear CKA as the primary metric and SVCCA and Orthogonal Procrustes as secondary metrics, per-layer representation similarity is compared between robust and non-robust networks on CIFAR-10, ImageNette and ImageWoof, covering different widths, perturbation budgets, training methods and five threat models.
- The authors report: robust networks have high cross-layer similarity and the block structure disappears; the first approximately one-third of layers in non-robust networks are insensitive to perturbations; after about 30 epochs of robust training, overfitting appears in deep layers; the representations learned under the Snow and Gabor threat models are similar.
- In the Discussion, the authors point out that representation similarity can only reveal trends and cannot directly improve loss and accuracy, and that follow-up work is needed to turn the observations into training strategies. Experiments are limited to three image datasets, ResNet-type architectures and five threat models.
- Evaluated models
- Wide ResNet (Wrn-28-10)Wide ResNet (Wrn-28-N, N=1–9)ResNet-50ResNet18
- Benchmarks
- CIFAR-10ImageNetteImageWoof
- Metrics
- Linear CKASVCCAOrthogonal Procrustes similaritybenign accuracyrobust accuracytransfer accuracy
A group of researchers used representation similarity metrics on three vision datasets to compare layer by layer robust and non-robust deep neural networks under different training methods, architecture parameters and adversarial constraints, in order to understand the differences in the properties of the two types of representations. The authors state that such comparisons help diagnose several prominent problems of robust networks, including performance degradation on benign inputs, poor robustness generalization and increased overfitting. Experiments find that robust networks' representations lack specialization and that block structure disappears, and that overfitting in robust training mainly affects deeper layers; the authors consider these properties to be the basis of the behavioral differences of robust networks and point out directions for designing and training better robust networks.
Paper analysis
What problem does this paper attempt to solve?
Uses representation similarity tools to compare the internal representations of robust and non-robust networks layer by layer, explaining the known shortcomings of robust training.
Core question: How do the internal representations learned by robust training differ from standard training, and how do these differences explain the known deficiencies of robust networks.
- Problem setting: Adversarial examples prompted the emergence of robust training methods, but the authors note that such methods have worse benign accuracy, converge more slowly, and appear to require larger architectures (§1). Robust models also suffer from a large robust accuracy generalization gap: on CIFAR-10, the Wrn-28-10 robust model has a robust accuracy train/test gap of 54.0% (Table 1).
- Shortcomings of existing methods: The authors argue that aggregate metrics such as loss and accuracy are task-driven and cannot support layer-by-layer representation comparison (§1).
- Core hypothesis: The authors propose that since representation learning underlies downstream performance, understanding robust representations is an effective way to identify directions for improving robust training (§1).
- Paper approach: Use representation similarity (RS) metrics (primarily CKA) to perform layer-by-layer comparisons of networks under different training methods, architecture parameters, and adversarial constraints on three vision datasets (§1).
- Analysis target setup: The analysis targets image classification networks; robust models are trained with adversarial training (PGD) or TRADES, the default threat model is ℓ∞ perturbation (ϵ=8/255 for CIFAR-10, ϵ=4/255 for ImageNet subsets), and four other threat models—ℓ2, JPEG, Gabor, Snow—are also tested (§2.3, Appendix A.2).
What related research exists?
Related work falls into three groups: robust training methods, representation similarity tools, and research on visualizing network properties.
Robust training methods
- Madry et al. (2018)—proposed adversarial training, changing empirical risk minimization into min-max optimization; the paper states it is the most effective method for training robust classifiers (§2.1).
- Zhang et al. (2019)—TRADES, which improves adversarial training by balancing the trade-off between robustness and accuracy; this paper uses it as one of the robust training methods for comparison (§2.1, §5).
- Raghunathan et al. (2018)—certified defenses, mentioned in the introduction as a class of robust training methods (§1).
Representation similarity (RS) tools
- Raghu et al. (2017), Morcos et al. (2018)—SVCCA and PWCCA, CCA-based representation comparison metrics (§2.2).
- Kornblith et al. (2019)—CKA, the primary metric chosen in this paper, for its orthogonality and isotropic invariance and its wide use; that paper also found that the linear kernel and RBF kernel have comparable accuracy but the former is faster (§2.2).
- Ding et al. (2021), Bansal et al. (2021)—Orthogonal Procrustes distance and model stitching; the paper notes that Ding et al. (2021) found CKA is insensitive to removing principal components strongly correlated with accuracy, but the authors state this does not affect the way this paper uses CKA (§2.2).
Visualization and verification of network properties
- Nguyen et al. (2020)—found that block structure appears in non-robust networks as width increases; this paper does not observe this structure in robust networks and uses this as the starting point for comparison (§3).
- Raghu et al. (2021), Grigg et al. (2021), Kornblith et al. (2021)—study representation differences between Transformer and CNN, self-supervised and supervised, and loss function and feature transfer, respectively (Appendix A.3).
- Gavrikov and Keuper (2022), Ilyas et al. (2019)—use convolutional filters to understand robust training and visualize the input features required for robust training (Appendix A.3).
Comparison setup: This paper does not propose a new classification method and has no baseline methods; the comparison objects are networks obtained by non-robust training and robust training (PGD, TRADES) under the same architecture, with datasets CIFAR-10, ImageNette, and ImageWoof (§2.3).
The authors position this paper as an analysis work that uses RS tools to uniformly compare robust and non-robust representations, distinct from studies that focus only on aggregate metrics or specific phenomena (§1).
How does the paper address this problem?
Compares representations layer by layer with Linear CKA, analyzing along five lines: training strength, architecture, perturbed inputs, training dynamics, and threat models.
Overall approach: robust training is formalized as a min-max problem, and representation similarity metrics (primarily Linear CKA) are used to compare the activation matrices of network layers pairwise, analyzing the properties of robust representations from five angles. The framework has no separate name.
Problem setting and formalization
- Adversarial examples are defined as δ = argmaxx+δ ∈ N(x) ℓ(f(x+δ), y), where N(·) is the adversarial constraint; robust training is minθ 𝔼(x,y)∈𝒟 [maxx+δ ∈ N(x) ℓ(fθ(x+δ), y)] (Eq. 1).
- Layer activations fall into two categories: benign representation (non-adversarial input) and adversarial representation (adversarial example input) (§2.1).
Representation similarity tools
- The primary metric is Linear CKA: Linear CKA = (|Y⊤ X|F2)/(|X⊤ X|F |Y⊤ Y|F), which measures the degree of alignment of the Gram structure of two layers' activation matrices (Eq. 3).
- Reasons for choosing CKA: invariance to orthogonal transforms and isotropy, and widespread use in prior work; only the linear kernel is used (§2.2).
- Online CKA is used to reduce memory: batch-size 1024, 3 passes over the dataset to reduce randomness (§2.3).
- The per-layer analysis covers all layers, including convolution, pooling, activation and batch-normalization layers (§2.3).
Five lines of analysis
- Benign representation comparison (§3): within-network cross-layer CKA heatmaps to examine block structure; direct cross-network comparison of non-robust and robust networks; ablations on training ϵ (2.0/8.0/16.0, units of 1/255) and network width (wrn-28-1/4/8).
- Perturbed representation comparison (§4): CKA between benign and adversarial representations within the same network; cross-network transfer experiments, generating adversarial examples from a source network (Wrn-28-10) and comparing their per-layer representations on the target network.
- Training dynamics (§5): CKA between each epoch's representations and the final epoch (epoch 100) representations, to examine convergence speed and stability of each layer; covers three training methods: non-robust, PGD, TRADES.
- Threat model influence (§6): pairwise cross-layer CKA of Wrn-28-10 trained under five threat models (ℓ2, ℓ∞, JPEG, Gabor, Snow), and varying perturbation strength to see how alignment changes.
Experimental configuration
- Datasets: CIFAR-10 (Wide ResNet), ImageNette and ImageWoof (ImageNet subsets, ImageNet-based ResNets); the authors state they use subsets because adversarial training on full ImageNet is costly (§2.3).
- Attack settings: 10-step PGD for training, 20-step PGD for testing to generate adversarial representations; CIFAR-10 default ℓ∞ ϵ=8/255, ImageNet subsets ϵ=4/255 (§2.3).
- Default strengths for other threat models: ℓ2 ϵ=1, JPEG ϵ=25, Snow ϵ=2, Gabor ϵ=75 (Appendix A.2).
What experiments did the paper conduct?
Five sets of analysis experiments: benign representations, perturbed representations and transfer, training dynamics, threat model alignment, plus accuracy and ablation.
Experimental setup
- Models tested: Wide ResNet (Wrn-28-N, width factor N=1–10) on CIFAR-10; ResNet-18 and ResNet-50 on ImageNette/ImageWoof; ResNet-18 for the SVCCA/Procrustes comparison due to compute constraints (§2.3, Appendix B.1).
- Datasets: CIFAR-10, ImageNette, ImageWoof (ImageNet subsets) (§2.3).
- Training methods: non-robust training, PGD adversarial training, TRADES; trained for 100 epochs (§5, Figure 6).
- Metrics: Linear CKA (primary), SVCCA, Orthogonal Procrustes similarity; benign accuracy, robust accuracy, transfer accuracy (§2).
- Attack settings: 10-step PGD for training, 20-step PGD for testing; ℓ∞ defaults ϵ=8/255 (CIFAR-10), 4/255 (ImageNet subsets) (§2.3).
- CKA computation: online CKA, batch-size 1024, 3 passes over the dataset (§2.3).
Main results
The paper's main results are presented as heatmaps; the quantitative results that can be checked are as follows (from Table 1, CIFAR-10, Wrn-28-10):
Swipe horizontally to read the table
Network Benign accuracy Train Benign accuracy Test Robust accuracy Train Robust accuracy Test Robust generalization gap ∆ Non-robust 100.0% 94.9% 0.0% 0.0% 0.0% Robust 100.0% 87.6% 98.2% 44.2% 54.0% - The authors state that robust networks have high cross-layer similarity and pronounced long-range similarity, and that the block structure known in non-robust networks disappears in robust networks (Figure 2a–c); direct comparison of benign representations between non-robust and robust networks shows low similarity (Figure 2d).
- The authors state that increasing the training ϵ makes the block structure fade until it disappears, and that increasing width by an order of magnitude does not change this phenomenon, and they interpret the high cross-layer similarity as a relative capacity decrease (Figure 3).
- The authors state that these observations hold across architectures, datasets and threat models (§3).
Perturbed representations and transferability
- What was measured: CKA between benign and adversarial representations; robust accuracy and per-layer CKA of cross-network transfer (Figure 4, 5).
- Results: In non-robust networks, the similarity of adversarial representations to the last layer decays to near zero, but the first roughly one-third of layers (ImageNette/ImageWoof) remain highly similar (Figure 4); in robust networks, benign and adversarial representations are highly similar throughout, diverging only in the last roughly 10 layers (§4.1). In the transfer experiments (Figure 5a, source is Wrn-28-10), robust accuracy of non-robust→non-robust transfer is as high as 97% (NR-1→NR-10), while robust→non-robust is as low as 0% (R-10→NR-1, R-5→NR-5, R-1→NR-1).
- Authors' interpretation: The poor robust→non-robust transfer is because adversarial perturbations distort the non-robust network's representations in a different way starting from the first layer (Figure 5d shows CKA drops after the first layer) (§4.2).
Training dynamics and overfitting
- What was measured: CKA between each epoch's representations and the epoch-100 representations, together with training/validation loss (Figure 6, Appendix D).
- Results: Representations of the first two blocks converge to their final state within about 10 epochs; for robust models, after about 30 epochs the adversarial validation loss rises while the training loss falls, and deep-layer CKA decreases in tandem (§5).
- Authors' interpretation: Deep layers overfit during robust training; under a high budget (ϵ=16/255), the second block converges more slowly and instability appears earlier (§5, Appendix D.2).
Threat model alignment
- What was measured: Pairwise cross-layer CKA of Wrn-28-10 trained under five threat models (ℓ2, ℓ∞, JPEG, Gabor, Snow) (Figure 7, Appendix E).
- Results: The per-layer similarity structure of ℓ2 and ℓ∞ models is similar to comparisons within the same threat model; the average similarity between ℓ∞ and JPEG is higher than with Snow or Gabor; the average similarity between Snow and Gabor is the highest (§6).
- Authors' interpretation: The Snow-Gabor correspondence was previously unknown, and the authors state this is a new finding; these results may help train jointly robust models (§6).
Other ablations and analyses
- RS metric ablation: SVCCA and Orthogonal Procrustes on ResNet-18 show trends consistent with CKA, with CKA giving the clearest structure (Appendix B.1, Figure 9).
- Training method comparison: Wrn-28-5 representations trained with PGD and TRADES have similar structure (Appendix B.3, Figure 12).
- Width ablation: Validation adversarial accuracy of robust Wrn-28-N with width 1–10 ranges from 42.92% (N=1) to 48.89% (N=10) (Table 3).
- Within-class CKA: The authors' original hypothesis was that robust networks have lower within-class similarity; this holds on CIFAR-10 and ImageNette, but is reversed on ImageWoof, which the authors leave for future research (Appendix B.5).
- TRADES dynamics exception: The dynamic patterns observed in PGD training disappear in TRADES training, which the authors state reflects CKA's sensitivity to changes in training dynamics (Appendix D.3).
What are some points that can be further explored?
The authors point out that RS metrics cannot directly improve aggregate performance; experiments are limited to three image datasets and ResNet-type architectures.
Limitations and future directions noted by the authors
- Disconnect between aggregate metrics and per-layer similarity (§7 Discussion): The authors state that RS metrics can only reveal trends and differences, and cannot provide a direct way to improve aggregate properties such as loss and accuracy.
- Follow-up work needed to translate the observations (§7 Discussion): The authors state that improvements must be inferred from the similarity analysis, and that future work needs to turn this paper's observations into actionable changes to training strategies and architectures.
- Unresolved phenomenon of within-class similarity (Appendix B.5): On ImageWoof, the within-class CKA contribution of robust networks is instead higher, opposite to CIFAR-10 and ImageNette, which the authors explicitly leave for future research.
- Direction of joint robust training (§6, Appendix E.3): The authors state that the cross-threat-model alignment results may help train models jointly robust to multiple types of attacks; Appendix E.3 further states that alignment decreases under large budgets, which may require explicit constraints on representations during training.
Scope of experiments
- Models tested are Wide ResNet (Wrn-28-1 to Wrn-28-10), ResNet-18, ResNet-50, all convolutional networks (§2.3).
- Datasets are three image classification datasets: CIFAR-10, ImageNette, ImageWoof, the latter two being ImageNet subsets (§2.3).
- Threat models cover five: ℓ∞, ℓ2, JPEG, Gabor, Snow (§6, Appendix A.2).
- Robust training methods cover two: PGD adversarial training and TRADES (§2.1, §5).
- The paper does not report the number of repetitions or variance for each experiment; CKA computation uses 3 passes to reduce randomness (§2.3).
Summarize the main content of the paper
Layer-by-layer CKA analysis shows that robust network representations lack specialization and overfit in deep layers, and explains the phenomenon of transferability asymmetry.
A paper that uses representation similarity tools to analyze the internal representations of adversarially robust networks, with the goal of explaining from the representation level the known deficiencies of robust training (decreased benign accuracy, large generalization gap, overfitting).
- Problem: Robust training trades benign performance for robustness; on CIFAR-10, the Wrn-28-10 robust model has a test benign accuracy of 87.6% (94.9% for the non-robust one), and the robust accuracy generalization gap is 54.0% (Table 1). The authors argue that aggregate metrics cannot diagnose these problems layer by layer.
- Method: Linear CKA is used as the primary metric (SVCCA and Orthogonal Procrustes verify consistency), performing layer-by-layer representation comparisons on Wide ResNet and ResNet on CIFAR-10, ImageNette, and ImageWoof, ablating width, perturbation budget, training method, and five threat models.
- Result one: Robust networks have high cross-layer similarity and the block structure disappears; increasing the training ϵ has an effect similar to decreasing width, which the authors interpret as a relative capacity decrease (Figure 2, 3).
- Result two: The first approximately one-third of layers in non-robust networks are insensitive to perturbations, while benign and adversarial representations in robust networks are highly similar throughout (Figure 4).
- Result three: Adversarial examples transfer poorly from robust to non-robust (robust accuracy as low as 0%, Figure 5a); the authors state this stems from perturbations distorting the non-robust network representations in different ways starting from the first layer.
- Result four: After about 30 epochs of robust training, signs of overfitting appear in deep layers, while shallow layers converge at about 10 epochs (Figure 6).
- Conclusion: The authors argue that robust networks need an explicit inter-layer differentiation mechanism and regularization targeting deep layers, and state that the cross-threat-model similarity results (e.g., Snow and Gabor representations being similar) provide a direction for joint robust training (§7).