Home

Awesome

Vision Mamba Mender

<div align="center"><img width="200" src="logo.jpg"/></div>

Requirements

Algorithms

🐍 Preparation

  1. Train a pre-trained model:
bash scripts/train.sh
  1. Select high-confidence samples and low-confidence samples:
bash scripts/sample_selection.sh
  1. Extract intermediate features from the model, including activations and gradients of samples:
bash scripts/feature_selection.sh

πŸ” Interpreting

  1. Visualize external interactions of states or internal interactions of states
bash state_external_visualize.sh
bash state_internal_visualize.sh
  1. Binarize external interactions of states or internal interactions of states
bash state_external_mask.sh
bash state_internal_mask.sh # Steps necessary for calibration!
  1. Compute interpretability scores for external interactions of states or internal interactions of states
bash state_external_score.sh
bash state_internal_score.sh

πŸ”§ Calibrating

  1. Calibrate external interactions of states or internal interactions of states
bash scripts/train_repair.sh

Future Plans

This repository contains the initial version of the code for the Vision Mamba Mender paper. Please stay tuned for further refinements and detailed explanations in future updates.

Others

output_path # Overall output directory as defined by you
    β”œβ”€β”€ exp_name # Experiment name defined by you
            β”œβ”€β”€ models
            βŽͺ       └── xxx.pth       
            β”œβ”€β”€ samples
            βŽͺ       β”œβ”€β”€ htrain # Selected high-confidence samples
            βŽͺ       └── ltrain # Selected low-confidence samples
            β”œβ”€β”€ features
            βŽͺ       β”œβ”€β”€ hdata # Selected intermediate features of the high-confidence samples
            βŽͺ       βŽͺ       └── xxx.pkl 
            βŽͺ       └── ldata # Selected intermediate features of the low-confidence samples
            β”œβ”€β”€ visualize
            βŽͺ       β”œβ”€β”€ hdata
            βŽͺ       βŽͺ       β”œβ”€β”€ external # Visualization results of external interactions of states
            βŽͺ       βŽͺ       βŽͺ       └── xxx.JPEG/PNG
            βŽͺ       βŽͺ       └── internal # Visualization results of internal interactions of states
            βŽͺ       └── ldata # Same as above
            β”œβ”€β”€ masks
            βŽͺ       β”œβ”€β”€ hdata
            βŽͺ       βŽͺ       β”œβ”€β”€ external # Binarization results of external interactions of states
            βŽͺ       βŽͺ       βŽͺ       └── xxx.pt
            βŽͺ       βŽͺ       └── internal # Binarization results of internal interactions of states
            βŽͺ       └── ldata # Same as above
            └── scores
                    β”œβ”€β”€ hdata
                    βŽͺ       β”œβ”€β”€ external # Interpretability scores of external interactions of states
                    βŽͺ       βŽͺ       └── xxx.PNG
                    βŽͺ       └── internal # Interpretability scores of internal interactions of states
                    └── ldata # Same as above