Loading project...
Other

This repository implements a simple Open Set Recognition (OSR) pipeline. The project was originally developed in a Jupyter notebook and is now refactored into a python package for
This project implements an Open Set Recognition (OSR) framework for out-of-distribution (OOD) detection on the MNIST dataset. The goal is to classify known digit classes (0-9) while correctly identifying previously unseen samples as Unknown.
The model is built as a multi-task convolutional autoencoder with a classification head. It learns latent representations for MNIST digit recognition while also reconstructing the input image, encouraging the latent space to preserve meaningful visual structure.
To improve separation between known and unknown data, the training objective combines several components: classification loss, reconstruction loss, triplet loss, and distancing loss. This multi-loss design helps the model learn discriminative embeddings for known classes while pushing out-of-distribution samples away from in-distribution regions in latent space.
For uncertainty-aware inference, the system uses Monte Carlo Dropout. During evaluation, multiple stochastic forward passes are performed, and the prediction variance is used as an uncertainty estimate. Samples whose uncertainty exceeds a selected threshold are labeled as Unknown, enabling more reliable OOD rejection.
The model is trained on MNIST as the in-distribution dataset and evaluated using both FashionMNIST and CIFAR-10 as proxy OOD datasets. Evaluation covers three settings: standard MNIST classification, OOD-only detection, and open-set recognition with mixed MNIST and OOD samples.
The project also includes latent-space analysis using t-SNE and PCA to visualize how known and unknown samples are organized in the learned representation space. These analyses help illustrate the model’s ability to form meaningful clusters and separate unseen data from known classes.
This work addresses a key limitation of standard closed-set classifiers by enabling uncertainty-aware predictions and explicit rejection of unseen inputs, making it suitable for open-set recognition tasks in dynamic environments where unknown data may appear at inference time.
Sign in to leave a comment