This code repository implements the Prototype-Based Joint Embedding method in the paper "Improving Explainability of Softmax Classifiers Using a Prototype-Based Joint Embedding Method" by Hilarie Sit, Brendan Keith, and Karianne Bergen. PB&J is an interpretable-by-design, explainable AI approach that provides instance-based explanations for softmax classifiers using similarity of the model input to examples within the training dataset.
To train the model:
- Specify dataset, model, and training hyperparameters in utils.py
- Run train.py
To generate prototypes using the stochastic sampling approach:
- Specify path to trained models in prototypes.py
- Run prototypes.py
To evaluate OOD detection performance using the centroid-based approach:
- Specify path to trained models in ood_detection.py
- Run ood_detection.py