TorchCP: A Python Library for Conformal Prediction

Jianguo Huang,Jianqing Song,Xuanning Zhou,Bingyi Jing,Hongxin Wei
2024-12-12
Abstract:Conformal Prediction (CP) has attracted great attention from the research community due to its strict theoretical guarantees. However, researchers and developers still face challenges of applicability and efficiency when applying CP algorithms to deep learning models. In this paper, we introduce \torchcp, a comprehensive PyTorch-based toolkit to strengthen the usability of CP for deep learning models. \torchcp implements a wide range of post-hoc and training methods of conformal prediction for various machine learning tasks, including classification, regression, GNN, and LLM. Moreover, we provide user-friendly interfaces and extensive evaluations to easily integrate CP algorithms into specific tasks. Our \torchcp toolkit, built entirely with PyTorch, enables high-performance GPU acceleration for deep learning models and mini-batch computation on large-scale datasets. With the LGPL license, the code is open-sourced at \url{<a class="link-external link-https" href="https://github.com/ml-stat-Sustech/TorchCP" rel="external noopener nofollow">this https URL</a>} and will be continuously updated.
Machine Learning,Computer Vision and Pattern Recognition,Statistics Theory
What problem does this paper attempt to address?