No reviews yetBe the first to leave a review for FeatLens
Maker
📌
Feature visualization is part of my daily routine as a computer vision researcher. But doing it across different model providers was always a mess. So this weekend, I finally fixed it 🧩
Every model lives somewhere different, torch.hub, timm, HuggingFace, some random GitHub repo, and each one needs its own glue code just to pull out and visualize feature maps. I got tired of rewriting that glue every single time. 🤖
So I built FeatLens: a model-agnostic framework to see what any vision model actually encodes.
🔹 Load from anywhere — timm, HuggingFace, torch.hub (like V-JEPA), an external repo, or your own nn.Module (yes, CNNs too)
🔹 Any layer, laid out as a clean model × layer grid
🔹 Color the features by PCA, cosine similarity, k-means, foreground, saliency, or attention-rollout
🔹 Match patches across two images, batch a whole folder, or sweep a video clip
Just swap the models, and watch the features change completely. It's oddly satisfying to look at.
This was a weekend project I built with my friend Claude, from core design to docs, tests, and CI.
It's open source, and you can just pip install featlens
⭐ GitHub: https://lnkd.in/dGvb7uNi
📖 Docs: https://lnkd.in/dQMV9-Bc
🤗 Live demo: https://lnkd.in/d6HeRJk6
If it's useful in your work, it's citable, and contributions are very welcome.
Which model would you want to peek inside first? 👀
Report
How does this handle really deep models like a 50 layer resnet without choking on memory, and can I export the visualizations as a video to watch how features evolve across layers?
Memory: it only hooks the layers you ask for and stores them detached (no grads, eval mode), so cost scales with the number of selected layers, not model depth.
Layer-evolution video: not built-in yet. video() animates frames, not layers. But visualize(..., return_data=True) gives you the per-layer RGB maps, so a "layers-as-frames" GIF is going to be implemented in future
Report
curious how this handles models that aren't trained on imagenet, does the PCA still produce something visually meaningful or do you need to tweak the preprocessing per backbone
Report
Maker
@harunbalkabak PCA here is unsupervised and per-image. It fits the model's own feature distribution for a single image, so it has nothing to do with ImageNet classes or labels. Any backbone with spatially coherent features (SSL, CLIP/SigLIP, MAE, V-JEPA, SAM, even a satellite/medical model via the escape hatch) produces something meaningful; the robust PCA (MAD outlier filtering) keeps a few extreme patches from washing out the colors.
Report
the per-channel intensity scaling in the PCA-to-RGB output looks really well-tuned, colors stay distinct without blowing out even on deeper layers.
How does this handle really deep models like a 50 layer resnet without choking on memory, and can I export the visualizations as a video to watch how features evolve across layers?
@sudenaz3r0b
Memory: it only hooks the layers you ask for and stores them detached (no grads, eval mode), so cost scales with the number of selected layers, not model depth.
Layer-evolution video: not built-in yet. video() animates frames, not layers. But visualize(..., return_data=True) gives you the per-layer RGB maps, so a "layers-as-frames" GIF is going to be implemented in future
curious how this handles models that aren't trained on imagenet, does the PCA still produce something visually meaningful or do you need to tweak the preprocessing per backbone
@harunbalkabak PCA here is unsupervised and per-image. It fits the model's own feature distribution for a single image, so it has nothing to do with ImageNet classes or labels. Any backbone with spatially coherent features (SSL, CLIP/SigLIP, MAE, V-JEPA, SAM, even a satellite/medical model via the escape hatch) produces something meaningful; the robust PCA (MAD outlier filtering) keeps a few extreme patches from washing out the colors.
the per-channel intensity scaling in the PCA-to-RGB output looks really well-tuned, colors stay distinct without blowing out even on deeper layers.
Mailwarm
Congrats on your launch!!