This repository contains implementations of DenseNet and BayesNet architectures for Out-of-Distribution (OOD) detection. The models are evaluated on MNIST and FashionMNIST datasets, with detailed analysis provided.
- AUROC for MNIST vs. FashionMNIST OOD detection based on confidence: 0.505
- AUPRC for MNIST vs. FashionMNIST OOD detection based on confidence: 0.856
- AUROC for MNIST vs. FashionMNIST OOD detection based on confidence: 0.851
- AUPRC for MNIST vs. FashionMNIST OOD detection based on confidence: 0.971
The following images provide insights into the models' predictions:
- DenseNet: A traditional feedforward neural network with ReLU activation.
- BayesNet: A Bayesian neural network implemented using Bayes by Backprop for uncertainty estimation.
- Evaluation Metrics: AUROC and AUPRC for OOD detection.
- Confidence Visualization: Displays most and least confident predictions for MNIST and FashionMNIST datasets.
To run this project, you need the following Python packages:
numpytorchtorchvisionmatplotlibtqdmsklearn
Install the dependencies using:
pip install numpy torch torchvision matplotlib tqdm sklearn- Place your training and evaluation datasets in the appropriate format (e.g.,
train_data.npz,test_x.npz, andfmnist.npz). - Run the main script:
python solution.py- Enable extended evaluation by setting
EXTENDED_EVALUATION = Truein the script to generate additional visualizations.
solution.py: Main script containing the implementations of DenseNet and BayesNet, along with evaluation functions.ambiguous_rotated_mnist.pdf: Visualization of ambiguous MNIST predictions.fashionmnist_least_confident.pdf: Least confident predictions on FashionMNIST.fashionmnist_most_confident.pdf: Most confident predictions on FashionMNIST.mnist_least_confident.pdf: Least confident predictions on MNIST.mnist_most_confident.pdf: Most confident predictions on MNIST.
This repository was created to explore the use of neural networks for OOD detection and uncertainty quantification in image classification tasks.




