How Far is Too Far? Defining the Distance Threshold for Verification Siamese Networks

2026-07-06Machine Learning

Machine Learning
AI summary

The authors work with Siamese verification networks, which compare pairs of items by measuring how close or far apart their features are in a special space. Usually, setting a cutoff (threshold) to decide if two items match needs labeled examples, which can be hard to get. The authors suggest a new way to find this cutoff automatically by assuming the distances have two main groups and picking the point between them. Their method works without needing any labeled data and performs nearly as well as traditional methods on several datasets.

Siamese networksembedding spaceverification thresholdunsupervised learningdistance distributionbimodal functionEqual Error RateMNISTCIFAR-10LFW dataset
Authors
Heloísa Dias Viotto, Cauê Samonek, Lucas Garcia Pedroso, Marcos Sunye, André Abed Grégio, Paulo Lisboa de Almeida
Abstract
Siamese verification networks are widely used to compare items such as faces, cars, or signatures. In these scenarios, the network is trained to learn an embedding space in which similar objects are mapped closer together, while dissimilar objects are mapped further apart. Two objects are considered to belong to the same class (e.g., the same person in two different images) when the distance between their embeddings falls below a predefined threshold. Defining this threshold, however, is a non-trivial task and typically requires labeled data. In this work, we assume that the distribution of distances produced by a siamese verification network can be approximated by a bimodal function. Based on this assumption, we propose an unsupervised method to determine the verification threshold by identifying the minimum point between the two modes. The proposed approach does not require annotated samples, enabling the verification threshold to be updated directly in the deployment environment without the cost of manual labeling. We evaluate our method on four datasets: MNIST, CIFAR-10, LFW, and PKLot. The results indicate that the proposed approach achieves an average verification accuracy of 94%, comparable to the Equal Error Rate method, while eliminating the need for labeled data.