# Neural Clamping: Joint Input Perturbation and Temperature Scaling for Neural Network Calibration

Source: [Neural Clamping: Joint Input Perturbation and Temperature Scaling for Neural Network Calibration](<https://www.sota2.com/research/paper/68fa744b1e209131cea60d72>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T03:06:43.001Z

Authors: Yung-Chen Tang, Pin-Yu Chen, Tsung-Yi Ho

Published: 2022-09-23T14:18:39.000Z

## Abstract

Neural network calibration is an essential task in deep learning to ensure consistency between the confidence of model prediction and the true correctness likelihood. In this paper, we propose a new post-processing calibration method called Neural Clamping, which employs a simple joint input-output transformation on a pre-trained classifier via a learnable universal input perturbation and an output temperature scaling parameter. Moreover, we provide theoretical explanations on why Neural Clamping is provably better than temperature scaling. Evaluated on BloodMNIST, CIFAR-100, and ImageNet image recognition datasets and a variety of deep neural network models, our empirical results show that Neural Clamping significantly outperforms state-of-the-art post-processing calibration methods. The code is available at github.com/yungchentang/NCToolkit, and the demo is available at huggingface.co/spaces/TrustSafeAI/NCTV.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2209.11604>)

[PDF](<https://arxiv.org/pdf/2209.11604.pdf>)
