Views
No views yet
Feature Selection Gates with Gradient Routing for Endoscopic Image Computing
Giorgio Roffo, Carlo Biffi, Pietro Salvagnini, Andrea Cherubini
MICCAI 2024, arXiv, GitHub
torchvision ViT model (e.g. vit_b_16, vit_l_16)1from torchvision.models import vit_b_16, ViT_B_16_Weights
2from vit_with_fsg import vit_with_fsg
3import torch
4
5print("📥 Loading pretrained ViT...")
6backbone = vit_b_16(weights=ViT_B_16_Weights.DEFAULT)
7
8print("🔧 Injecting FSG into backbone...")
9model = vit_with_fsg(vit_backbone=backbone)
10
11dummy_input = torch.randn(1, 3, 224, 224)
12output = model(dummy_input)
13print("✅ Output shape:", output.shape)| Dataset | Training Script | Inference Script | Checkpoint Path |
|---|---|---|---|
| MNIST | demo_training_mnist.py | demo_inference_mnist.py | ./checkpoints/fsg_vit_mnist_demo.pth |
| Imagenette | demo_training_imnet.py | demo_inference_imnet.py | ./checkpoints/fsg_vit_imagenette_demo.pth |
⚠️ These demos use reduced datasets and epochs to run quickly and demonstrate the API.
.
├── vit_with_fsg.py # FSG-ViT integration
├── demo_training_mnist.py
├── demo_inference_mnist.py
├── demo_training_imnet.py
├── demo_inference_imnet.py
├── checkpoints/ # Model weights (optional)
├── README.md # This model card1@inproceedings{roffo2024FSG,
2 title={Feature Selection Gates with Gradient Routing for Endoscopic Image Computing},
3 author={Giorgio Roffo and Carlo Biffi and Pietro Salvagnini and Andrea Cherubini},
4 booktitle={MICCAI 2024, the 27th International Conference on Medical Image Computing and Computer Assisted Intervention, Marrakech, Morocco, October 2024.},
5 year={2024},
6 organization={Springer}
7}