Pietro Bonazzi, Rafael Sutter, Luigi Capogrosso, Mischa Buob, Michele Magno
ArXiv Preprint Link & Dataset Link
- 📖 Introduction
- 🔧 Environments
- 📊 Data Preparation
- 🚀 Run Experiments
- 📂 Dataset Release
- 🔗 Citation
- 🙏 Acknowledgements
- 📜 License
This repository contains source code for TinyGLASS implemented with PyTorch. TinyGLASS, a lightweight adaptation of the GLASS framework designed for real-time in-sensor anomaly detection on the Sony IMX500.
Create a new conda environment and install required packages.
conda create -n glass_env python=3.9.15
conda activate glass_env
pip install -r requirements.txt
Experiments are conducted on 3x NVIDIA A6000 (48GB). Same GPU and package version are recommended.
The public datasets employed in the paper are listed below.
- MMS (Download link)
- MVTec AD (Download link)
Other valuable datasets:
- VisA (Download link)
- MPDD (Download link)
To reproduce the results in the paper please run :
bash run_all.sh
1.MMS Dataset (Download link)
The MMS Dataset comprises four defect categories for M&Ms candies, i.e., crack-hole, scratch, half, and normal, covering structural and surface-level anomalies. It was collected using an high-resolution microscope camera (mms_stretch) and the IMX500 camera (mms_rpi)

Please cite the following paper if the code and dataset help your project:
@misc{bonazzi2026tinyglassrealtimeselfsupervisedinsensor,
title={TinyGLASS: Real-Time Self-Supervised In-Sensor Anomaly Detection},
author={Pietro Bonazzi and Rafael Sutter and Luigi Capogrosso and Mischa Buob and Michele Magno},
year={2026},
eprint={2603.16451},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2603.16451},
}Thanks for the great inspiration from GLASS.
The code and dataset in this repository are licensed under the MIT license.