How Far is Too Far? Defining the Distance Threshold for Verification Siamese Networks. Heloı́sa Dias Viotto∗ , Cauê Samonek∗ , Lucas Garcia Pedroso† , Marcos Sunye∗ , André Abed Grégio∗ , Paulo Lisboa de Almeida∗ ∗ Departamento de Informática (DInf), Universidade Federal do Paraná, Curitiba, PR - Brazil
{heloisa.viotto,cauesamonek,sunye,gregio,paulorla}@ufpr.br † Departamento de Matemática (DMAT), Universidade Federal do Paraná Curitiba, PR - Brazil
I. I NTRODUCTION Siamese networks have become ubiquitous due to their effectiveness in tasks such as object tracking, matching, and reidentification [1]–[3]. This paper focuses on defining the distance threshold t for verification-by-distance tasks, in which two objects are projected into an embedding space RE and compared using a distance metric [1], [3]. In verification problems [3], [4], siamese networks are typically composed of two identical branches that share the same weights. Each branch implements a function f (x) : RI → RE , responsible for mapping the input space RI into the embedding space RE , where often I > E. During training, the network parameters are optimized to project similar inputs close to each other in the embedding space, while mapping dissimilar inputs further apart [1], [2]. A general scheme of such networks is shown in Figure 1a, and an example of a 2D embedding for digit comparison is shown in Figure 1b. This work was funded by the Ministry of Health’s R&D project between SAPS/MS and C3SL/UFPR, by the Brazilian National Council for Scientific and Technological Development (CNPq) – Grant 444192/2024-7, and by a CNPq Research Productivity grant.
1
....
input A
#0
.... .... ....
.... ....
distance out ....
input B ....
#1
#2
0
0.5
#3
0.5 0
−0.5
.... ....
Second Dimension
arXiv:2607.05329v1 [cs.LG] 6 Jul 2026
embedding
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 nontrivial 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. Index Terms—Deep Learning, Embedding, Verification Siamese Network, Bimodal Function.
.... ....
−1 −1
−0.5
1
First Dimension (a) General scheme.
(b) 2D embedding example.
Fig. 1. (a) General scheme of a verification siamese network. (b) Example of a 2D embedding generated by a verification siamese network for the MNIST [5] dataset for the digits 0 to 3. Solid lines represent distances between objects of the same class and dashed lines indicate distances between different classes.
After training, two inputs A and B can be compared by feeding them to the network to generate their embeddings. These embeddings are then compared using a distance function d(f (A), f (B)), where a common choice is the L2 distance. The inputs A and B are considered to belong to the same class (e.g., two images of the same person) if d(f (A), f (B)) < t, where t is a verification threshold [6]. Defining t for siamese verification networks poses several challenges. The maximum distance between embeddings may be unbounded and, although several loss functions aim to enforce a margin m to separate negative pairs (i.e., inputs from different classes) [6], [7], using this margin directly as a verification threshold may lead to suboptimal results, since it is difficult to guarantee a margin m for every negative pair during training. A common practice for setting t is to estimate it using a separate holdout set, or even the training set, for instance by selecting a threshold based on the Receiver Operating Characteristic (ROC) curve [3], [4], [6] (e.g., by considering the Equal Error Rate (EER)). Despite its popularity, this approach typically requires labeled data and may bias the threshold t toward the distribution of the training or validation set, which may not reflect the distribution encountered during deployment. To address this issue, we propose modeling the distances
Accepted at SMC 2026. The final published version will be available in IEEE Xplore.
computed over a large number of input pairs as a bimodal function. This assumption is intuitive in verification scenarios, as the first mode is expected to correspond to pairs of objects from the same class, which tend to have smaller distances, while the second mode corresponds to pairs from different classes, with larger distances. By assuming a bimodal behavior, we define the threshold t as the minimum point between the two modes, as exemplified in Figure 2. Our approach operates without labeled data, allowing t to be dynamically updated in the deployment environment without the cost of manual data annotation. The contributions of this work are summarized as follows: 1) We propose an unsupervised method for estimating the verification threshold t by modeling embedding distances as a bimodal function. 2) We show that the proposed approach allows the verification threshold to be updated directly on test data without the need for labeled samples. The remainder of this paper is organized as follows. Section II presents related works. Section III describes the proposed method. The experimental protocol, including four distinct comparison problems, is detailed in Section IV. Experimental results are presented in Section V, where we evaluate the proposed approach under both balanced and unbalanced scenarios. Finally, Section VI concludes the paper. II. R ELATED W ORKS Siamese neural networks were first introduced by [4], where the authors proposed using two identical Convolutional Neural Networks (CNNs) branches to perform signature verification. Cosine similarity was employed as the distance metric in the comparison head. To detect forgeries, the embedding of a questioned signature was compared against the distribution of embeddings obtained from genuine signatures. In more recent works, two main training strategies are commonly adopted. The first strategy involves training on pairs of samples (xa , xb ), where each pair is labeled as positive if xb belongs to the same class as xa , and negative otherwise [3], [8]–[10]. The training objective minimizes the distance between samples in positive pairs while maximizing it for negative pairs. The second strategy relies on triplets of samples in the form (xa , xp , xn ) [6], [11], where xa is an anchor sample, xp is a positive sample from the same class as xa , and xn is a negative sample from a different class. In this case, the loss function enforces that the embedding of xa is closer to xp than to xn by at least a margin m. In [3], [8], siamese networks trained using pairs are applied to verification tasks involving faces [3] and cars [8]. In both works, the distance d is positively unbounded, i.e., there is no ∆ > 0 such that d(f (A), f (B)) < ∆ for the infinitely many possibilities for A and B. In [3], identity information is leveraged during training to reduce the overlap between embeddings of different individuals. Similarly, [10] adopts a pairwise approach using siamese networks, among other architectures, focusing on comparing patches within the same image.
In [6], the authors employ CNNs followed by L2 normalization and a triplet loss for face verification. The embeddings are constrained to lie on an E-dimensional unit hypersphere, and a hard negative mining strategy is introduced to accelerate convergence by selecting difficult triplets. A related approach is proposed in [11], which introduces the in-triplet mining of hard negatives, a lightweight technique also adopted in our experimental protocol (see Section IV). Triplet-based learning is further explored in [7], where each branch of the network processes a different element of the triplet, and in [12], which applies a similar strategy to fine-grained classification tasks. Overall, prior work on siamese networks has addressed challenges related to network architectures [4], [7], [12], the generation of informative training samples [6], [11], and applications to specific domains [4], [8]. Regarding the definition of the comparison threshold t, several studies [3], [4], [6], [8] rely on labeled training or validation sets, typically by analyzing the ROC curve or by selecting thresholds at fixed operating points, such as a predefined False Positive Rate (FPR) (e.g., FPR95) [10]. While effective, these approaches require annotated data and often lead to thresholds that are biased toward the distribution of the dataset used for tuning, which may not generalize well to unseen data in deployment scenarios. In contrast, the method proposed in this work estimates the threshold t directly from the distribution of pairwise distances, enabling it to be updated dynamically, even during testing, without the need for labeled samples. III. P ROPOSED M ETHOD In this work, we hypothesize that the distances between objects computed by a siamese network follow a distribution that can be reasonably approximated by a bimodal one. This distribution can then be exploited to estimate a verification threshold, enabling the classification of object pairs as belonging to either the same or different classes. Under the bimodal assumption, the verification threshold can be estimated without requiring labeled data, allowing the verification threshold to be updated directly in the deployment environment. As new data is processed, the underlying distance distribution can be recomputed, enabling the threshold to adapt over time. This property is particularly relevant in scenarios subject to virtual concept drift, where the data distribution evolves while class definitions remain unchanged [13]. To estimate the threshold, we first compute distances between multiple pairs of objects. To obtain these distances, it is not necessary to know whether each pair is positive or negative (i.e., whether the objects belong to the same class). Nevertheless, it is desirable that the number of positive and negative pairs be relatively balanced (although we show an experiment where the proposed method is able to cope with an unbalanced scenario in Section V). Such pairs can be generated, for instance, from a validation set or even from unlabeled data collected in the target deployment environment. We use the resulting distances to model a distribution and subsequently apply an optimization algorithm to infer
the optimal classification threshold. An observational analysis reveals that the distance distribution often exhibits two distinct peaks. We decided to fit a curve to this distribution and set the classification threshold t as the local minimizer between these peaks, as exemplified in Figure 2. Since the distribution resembles a mixture of two normal distributions, we chose to fit a Gaussian Mixture Model (GMM) with two components, defining t as the minimizer located between the two modes.
the same car captured at a different time is selected to form a positive pair, and one image of a different vehicle is selected to form a negative pair. This results in 17,436 test pairs for PUCPR, 5,976 for UFPR05, and 3,806 for UFPR04. The number of training triplets and testing pairs for each dataset is summarized in Table I. In all cases, the verification task consists of deciding whether the two images in each pair belong to the same class. TABLE I DATASETS USED IN THE EXPERIMENTS .
Number of pairs
4k
# of Pairs Estimated Bimodal Minimizer
2k
Dataset MNIST CIFAR-10 LFW PKLot 1 PKLot 2 PKLot 3
# Training Triplets 60,000 50,000 8,343 170,924 (UFPR04 + UFPR05) 433,562 (UFPR04 + PUCPR) 480,750 (UFPR05 + PUCPR)
# Testing Pairs 10,000 10,000 1,642 17,436 (PUCPR) 5,976 (UFPR05) 3,806 (UFPR04)
0k 0
0.5
1
1.5
2
Distance Fig. 2. Fitted bimodal curve and verification threshold selection.
Note that by modeling the problem as a bimodal distribution, we can guarantee the existence of a global minimum strictly inside the interval between the two modes. IV. E XPERIMENTAL P ROTOCOL A. Datasets and Triplets Generation We evaluate the proposed approach on four well-known datasets: MNIST [5], Labelled Faces in the Wild (LFW) [14], PKLot [15], and CIFAR-10 [16]. These datasets allow us to assess the method across distinct verification tasks, including digit comparison (MNIST), vehicle verification (PKLot), face verification (LFW), and generic object category comparison (CIFAR-10). For MNIST, CIFAR-10, and LFW, we adopt the training and testing splits commonly used in the literature [5], [7], [14], [16]. For PKLot, we follow the cross-camera evaluation protocol proposed in [8], [15], resulting in three distinct experimental configurations. As in [8], the task in PKLot is to verify whether two images of vehicles, captured at different times in the same parking spot, correspond to the same car. Training triplets are generated as follows. Each image in the training set is used as an anchor xa , paired with another image from the same class as the positive sample xp . The negative sample xn is randomly selected from a different class. This procedure results in one triplet per training sample at each epoch (e.g., 60,000 triplets per epoch for MNIST). During testing, verification is performed using image pairs. For MNIST and CIFAR-10, we generate 10,000 balanced test pairs, with 50% positive and 50% negative pairs. Each test image is used as an anchor and randomly paired with either an image from the same class or from a different class, with equal probability. The same procedure is adopted for LFW, yielding 1,642 test pairs. For PKLot, we follow a protocol similar to [8]. For each vehicle in the test set, one image of
B. Networks and Training Procedure Following [8], we employ MobileNetV3-Large [17], initialized with ImageNet weights, as the backbone of all siamese networks. The classification layers are removed, and an L2 normalization layer is appended after the final convolutional layer, as in [6], constraining the embeddings to lie on an edimensional unit hypersphere. The output of this layer is used as the embedding representation. Input images are resized to 128 × 128 pixels with three channels1 , producing embeddings of dimension 960. Training is performed using the Adam optimizer with an initial learning rate of 0.001 and a batch size of 64. We adopt the triplet loss proposed in [12], defined as L = max(0, m + ∥f (xa ) − f (xp )∥2 − ∥f (xa ) − f (xn )∥2 ), where m denotes the margin, fixed to 1 in all experiments. Networks are trained for 30 epochs. Each training set is randomly split into 70% for training and 30% for validation. The validation set is used exclusively for threshold estimation, both for the EER baseline and for the proposed method. Each validation triplet is decomposed into two pairs: a positive pair (xa , xp ) and a negative pair (xa , xn ) in the validation set. C. Tested Methods We evaluate the proposed approach under two configurations. The first, referred to as BimodalVal, estimates the verification threshold using the validation set only. The second, called BimodalUpd, initializes the threshold using the validation set and subsequently updates both the distance distribution and the threshold t during testing. In this setting, the threshold is recomputed every 64 newly observed distances, using a sliding window containing the 1,024 most recent samples. For the proposed method, we use the sklearn.mixture.GaussianMixture implementation, which fits a Gaussian mixture model via the 1 For grayscale datasets, the single channel is replicated three times for consistency across experiments.
expectation-maximization algorithm [18]. All parameters are kept at their default values, except for the number of mixture components, which is set to two. The threshold is obtained by minimizing the fitted bimodal density using scipy.optimize.minimize_scalar, with bounds defined by the means of the two Gaussian components. This procedure employs Brent’s derivative-free optimization algorithm [19]. During training, we also apply in-triplet hard negative mining with anchor swapping, as proposed in [11]. As baselines, we evaluate a method based on the ROC curve, where the threshold is selected as the point corresponding to the EER on the validation set. Additionally, we report results obtained by directly using the margin m as the verification threshold t. V. E XPERIMENTS AND R ESULTS We first present results obtained under balanced test scenarios in Section V-A. We then analyze the impact of removing embedding normalization, resulting in positively unbounded distances, in Section V-B. Finally, we evaluate the proposed approach under unbalanced testing conditions in Section V-C. All reported results are averaged over five independent runs. A. Normalized Embeddings Table II reports the verification accuracies obtained following the experimental protocol described in Section IV. The average threshold values estimated by the proposed method and by the EER criterion are shown in Table III. Since the threshold is updated during testing for the BimodalUpd configuration, we report its average value. Because the test sets are balanced between positive and negative pairs, accuracy is used as the evaluation metric. TABLE II ACCURACIES ACHIEVED CONSIDERING THE TESTED METHODS .
MNIST CIFAR-10 LFW PKLot 1 PKLot 2 PKLot 3 Average
EER 0.99 ±0.00 0.90 ±0.01 0.86 ±0.00 0.96 ±0.01 0.95 ±0.02 0.98 ±0.01 0.94
Margin 0.99 ±0.00 0.90 ±0.01 0.84 ±0.00 0.93 ±0.01 0.96 ±0.01 0.98 ±0.00 0.93
Proposed Methods BimodalVal BimodalUpd 0.99 ±0.00 0.99 ±0.00 0.87 ±0.01 0.88 ±0.01 0.86 ±0.00 0.86 ±0.00 0.92 ±0.02 0.97 ±0.01 0.94 ±0.01 0.96 ±0.00 0.97 ±0.00 0.98 ±0.00 0.92 0.94
TABLE III T HRESHOLDS COMPUTED USING OUR PROPOSED METHOD VERSUS THE APPROACH THAT CONSIDERS THE EER.
MNIST CIFAR-10 LFW PKLot 1 PKLot 2 PKLot 3
EER 1.14 ±0.02 1.11 ±0.03 1.20 ±0.02 0.85 ±0.07 1.05 ±0.08 0.97 ±0.12
Proposed Methods BimodalVal BimodalUpd 0.43 ±0.03 0.45 ±0.03 0.45 ±0.08 0.69 ±0.06 1.28 ±0.01 1.28 ±0.01 1.04 ±0.01 0.73 ±0.03 1.12 ±0.02 0.89 ±0.06 0.78 ±0.10 1.02 ±0.05
As shown in Table II, all methods achieve near-perfect performance on the MNIST, which is a simple dataset. This
behavior is further illustrated in Table III, where substantially different thresholds lead to similar accuracies, indicating a large separation between classes in the embedding space. For the LFW and PKLot 1, directly using the margin as a verification threshold leads to inferior results compared to both the proposed approach and the EER-based method. This observation reinforces the difficulty of enforcing a suitable margin m for all negative pairs during training under some scenarios, given the combinatorial number of possible triplets. On average, the proposed BimodalUpd method achieves results comparable to the EER approach and outperforms the margin-based threshold. Unlike the EER, however, the proposed method does not require labeled data, enabling the computation of the threshold without any annotation cost. In Figure 3 we present the distance histograms computed for one of the five executions of our experiments, considering the validation set of each dataset. We show the threshold generated by our proposed method and the one generated by the EER. We use bars of different styles for positive and negative pairs to illustrate the expected classification errors for each technique. As observed, all datasets exhibit a clear separation between modes, resulting in a pronounced valley between positive and negative distances. This explains why different threshold selection strategies yield similar accuracies in balanced scenarios, even when the numerical threshold values differ substantially. Compared to BimodalVal, the BimodalUpd configuration consistently benefits from updating the threshold during testing. This suggests a mismatch between the validation and test distributions, and indicates that adapting the threshold online can mitigate performance degradation caused by distribution shifts. This effect is illustrated in Figure 3(g), where the distance distribution observed during testing differs from that of the validation set shown in Figure 3(d). As expected, the test scenario is more challenging, as it involves data from a parking lot unseen during training and validation. The green dot-dashed line indicates the final threshold estimated by BimodalUpd during test-time adaptation. B. Non-Normalized Embeddings In this experiment, we repeat the evaluation described in Section V-A, removing the L2 normalization layer from the network. As a result, the embedding distances become positively unbounded, as in [3], [8]. TABLE IV ACCURACIES ACHIEVED WITHOUT L2 NORMALIZATION .
MNIST CIFAR-10 LFW PKLot 1 PKLot 2 PKLot 3 Average
EER 0.99 ±0.00 0.91 ±0.01 0.88 ±0.01 0.97 ±0.01 0.97 ±0.02 0.97 ±0.01 0.95
Margin 0.50 ±0.00 0.50 ±0.00 0.50 ±0.00 0.51 ±0.00 0.50 ±0.00 0.50 ±0.00 0.50
Proposed Methods BimodalVal BimodalUpd 0.99 ±0.00 0.99 ±0.00 0.90 ±0.00 0.90 ±0.00 0.86 ±0.01 0.86 ±0.00 0.97 ±0.00 0.96 ±0.01 0.98 ±0.01 0.98 ±0.01 0.99 ±0.00 0.99 ±0.00 0.95 0.95
Number of pairs
Positive Pair Negative Pair Estimated Bimodal BimodalVal Threshold BimodalUpd Threshold EER Threshold
15k
6k
10k
4k
5k
2k
0k
1.5k 1k 0.5k
0k 0
0.5
1
1.5
2
0k 0
0.5
Distance
1.5
2
0
1
1.5
2
1.5
2
Distance
(b) Cifar10
(c) LFW
100k
30k
0.5
Distance
(a) MNIST
Number of pairs
1
2k
100k 20k 50k
0k
0k 0
0.5
1
1.5
2
0k 0
0.5
Distance (d) PKLot 1
1k
50k
10k
1
1.5
2
0k 0
0.5
1
Distance
Distance
(e) PKLot 2
(f) PKLot 3
1.5
2
0
0.5
1 Distance
(g) PKLot 1 (Test)
Fig. 3. Plots (a) to (f) show the histogram of pairwise distances computed on the validation set for each dataset. The black line represents the bimodal distribution fitted by our proposed method. Vertical lines show the verification threshold computed using our method (dashed blue) and the EER (dotted red). In (g), we show the PKLot 1 histogram for the test set using the threshold computed by BimodalUpd.
Table IV summarizes the obtained results. Interestingly, with the exception of the margin-based threshold, all methods achieve higher accuracies compared to the normalized embedding setting. As in the normalized case, the proposed approach matches the performance of the EER-based method, without relying on labeled data.
Number of pairs
Positive Pair Estimated Bimodal EER Threshold
Negative Pair BimodalVal Threshold
6k
15k
4k
10k
2k
5k
0k
0k 0
2
4 Distance
(a) Cifar10
6
8
0
10
20
Distance
does not exceed 15 units in any dataset. This behavior is illustrated in Figure 4, and was consistently observed across all evaluated datasets. C. Unbalanced Scenario We now evaluate the proposed approach under unbalanced testing conditions, where positive pairs are significantly more frequent than negative ones. Such scenarios commonly arise in real-world applications. For example, in dwell time estimation using the PKLot dataset [8], vehicles may be compared sequentially over time, resulting in a high proportion of positive matches. To simulate this setting, the training procedure remains unchanged. During testing, however, each sample generates a positive pair with 90% probability and a negative pair with 10% probability, yielding a 9:1 imbalance. Due to this imbalance, performance is reported using balanced accuracy. TABLE V BALANCED ACCURACIES ACHIEVED CONSIDERING THE TESTED METHODS UNDER UNBALANCED SCENARIOS .
(b) PKLot1
Fig. 4. Histogram of pairwise distances computed on the validation sets considering embeddings without L2 normalization.
The poor performance of the margin-based threshold in this scenario highlights its unsuitability when distances are unbounded. Despite this, the distance distributions remain clearly bimodal, and the mode corresponding to negative pairs
MNIST CIFAR-10 LFW PKLot 1 PKLot 2 PKLot 3 Average
EER 1.00 ±0.00 1.00 ±0.00 0.78 ±0.05 0.97 ±0.05 0.97 ±0.05 0.99 ±0.00 0.95
Margin 1.00 ±0.00 1.00 ±0.00 0.76 ±0.05 0.92 ±0.10 0.95 ±0.05 1.00 ±0.00 0.94
Proposed Methods BimodalVal BimodalUpd 1.00 ±0.00 1.00 ±0.00 0.96 ±0.04 0.93 ±0.03 0.85 ±0.04 0.87 ±0.03 0.92 ±0.10 1.00 ±0.00 0.95 ±0.05 0.99 ±0.00 1.00 ±0.00 0.98 ±0.01 0.95 0.96
As shown in Table V, the BimodalUpd method achieves the highest balanced accuracy across datasets, demonstrating its ability to adapt the verification threshold even under severe class imbalance. Positive Pair Estimated Bimodal BimodalUpd Threshold
Negative Pair BimodalVal Threshold EER Threshold
Number of pairs
Number of pairs
2k 30k 20k 10k 0k
1.5k
R EFERENCES
1k 0.5k 0k
0
0.5
1
1.5
2
verification systems. The results show that the method is able to estimate a reasonable classification threshold even in the presence of class imbalance. Nevertheless, under more extreme imbalance ratios, the method may fail to identify one of the two modes of the distance distribution, potentially leading to suboptimal threshold estimation. As future research, we also intend to study mechanisms to improve the robustness of the proposed method under severe imbalance and distribution shifts, including alternative distribution modeling strategies and adaptive windowing schemes. Additionally, we plan to further analyze the behavior of online threshold updating under dynamic environments.
0
Distance (a) Validation Set
0.5
1
1.5
2
Distance (b) Test Set
Fig. 5. Distance histograms and the computed thresholds for the unbalanced test scenario considering the PKLot 1 test scenario.
Figure 5 presents the distance distributions for the validation and test sets in the PKLot 1 scenario. Although the proposed method successfully identifies an appropriate threshold in this case, we acknowledge that extreme imbalance may pose challenges, as one of the modes may become difficult to identify. In such situations, the optimization procedure may converge to a minimum outside the interval between the true modes. Nevertheless, this behavior was not observed in our experiments. VI. C ONCLUSIONS In this work, we proposed a method to estimate the verification threshold for siamese verification networks based on the assumption that the distribution of distances produced by such networks can be approximated by a bimodal function. The proposed approach was evaluated using four well-known datasets covering distinct verification tasks: digit comparison for MNIST, object classification across 10 classes for CIFAR10, face verification for LFW, and car verification for PKLot. The experimental results show that the proposed method consistently outperforms the direct use of the margin value as a verification threshold and achieves performance comparable to thresholds computed using the EER. Our proposed approach does not require labeled data, which represents a practical advantage over traditional validation-based threshold selection strategies. Moreover, the method enables the verification threshold to be updated during deployment as new data becomes available, also without supervision. Our experiments indicate that such online updates can be beneficial in scenarios where the test distribution differs from the training or validation distributions. We further evaluated the proposed approach under unbalanced testing conditions, which are common in real-world
[1] D. Chicco, “Siamese neural networks: An overview,” Artificial neural networks, pp. 73–94, 2021. [2] M. Ondrašovič and P. Tarábek, “Siamese visual object tracking: A survey,” IEEE Access, vol. 9, pp. 110 149–110 172, 2021. [3] Y. Sun, Y. Chen, X. Wang, and X. Tang, “Deep learning face representation by joint identification-verification,” Advances in neural information processing systems, vol. 27, 2014. [4] J. Bromley, I. Guyon, Y. LeCun, E. Säckinger, and R. Shah, “Signature verification using a” siamese” time delay neural network,” Advances in neural information processing systems, vol. 6, 1993. [5] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, no. 11, pp. 2278–2324, 1998. [6] F. Schroff, D. Kalenichenko, and J. Philbin, “Facenet: A unified embedding for face recognition and clustering,” in IEEE conference on computer vision and pattern recognition, 2015, pp. 815–823. [7] E. Hoffer and N. Ailon, “Deep metric learning using triplet network,” in Similarity-Based Pattern Recognition, A. Feragen, M. Pelillo, and M. Loog, Eds. Springer International Publishing, 2015, pp. 84–92. [8] M. M. Ribas, H. B. Mendes, L. E. de Oliveira, L. A. Zanlorensi, and P. L. de Almeida, “Using deep neural networks to quantify parking dwell time,” in ICMLA, 2024, pp. 1504–1509. [9] M. Pei, B. Yan, H. Hao, and M. Zhao, “Person-specific face spoofing detection based on a siamese network,” Pattern Recognition, vol. 135, p. 109148, 2023. [10] S. Zagoruyko and N. Komodakis, “Learning to compare image patches via convolutional neural networks,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2015, pp. 4353–4361. [11] V. Balntas, E. Riba, D. Ponsa, and K. Mikolajczyk, “Learning local feature descriptors with triplets and shallow convolutional neural networks.” in Bmvc, vol. 1, no. 2, 2016, p. 3. [12] J. Wang, Y. Song, T. Leung, C. Rosenberg, J. Wang, J. Philbin, B. Chen, and Y. Wu, “Learning fine-grained image similarity with deep ranking,” in IEEE CVPR, 2014, pp. 1386–1393. [13] E. L. Barboza, P. L. de Almeida, A. de Souza Britto Jr, R. Sabourin, and R. O. Cruz, “Inca-des: An incremental and adaptive dynamic ensemble selection approach using online kd tree neighborhood search for data streams with concept drift,” Information Fusion, p. 103272, 2025. [14] G. B. Huang, M. Mattar, T. Berg, and E. Learned-Miller, “Labeled faces in the wild: A database for studying face recognition in unconstrained environments,” in Workshop on faces in’Real-Life’Images: detection, alignment, and recognition, 2008. [15] P. R. De Almeida, L. S. Oliveira, A. S. Britto Jr, E. J. Silva Jr, and A. L. Koerich, “Pklot–a robust dataset for parking lot classification,” Expert Systems with Applications, vol. 42, no. 11, pp. 4937–4949, 2015. [16] A. Krizhevsky, G. Hinton et al., “Learning multiple layers of features from tiny images.(2009),” 2009. [17] A. Howard, M. Sandler, G. Chu, L.-C. Chen, B. Chen, M. Tan, W. Wang, Y. Zhu, R. Pang, V. Vasudevan et al., “Searching for mobilenetv3,” in IEEE/CVF ICCV, 2019, pp. 1314–1324. [18] A. P. Dempster, N. M. Laird, and D. B. Rubin, “Maximum likelihood from incomplete data via the em algorithm,” Journal of the Royal Statistical Society. Series B, vol. 39, no. 1, pp. 1–38, 1977. [19] R. Brent, Algorithms for Minimization Without Derivatives, ser. Dover Books on Mathematics. Dover Publications, 2013.