  Ensuring the reliability and safety of automated decision-making is crucial.
It is well-known that data distribution shifts in machine learning can produce
unreliable outcomes. This paper proposes a new approach for measuring the
reliability of predictions under distribution shifts. We analyze how the
outputs of a trained neural network change using clustering to measure
distances between outputs and class centroids. We propose this distance as a
metric to evaluate the confidence of predictions under distribution shifts. We
assign each prediction to a cluster with centroid representing the mean softmax
output for all correct predictions of a given class. We then define a safety
threshold for a class as the smallest distance from an incorrect prediction to
the given class centroid. We evaluate the approach on the MNIST and CIFAR-10
datasets using a Convolutional Neural Network and a Vision Transformer,
respectively. The results show that our approach is consistent across these
data sets and network models, and indicate that the proposed metric can offer
an efficient way of determining when automated predictions are acceptable and
when they should be deferred to human operators given a distribution shift.
