[Paper Review] Batch-Incremental Triplet Sampling for Training Triplet Networks Using Bayesian Updating Theorem
This paper proposes Bayesian Updating Triplet (BUT) and Bayesian Updating NCA (BUNCA), novel batch-incremental triplet sampling methods that dynamically sample positive and negative triplets from multivariate normal distributions modeling class embeddings. Using Bayesian updating with conjugate priors, the method adaptively refines class distributions over streaming mini-batches, improving discriminative feature learning and achieving state-of-the-art performance on MNIST and CRC histopathology datasets.
Variants of Triplet networks are robust entities for learning a discriminative embedding subspace. There exist different triplet mining approaches for selecting the most suitable training triplets. Some of these mining methods rely on the extreme distances between instances, and some others make use of sampling. However, sampling from stochastic distributions of data rather than sampling merely from the existing embedding instances can provide more discriminative information. In this work, we sample triplets from distributions of data rather than from existing instances. We consider a multivariate normal distribution for the embedding of each class. Using Bayesian updating and conjugate priors, we update the distributions of classes dynamically by receiving the new mini-batches of training data. The proposed triplet mining with Bayesian updating can be used with any triplet-based loss function, e.g., triplet-loss or Neighborhood Component Analysis (NCA) loss. Accordingly, Our triplet mining approaches are called Bayesian Updating Triplet (BUT) and Bayesian Updating NCA (BUNCA), depending on which loss function is being used. Experimental results on two public datasets, namely MNIST and histopathology colorectal cancer (CRC), substantiate the effectiveness of the proposed triplet mining method.
Motivation & Objective
- To improve triplet network training by moving beyond static sampling from existing embeddings to stochastic sampling from learned class distributions.
- To address the limitation of existing triplet mining methods that rely solely on fixed data instances, which may miss informative, outlying, or rare patterns.
- To enhance robustness and generalization by incorporating uncertainty and streaming data through Bayesian updating of class embeddings.
- To validate the effectiveness of dynamic, distribution-based triplet sampling on benchmark datasets using standard metric learning benchmarks.
Proposed method
- Models the embedding of each class as a multivariate normal distribution, parameterized by mean and covariance.
- Uses conjugate priors (normal-inverse-Wishart) to enable analytical Bayesian updating of class distributions with new mini-batches.
- Applies Bayesian updating to recursively refine class distribution parameters (mean and covariance) as new training data arrives.
- Samples positive and negative triplets from the dynamically updated multivariate normal distributions rather than from fixed data points in the mini-batch.
- Supports any triplet-based loss function, including triplet-loss and NCA-loss, making it modular and widely applicable.
- Integrates the method into a batch-incremental training pipeline, enabling online adaptation during training.
Experimental results
Research questions
- RQ1Can sampling from learned class distributions rather than from fixed data points improve triplet network performance?
- RQ2How does dynamic Bayesian updating of class embeddings affect the discriminative quality of learned representations?
- RQ3Does distribution-based sampling outperform existing sampling strategies like Batch Hard or DWS in terms of retrieval accuracy?
- RQ4How robust is the proposed method to outliers and data distribution shifts in real-world datasets like histopathology images?
- RQ5Can the method generalize across diverse data types, such as handwritten digits and medical tissue patches?
Key findings
- BUT achieved 88.03% Recall@1 on MNIST, outperforming all baselines including Batch Hard (85.75%) and NCA (85.40%).
- On the CRC histopathology dataset, BUT achieved 79.14% Recall@1, surpassing all baselines except Batch Hard (79.09%) and showing strong generalization.
- BUNCA achieved 78.67% Recall@1 on MNIST and 78.67% on CRC, demonstrating consistent performance across datasets despite being less aggressive than BUT.
- The proposed method significantly improved retrieval quality, with top-10 retrievals showing high visual similarity to query images in both MNIST and histopathology data.
- Visualizations confirmed that the method retrieves semantically similar samples, even in complex patterns like tumor and mucus in histopathology.
- The method effectively handles class distribution shifts and maintains robustness through Bayesian uncertainty modeling, reducing sensitivity to outliers.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.