A Framework for Uncertainty Quantification Based on Nearest Neighbors Across Layers

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Font, Miguel N., Jorro-Aragoneses, José L., Alaíz, Carlos M.
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866908420756471808
author Font, Miguel N.
Jorro-Aragoneses, José L.
Alaíz, Carlos M.
author_facet Font, Miguel N.
Jorro-Aragoneses, José L.
Alaíz, Carlos M.
contents Neural Networks have high accuracy in solving problems where it is difficult to detect patterns or create a logical model. However, these algorithms sometimes return wrong solutions, which become problematic in high-risk domains like medical diagnosis or autonomous driving. One strategy to detect and mitigate these errors is the measurement of the uncertainty over neural network decisions. In this paper, we present a novel post-hoc framework for measuring the uncertainty of a decision based on retrieved training cases that have a similar activation vector to the query for each layer. Based on these retrieved cases, we propose two new metrics: Decision Change and Layer Uncertainty, which capture changes in nearest-neighbor class distributions across layers. We evaluated our approach in a classification model for two datasets: CIFAR-10 and MNIST. The results show that these metrics enhance uncertainty estimation, especially in challenging classification tasks, outperforming softmax-based confidence.
format Preprint
id arxiv_https___arxiv_org_abs_2506_19895
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle A Framework for Uncertainty Quantification Based on Nearest Neighbors Across Layers
Font, Miguel N.
Jorro-Aragoneses, José L.
Alaíz, Carlos M.
Machine Learning
Artificial Intelligence
Neural Networks have high accuracy in solving problems where it is difficult to detect patterns or create a logical model. However, these algorithms sometimes return wrong solutions, which become problematic in high-risk domains like medical diagnosis or autonomous driving. One strategy to detect and mitigate these errors is the measurement of the uncertainty over neural network decisions. In this paper, we present a novel post-hoc framework for measuring the uncertainty of a decision based on retrieved training cases that have a similar activation vector to the query for each layer. Based on these retrieved cases, we propose two new metrics: Decision Change and Layer Uncertainty, which capture changes in nearest-neighbor class distributions across layers. We evaluated our approach in a classification model for two datasets: CIFAR-10 and MNIST. The results show that these metrics enhance uncertainty estimation, especially in challenging classification tasks, outperforming softmax-based confidence.
title A Framework for Uncertainty Quantification Based on Nearest Neighbors Across Layers
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2506.19895