Few-Shot Fingerprinting
Gonçalo Gaspar Alves, Shekoufeh Gorgi Zadeh, Andreas Husch, Ben Bausch · 2025
Read Few-Shot Fingerprinting by Gonçalo Gaspar Alves, Shekoufeh Gorgi Zadeh, Andreas Husch, Ben Bausch (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2512-16685.txt.
Introduction
Gonçalo Gaspar Alves and coauthors test few-shot fingerprinting, a way to spot the same person across medical image sets. When open data sets are merged, the same subject can appear twice, a leak that inflates test scores if training and test data overlap.
Their method maps all scans of one subject to one zone in a learned feature space, so matches can be found by closeness. A ResNet-50 trained with triplet margin loss was tested on 3D MRI and 2D chest X-ray data. Scores stayed high even in hard cases: 90.06 percent recall in 500-way one-shot tests on ChestXray-14, and 98.86 percent in 100-way three-shot tests on BraTS-2021.
Catalog record
| CREATOR | Gonçalo Gaspar Alves, Shekoufeh Gorgi Zadeh, Andreas Husch, Ben Bausch |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 15 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2512-16685
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Few-Shot Fingerprinting Gonçalo Gaspar Alves, Shekoufeh Gorgi Zadeh, Andreas Husch, Ben Bausch Abstract Combining open-source datasets can introduce data leakage if the same subject appears in multiple sets, leading to inflated model performance. To address this, we explore subject fingerprinting, mapping all images of a subject to a distinct region in latent space, to enable subject re-identification via similarity matching. Using a ResNet-50 trained with triplet margin loss, we evaluate few-shot fingerprinting on 3D MRI and 2D X-ray data in both standard (20-way 1-shot) and challenging (1000-way 1-shot) scenarios. The model achieves high Mean-Recall-@-K scores: 99.10% (20-way 1-shot) and 90.06% (500-way 5-shot) on ChestXray-14; 99.20% (20-way 1-shot) and 98.86% (100-way 3-shot) on BraTS-2021. Subject Re-Identification in 3D-MRI and 2D-X-Ray 1 Introduction In our context, subject re-identification does not aim to reveal the subject’s identity from anonymized data, as described in [ 11 ] , but identifying all images that belong to the same subject. Therefore we find the term subject fingerprinting more suitable. This technique leverages anatomical structures and pathophysiological conditions as unique markers to associate an image with a specific individual. This formulation is very useful in dataset aggregation, where we need to identify subjects present in multiple datasets in order to avoid data leakage. Some methods for subject reidentification in MRI, such as [ 13 ] , use majority voting comparing multiple 2 D slices from a pair of 3 D MRI volumes to detect duplicate or near-duplicate volumes. Similar to our work, [ 7 ] and [ 10 ] compare latent space embeddings of multiple images to determine if they belong to the same subject. To generate these image embeddings, researchers commonly apply deep neural networks to encode the images to fixed size embedding vectors. Training such models can be done in an unsupervised manner, as the only form of supervision needed is knowing which images belong to which subject. This information is inherently provided by the structure of the datasets. Many few-shot learning algorithms can be applied to this problem by considering the subjects to be classes with only a few samples. 1.1 Few-Shot Learning Few-Shot Learning is a subfield of machine learning focused on extracting meaningful features from limited samples per class, useful in data-scarce domains such as medical imaging. Problems are typically framed as N -way K -shot tasks, where N denotes the number of classes and K the number of samples per class. The main approaches include Transfer-Learning, Meta-Learning, and Metric-Learning. Transfer-Learning fine-tunes pre-trained models for new classes, Meta-Learning enables rapid adaptation from related tasks [ 4 ] , and Metric-Learning optimizes distance metrics to cluster similar samples and separate dissimilar ones [ 11 ] [ 15 ] . This work adopts Metric-Learning for its simplicity and the absence of suitable 3D biomedical pre-trained models. The model minimizes Euclidean distances between embeddings of the same subject while maximizing distances between different subjects. 2 Materials and Methods 2.1 Models In our experiments, we employ the 2D and 3D ResNet-50 [ 6 ] [ 5 ] architectures, two popular and efficient neural network architectures well-suited to our problem setting. ResNet-50 is a convolutional neural network that utilizes residual blocks to mitigate the vanishing gradient problem. We use the final output of the model as an embedding for subject fingerprinting. 2.2 Datasets X-Ray: For the 2D X-ray fingerprinting task, we utilized the NIH Chest X-ray Dataset (also known as ChestXray-14 ), published as an extension of the ChestXray-8 dataset [ 16 ] . This large-scale dataset contains 112^{\prime}120 frontal-view chest X-ray images from 30^{\prime}805 unique subjects collected between the years 1992 and 2015 . The images show a large variety of image quality, subject position and posture, and up to fourteen common thoracic pathologies, making image augmentations, beyond normalization and resizing to a 512 x 512 resolution, unnecessary. We use the train-validation-test split from [ 11 ] . BraTS2021: For the 3D MRI fingerprinting task, we utilized the Brain Tumor Segmentation ( BraTS ) 2021 dataset from the MICCAI BraTS Challenge [ 1 ] , [ 8 ] and [ 2 ] . This multi-institutional dataset comprises 1^{\prime}251 subjects with brain tumors, each providing magnetic resonance imaging (MRI) scans with multiple modalities. Due to the limited natural variance in brain shape and position across modalities, we applied affine transformations to the images during training and resized the images to 78 x 120 x 120 . We randomly split the data on a patient-wise basis into a 70\%-10\%-20\% train-validation-test split. 2.3 Training At each iteration step, we randomly select subjects from the train split and uniformly sample two images per subject to create a batch of anchor images and a batch of positive images. Following the work on Siamese Neural Networks [ 3 ] , we encode the anchors and the positives using the same learnable model parameters. For each anchor-positive tuple, we search for an appropriate negative sample among the anchor images of distinct subjects within the batch. Finally, we use the triplet margin loss [ 15 ] , defined in Equation 1 , to train the model by comparing the anchor embeddings, the positive and the negative samples. 2.4 Triplet Margin Loss The triplet margin loss aims at minimizing the distance between the associated anchor a and positive embedding p , pulling together the embeddings of the images of the same subject. However, relying only on this pulling force would lead to a model collapse. Therefore, we need an additional pushing force that maximizes the dissimilarity of embeddings coming from images of different subjects. To establish this, the triplet margin loss relies on a negative sample n and maximizes the distance between the anchor and negative embeddings. The triplet margin loss encourages the distance between the anchor and a hard negative to be larger than the distance between the anchor and a positive by at least margin \alpha . A hard negative sample per anchor-positive tuple is selected from the batch of anchors. The triplet margin loss [ 12 ] is given as: \mathcal{L}_{trip}(a,p,n)=\max(d(a,p)-d(a,n)+\alpha,0) (1) Selecting random negatives from the batch is usually not enough for the network to learn meaningful embeddings. Negatives that are highly dissimilar to the anchor are easy-negatives and lead to a loss value of 0 . Therefore, we employ an in-batch mining strategy [ 12 ] , as described in Algorithm 1 , to find hard negatives in the batch for each anchor-positive tuple. Due to this mining strategy, it is crucial that the batch size is large enough to include suitable hard negatives for the anchor-positive tuples. Algorithm 1 Batched Hard Triplet Mining 1: Anchors {a} , Positives {p} , SubjectIDs {id} , Distance Function d 2: n\leftarrow[\phantom{1}] \triangleright Negative indices 3: bs = length(a) \triangleright Batch Size 4: for i=1 to bs do 5: d^{+}=d(a_{i},p_{i}) \triangleright Positive distance 6: \mathcal{T}_{hard}\leftarrow\emptyset 7: for j=1 to bs do 8: if id_{i}\neq id_{j} then \triangleright Validate subjects to be different 9: d^{-}=d(a_{i},a_{j}) \triangleright Negative Distance 10: if d^{-}\leq d^{+} then 11: \mathcal{T}_{hard} .add( a_{j} ) \triangleright Hard Negative 12: end if 13: end if 14: end for 15: if \mathcal{T}_{hard}\neq\emptyset then 16: n.append(random( \mathcal{T}_{hard} )) \triangleright Random Hard Negative 17: else 18: a.remove( a_{i} ) \triangleright No Suitable Negative Found 19: