Inferensys

Glossary

Siamese Neural Network

A deep learning architecture that learns a similarity metric between pairs of RF fingerprints, enabling one-shot learning and clone detection by comparing a new signal to a stored reference.
Architect reviewing LLM integration architecture on laptop, system diagrams visible, modern technical office setup.
SIMILARITY LEARNING ARCHITECTURE

What is Siamese Neural Network?

A Siamese Neural Network is a deep learning architecture that learns a similarity metric between pairs of inputs, enabling one-shot learning and clone detection by comparing a new signal to a stored reference.

A Siamese Neural Network is an architecture composed of two identical subnetworks that share the same weights and parameters. Each subnetwork processes one input from a pair, mapping them into a high-dimensional embedding space. The network is trained using a contrastive loss or triplet loss function that minimizes the distance between embeddings of similar pairs while maximizing the distance between dissimilar pairs, effectively learning a similarity function rather than a direct classification boundary.

In RF fingerprinting, Siamese networks enable one-shot learning for emitter identification, where a new device can be authenticated by comparing its captured signal to a single stored reference fingerprint. This architecture excels at clone detection by verifying whether a presented signal is genuinely similar to a known emitter's stored embedding, defeating MAC address spoofing attacks. The shared-weight design ensures that the comparison is symmetric and invariant to the order of inputs, making it ideal for physical layer authentication tasks where the number of known emitters constantly changes.

ARCHITECTURE

Key Architectural Features

The Siamese Neural Network architecture is purpose-built for learning similarity functions rather than direct classification, making it ideal for one-shot emitter identification and clone detection in RF fingerprinting.

01

Twin Subnetworks with Shared Weights

The core architectural innovation: two identical neural networks process a pair of input signals simultaneously. These subnetworks share the exact same weights and parameters, ensuring that identical inputs produce identical embeddings. This weight tying guarantees the network learns a consistent metric space—if you swap the two inputs, the computed distance remains symmetric. Each subnetwork acts as a feature extractor, transforming raw IQ data into a compact, high-dimensional embedding vector that captures the hardware impairment signature.

02

Distance Metric Layer

After the twin networks generate two embedding vectors, a distance layer computes the similarity between them. Common choices include:

  • Euclidean distance: Straight-line distance in embedding space
  • Cosine similarity: Angle between vectors, robust to magnitude variations
  • Manhattan distance: Sum of absolute differences

The output is a scalar score—a small distance indicates the same emitter, a large distance indicates different devices. This layer has no trainable parameters; the learning happens entirely in the feature extraction subnetworks.

03

Contrastive Loss Function

Training uses a contrastive loss that pulls embeddings of genuine signal pairs together while pushing impostor pairs apart beyond a margin. The loss function is:

L = Y * D² + (1-Y) * max(0, m - D)²

Where Y=1 for genuine pairs (same emitter), Y=0 for impostor pairs (different emitters), D is the computed distance, and m is the margin hyperparameter. This formulation ensures that different-device embeddings are separated by at least the margin, creating a well-structured embedding space for verification.

04

Triplet Loss Variant

An alternative training paradigm uses triplet loss, which operates on three inputs simultaneously:

  • Anchor: A reference signal from a specific emitter
  • Positive: Another signal from the same emitter
  • Negative: A signal from a different emitter

The loss function enforces: D(anchor, positive) + margin < D(anchor, negative). This explicitly ensures intra-class distances are smaller than inter-class distances by at least the margin, creating tighter clusters and better separation for open-set recognition scenarios where unknown emitters must be rejected.

05

One-Shot Verification Pipeline

At inference time, the network operates as a verification system rather than a classifier:

  1. Enrollment: A single reference signal from a known emitter is passed through one subnetwork to generate a stored embedding
  2. Query: A new signal is processed through the identical subnetwork
  3. Comparison: The distance between the stored and query embeddings is computed
  4. Decision: If the distance falls below a calibrated threshold, the signal is authenticated

This enables one-shot learning—a new emitter can be enrolled with a single example, critical for detecting clone devices that were never seen during training.

06

Channel-Robust Embedding Space

To ensure the learned similarity metric is invariant to channel conditions rather than transmitter identity, the architecture often incorporates domain-adversarial training. A gradient reversal layer inserted before the distance computation forces the feature extractor to learn representations that are discriminative for emitter identity but indistinguishable for channel conditions. This prevents the network from learning spurious correlations with multipath fading or receiver hardware, ensuring the fingerprint is truly based on transmitter-specific impairments like I/Q imbalance and oscillator phase noise.

ARCHITECTURE DEEP DIVE

Frequently Asked Questions

Explore the core mechanisms, training paradigms, and operational considerations for deploying Siamese Neural Networks in high-stakes RF fingerprinting and emitter identification tasks.

A Siamese Neural Network is a deep learning architecture that learns a similarity metric between two distinct inputs by processing them through two identical, weight-sharing subnetworks to generate comparable embeddings. In the context of Radio Frequency Fingerprinting, the network ingests pairs of raw IQ samples or transformed signal representations. Each twin subnetwork extracts a high-dimensional feature vector, and a distance function—typically Euclidean distance or cosine similarity—measures the proximity between these two embeddings. The network is trained to minimize the distance between pairs from the same transmitter (genuine pairs) and maximize the distance between pairs from different transmitters (impostor pairs). This architecture is foundational for one-shot learning because it learns to compare rather than classify, enabling the identification of a rogue emitter by comparing its signal to a single stored reference fingerprint without retraining the entire model.

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.