nave-xai

Concept explanations of vision, time-series and text encoders.

NAVE explanations

Which concepts does a vision encoder extract, and where? nave-xai is the official package of NAVE, from Multi-depth Concept Extraction for Post-Hoc Vision Encoder Explanation (ECML PKDD 2026), with Samuel G. Fadel and Sebastian Mair. NAVE combines the activations of a frozen encoder at several depths, extracts concepts from them without supervision, and maps them back onto the input: an explanation of the encoder itself, before any classifier.

pip install nave-xai

PyPI · Code on GitHub · Documentation · Paper · GIMP plugin

Try it in your browser

All 22 notebooks open in Google Colab and installs what it needs in its first cell (a Google account is needed; the training notebooks are best run with a GPU: Runtime › Change runtime type).

Getting started

Notebook What it shows  
Demo A tour: explanations, depth, concepts across images, summaries Open in Colab
Time series A 1D ResNet on smartwatch motions: segments, snippets, profiles Open in Colab
Text spaCy’s encoder and a topic classifier on Reuters news Open in Colab

Animations

Notebook What it shows  
Encoder blocks A ViT or a ResNet, block by block, with UMAP, explanation and saliency Open in Colab
Training A ResNet34 learning Imagenette, checkpoint by checkpoint Open in Colab
Augmentation Does the explanation survive rotation, zoom, colour shifts, noise, blur? Open in Colab
Supervised and self-supervised ImageNet against DINO training, for ViT-S/16 and ResNet50 Open in Colab
Image atlas UMAP of the tokens, as points and as the patches themselves Open in Colab
Artifacts The high-norm tokens of ViTs, and how they relate to the other concepts Open in Colab
Shortcut A mark on one class: a model trained with it and one without Open in Colab
Fine-tuning An ImageNet ResNet34 fine-tuned on satellite images, with CKA per block Open in Colab
Overfitting Few images of two classes: a training image against a validation image Open in Colab
Imbalance One class ten times rarer: how many concepts each class gets Open in Colab

Inspecting models

Notebook What it shows  
Training Random, supervised and self-supervised weights of the same architecture Open in Colab
Architectures ViTs and ResNets on the same photo, and how similar their decompositions are Open in Colab
Depth Where information is compressed, block by block Open in Colab
Registers ViT artifacts with and without registers (DINOv2) Open in Colab
Shortcuts Measuring whether a spurious cue takes over the explanation Open in Colab
Concepts as features Classifying images from their concepts’ proportions Open in Colab
Localization Boxes around objects from NAVE’s regions Open in Colab
Uncertainty Where the encoder hesitates Open in Colab
Causality Do the concepts that come with a class drive its score? Interventions in a ResNet50 and a ViT Open in Colab