Show Me What You Don't Know: Efficient Sampling from Invariant Sets for Model Validation
Organizations: Computer Vision and Learning Lab, Heidelberg University.
Abstract
The performance of machine learning models is determined by the quality of their learned features. They should be invariant under irrelevant data variation but sensitive to task-relevant details. To visualize whether this is the case, we propose a method to analyze feature extractors by sampling from their fibers -- equivalence classes defined by their invariances -- given an arbitrary representative. Unlike existing work where a dedicated generative model is trained for each feature detector, our algorithm is training-free and exploits a pretrained diffusion or flow-matching model as a prior. The fiber loss -- which penalizes mismatch in features -- guides the denoising process toward the desired equivalence class, via non-linear diffusion trajectory matching. This replaces days of training for invariance learning with a single guided generation procedure at comparable fidelity. Experiments on popular datasets (ImageNet, CheXpert) and model types (ResNet, DINO, BiomedClip) demonstrate that our framework can reveal invariances ranging from very desirable to concerning behaviour. For instance, we show how Qwen-2B places patients with situs inversus (heart on the right side) in the same fiber as typical anatomy.
Figures & tables
| Subject Model | Fiber Model | TF FID | PT FID | Classifier top-5 accuracy |
| Baseline on ImageNet | 26.21 | - | ||
| DINOv2 | NDTM | 28.34 | 29.68 | |
| InceptionV3 | NDTM | 33.52 | 3.81 | |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| blocks per residual net | 3 |
| layers per block | 3 |
| layer size | 512 |
| latent dimension | 54 |
| activation function | SiLU |
| epochs | 700 |
| lr scheduler | one-cycle |
| Training conditional model | Time per sample conditional model | Time per sample NDTM |
| min | 0.3 min | 1.8 min |
| Subject Model | Dataset | invariant samples | nearest neighbor | augmented |
| DINOv2 | ImageNet | 273 4 | 1225 | 440 |
| Inception | ImageNet | 34.8 0.7 | 123.9 | 94.9 |
| DINOv2 | Cue Conflict | 487 3 | 1069 | 946 |
| ResNet | Cue Conflict | 38.1 0.7 | 74.9 | 101.3 |
| BiomedClip | CheXpert | 4.9 9.9 | 23.3 | - |
| ConvNext | CheXpert | 1.2 0.0 | 10.9 | - |