A Siamese Network is a neural architecture consisting of two or more identical subnetworks that share the same weights and parameters, processing distinct inputs in parallel to generate comparable output vectors. The network learns a similarity function by mapping inputs into an embedding space where semantically similar samples cluster together, measured by a distance metric like Euclidean distance or cosine similarity.
Glossary
Siamese Network

What is a Siamese Network?
A twin-branch neural network designed to learn a similarity metric between pairs of inputs, enabling comparison-based authentication rather than traditional classification.
In RF fingerprinting, a Siamese Network compares a probe signal directly against an enrolled device signature baseline, outputting a similarity score rather than a class label. This architecture excels at few-shot device enrollment, authenticating transmitters from a single reference example without retraining, making it ideal for dynamic IoT environments where new devices must be onboarded rapidly.
Key Architectural Characteristics
The core architectural components that define a Siamese network for RF fingerprinting, enabling similarity learning between signal samples for few-shot device authentication.
Twin Subnetworks
The defining characteristic of the architecture: two or more identical neural networks that share the exact same weights, biases, and hyperparameters. Each subnetwork processes a different input—typically a probe signal and an enrolled baseline—in parallel. Because the subnetworks are identical, they map semantically similar signals to nearby points in the embedding space, while dissimilar signals are pushed apart. This weight-sharing constraint is the mechanism that forces the network to learn a genuine similarity function rather than memorizing individual inputs.
Contrastive Loss Function
The training objective that drives the network to learn a discriminative embedding space. The loss function operates on pairs of samples and minimizes the distance between genuine pairs (same device) while maximizing the distance between impostor pairs (different devices) beyond a defined margin. Key variants include:
- Contrastive Loss: Uses a margin parameter to prevent the network from arbitrarily pushing dissimilar pairs apart once they are sufficiently separated.
- Triplet Loss: Operates on triplets of anchor, positive, and negative samples to enforce relative distance constraints.
- Circle Loss: Provides a more flexible optimization landscape by weighting each similarity score independently.
Shared Embedding Space
The output of each twin subnetwork is a compact, fixed-length feature vector that represents the signal in a high-dimensional space. The entire architecture is trained so that the Euclidean distance or cosine similarity between two vectors directly corresponds to the likelihood that the signals originated from the same transmitter. This embedding space serves as the device identity manifold, where:
- Genuine transmissions from the same device form tight clusters.
- Transmissions from different devices are separated by measurable margins.
- Unknown devices fall outside all known clusters, enabling open set recognition.
Distance Metric Layer
A non-trainable final layer that computes the similarity between the two output feature vectors. Common metrics include:
- L1 (Manhattan) Distance: Sum of absolute differences, robust to outliers.
- L2 (Euclidean) Distance: Straight-line distance, sensitive to large deviations.
- Cosine Similarity: Measures angular separation, invariant to vector magnitude. The resulting scalar score is compared against a calibrated decision threshold to produce a binary authentication decision: accept as genuine or reject as impostor. This threshold can be tuned to balance the False Acceptance Rate (FAR) and False Rejection Rate (FRR) based on security requirements.
One-Shot Enrollment Capability
Unlike traditional classifiers that require hundreds of examples per device and full retraining when new devices are added, a Siamese network authenticates by direct comparison to an enrolled baseline. This enables one-shot or few-shot enrollment: a new device can be registered with a single clean transmission sample. The enrollment process simply stores the embedding vector of that sample as the baseline template. Authentication then compares incoming probe signals against this stored vector. This architecture eliminates the need for retraining when the device population changes, making it ideal for dynamic IoT environments and rapid device onboarding.
Channel-Robust Feature Learning
To prevent the network from learning channel artifacts instead of hardware impairments, the training strategy must incorporate domain adaptation techniques. The twin subnetworks are trained on signal pairs captured across diverse multipath environments, signal-to-noise ratios, and receiver configurations. Techniques include:
- Data augmentation with simulated channel distortions during training.
- Adversarial domain adaptation to force the embedding to be invariant to channel conditions.
- Contrastive learning with hard negative mining to focus the network on the most difficult impostor pairs. This ensures the similarity metric reflects transmitter hardware identity rather than transient propagation effects.
Frequently Asked Questions
Explore the core concepts behind using Siamese neural architectures for one-shot and few-shot device authentication in radio frequency fingerprinting systems.
A Siamese Network is a neural architecture containing two or more identical subnetworks that share the same weights and parameters. For RF fingerprinting, the network processes two signal samples simultaneously—a probe signal and an enrolled baseline—through these twin branches to generate comparable feature vectors. The core mechanism involves learning a similarity metric in a high-dimensional embedding space. Instead of classifying a device directly, the network calculates the Euclidean distance or cosine similarity between the two output vectors. During training, a contrastive loss or triplet loss function minimizes the distance between signals from the same transmitter while maximizing the distance between signals from different transmitters, effectively teaching the network a robust, discriminative distance function for authentication.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Explore the core architectural components and training paradigms that enable Siamese Networks to perform one-shot and few-shot device authentication in RF fingerprinting systems.
Triplet Loss Function
The contrastive loss variant most commonly used to train Siamese Networks for RF fingerprinting. It operates on three inputs: an anchor (enrolled baseline), a positive (another sample from the same device), and a negative (a sample from a different device). The loss function mathematically enforces that the distance between the anchor and positive embedding is smaller than the distance between the anchor and negative embedding by at least a specified margin. This directly optimizes the embedding space for verification tasks, ensuring that intra-class distances are minimized while inter-class distances are maximized.
Contrastive Loss
An alternative loss function for training Siamese Networks that uses pairs of samples rather than triplets. Given two signal samples, the loss minimizes the Euclidean distance between their embeddings if they belong to the same device (genuine pair) and maximizes the distance if they belong to different devices (impostor pair), up to a defined margin. Contrastive loss is computationally simpler than triplet loss but requires careful pair mining to avoid easy pairs that produce near-zero gradients and stall training. It is particularly effective when the number of known devices is small.
Shared Weight Architecture
The defining structural characteristic of a Siamese Network: identical subnetworks with tied weights process each input signal independently. Both branches contain the exact same layers, parameters, and weight updates during backpropagation. This weight-sharing constraint guarantees that two identical signals will always produce identical embeddings, a critical property for consistent device verification. The shared architecture also reduces the total number of parameters by half compared to a non-siamese dual-branch design, improving generalization and reducing overfitting on small RF fingerprint datasets.
Embedding Space Distance Metrics
Once the Siamese Network maps two signal samples to their respective embedding vectors, a distance function quantifies their similarity. Common metrics include:
- Euclidean Distance: Straight-line distance between two points in the embedding space, sensitive to absolute vector magnitudes.
- Cosine Similarity: Measures the angle between vectors, ignoring magnitude and focusing on directional alignment, which can be more robust to signal power variations.
- Manhattan Distance: Sum of absolute differences across dimensions, computationally efficient for edge deployment. The choice of metric directly impacts the Equal Error Rate (EER) of the authentication system.
One-Shot Enrollment Protocol
The operational workflow enabled by Siamese Networks where a new device can be enrolled into the authentication system using only a single or very few signal captures. The enrollment process:
- Capture one clean transmission from the new device.
- Pass it through the trained Siamese Network to generate its reference embedding.
- Store this embedding as the device's baseline in the authorized emitter database. No retraining or fine-tuning is required. Subsequent authentication involves comparing a probe signal's embedding to this stored baseline using the chosen distance metric. This contrasts sharply with traditional classifiers that require retraining for every new device class.
Hard Negative Mining
A critical training strategy for Siamese Networks where the model is deliberately fed difficult impostor pairs—signal samples from different devices that the current model incorrectly maps close together in the embedding space. By focusing training on these challenging cases rather than random or easy negatives, the network learns more discriminative features and produces a more tightly clustered embedding space. In RF fingerprinting, hard negatives often arise from devices of the same make and model, where hardware impairments are subtle. Effective mining strategies include semi-hard and hardest negative selection within each training batch.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us