Inferensys

Glossary

Siamese Network

A neural network architecture that learns a similarity metric between pairs of signal samples, enabling one-shot and few-shot device authentication by comparing a probe signal directly to an enrolled baseline.
Architect reviewing LLM integration architecture on laptop, system diagrams visible, modern technical office setup.
SIMILARITY LEARNING ARCHITECTURE

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.

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.

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.

SIAMESE NETWORK

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.

01

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.

02

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.
03

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.
04

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.
05

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.

06

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.
SIAMESE NETWORK INSIGHTS

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.

Prasad Kumkar

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.