Abstract
Conditional Diffusion Models (CDMs) are powerful image generators, yet they often entangle essential class semantics with irrelevant environmental context. This paper introduces CLARID (Canonical LAtent Representation IDentifier), a framework designed to isolate the core categorical features within a CDM's latent space. By mathematically filtering out "extraneous directions" using the Jacobian of the model's features, we derive Canonical Latent Representations (CLAReps). These purified representations are then used in a distillation process called CaDistill to train robust student networks. Our results show that distilling knowledge via CLAReps significantly enhances adversarial robustness and generalization, achieving superior performance with only 10% of the training data compared to traditional distillation methods.
Introduction: The "Messy Teacher" Problem
While Conditional Diffusion Models (CDMs) excel at modeling complex data distributions, they are often "messy" teachers for discriminative tasks. Because CDMs aim for high-fidelity reconstruction, they entangle the core features of an object (e.g., the shape of a fish) with irrelevant background cues (e.g., the person holding it). When these models are used to distill knowledge into smaller student networks, the students frequently learn "spurious correlations"—background features that happen to correlate with labels but are not essential to the class. This leads to models that are fragile under adversarial attack and fail to generalize when backgrounds change.
Methodology: CLARID and CaDistill
To address this entanglement, we propose two primary frameworks:
1. CLARID: Identifying the Semantic Core
CLARID identifies the "Canonical Latent Representation" (CLARep) of an image by inverting it into the CDM’s latent space at a specific timestep. The core innovation lies in analyzing the Jacobian of the CDM’s features to identify "extraneous directions"—dimensions that alter the image's appearance without changing its class identity. By projecting the latent code onto a subspace orthogonal to these directions, we "strip away" the noise, leaving a Canonical Sample that represents the class-defining essence.
2. CaDistill: Purified Feature Distillation
CaDistill uses the CDM as a teacher, but instead of transferring all features, it transfers knowledge exclusively via CLAReps. We employ Centered Kernel Alignment (CKA) to align the student's internal representations with the teacher's "Canonical Features," ensuring the student focuses on robust, class-relevant structures.
Visualizing Canonical Samples
The effectiveness of CLARID is most apparent when decoding CLAReps back into the image space. These "Canonical Samples" act as interpretable prototypes, stripping away class-irrelevant variations like specific backgrounds or lighting conditions while preserving the core object.
Key Results and Insights
Our evaluation across benchmarks like ImageNet-1K and CIFAR-10 revealed several critical findings:
- Enhanced Robustness: On CIFAR-10, CaDistill improved PGD adversarial attack accuracy to 47.9%, a significant jump from the 33.4% achieved by vanilla models.
- Background Independence: In the "Backgrounds Challenge," models trained with CaDistill maintained higher accuracy when backgrounds were randomized, proving they learned to ignore spurious environmental cues.
- Data Efficiency ("Less is More"): Remarkably, using CLAReps for just 10% of the training data was sufficient to outperform state-of-the-art methods like RepFusion that utilize the entire dataset. This suggests that high-quality, purified semantic signals are far more valuable than raw, entangled data.
- The Semantic Manifold Hypothesis: Our work supports the idea that class semantics exist on low-dimensional manifolds within the high-dimensional latent space. CLARID effectively finds the "anchor points" on these manifolds.
Discussion and Limitations
While CLARID offers a powerful tool for semantic extraction, it is computationally intensive due to the need for Jacobian singular vector calculations. Future work will focus on scaling this approach to larger datasets and exploring its applicability to diffusion models operating directly in pixel space rather than latent space. Additionally, the selection of hyperparameters such as the inversion timestep ($t_e$) remains crucial for avoiding visual artifacts in canonical samples.
Summary updated