Angular Margin Loss is a class of loss functions that modifies the standard softmax cross-entropy objective by introducing an additive angular margin penalty between feature vectors and their corresponding class weight vectors. This geometric constraint forces the learned embeddings to be more discriminative by explicitly maximizing the decision boundary in the angular domain, rather than relying solely on Euclidean distance separation.
Glossary
Angular Margin Loss

What is Angular Margin Loss?
A family of loss functions that enforces discriminative constraints on the angular space of feature embeddings to maximize inter-class separation and intra-class compactness.
Prominent variants include ArcFace and CosFace, which normalize both the feature embeddings and the class weight vectors to lie on a hypersphere before applying the margin. This normalization eliminates radial variance, compelling the network to learn strictly from angular information. The resulting embeddings exhibit high intra-class compactness and inter-class discrepancy, making them robust for open-set tasks such as face verification and emitter identification where unknown classes must be rejected based on distance thresholds.
Key Variants of Angular Margin Loss
Angular margin loss functions enforce a multiplicative or additive margin in the angular space of feature embeddings, compelling the network to learn highly discriminative features with maximized inter-class separation and minimized intra-class variance.
SphereFace (A-Softmax)
The foundational angular margin loss that introduced a multiplicative angular margin to the standard SoftMax formulation. By projecting features onto a hypersphere and multiplying the angle by a margin parameter m, SphereFace forces the decision boundary to be more stringent, requiring features to be closer to their class center. This formulation directly optimizes for angular separability rather than Euclidean distance, making learned features more discriminative for open-set tasks. The key limitation is training instability at high margin values due to the non-monotonic nature of the multiplicative margin, which can cause the loss surface to become difficult to optimize without careful annealing strategies.
CosFace (AM-Softmax)
Reformulates the angular margin as an additive cosine margin rather than a multiplicative one, dramatically improving training stability. CosFace normalizes both feature vectors and weight vectors, then subtracts a margin m directly from the cosine of the angle before scaling with a temperature parameter s. This additive approach creates a linear decision margin in cosine space that is easier to optimize. Key properties include:
- Feature normalization ensures all samples lie on a hypersphere of radius s
- Additive margin avoids the vanishing gradient issues of multiplicative approaches
- Scale parameter s controls the radius of the hypersphere, typically set between 30 and 64
- Directly applicable to open-set emitter recognition where unknown transmitters must fall below a cosine similarity threshold
ArcFace (Additive Angular Margin)
The most widely adopted angular margin loss that applies an additive margin directly to the angle rather than the cosine. ArcFace computes the arccosine of the logit, adds a constant margin m to the target angle, then takes the cosine. This yields a constant linear angular margin throughout the entire angle range, providing exact geodesic distance constraints on the hypersphere. Advantages for RF fingerprinting include:
- Exact angular interpretation: The margin directly corresponds to a minimum angular separation in radians
- Superior convergence: The linear angular penalty produces cleaner gradient signals
- Robustness to label noise: The constant margin is less sensitive to mislabeled training samples
- Widely validated on large-scale face recognition benchmarks with millions of identities
AdaCos (Adaptive Cosine Scaling)
An automated hyperparameter-free variant that dynamically adjusts the scale parameter s during training based on the observed distribution of cosine similarities. AdaCos eliminates the need for manual tuning of the scale and margin parameters, which is critical when deploying angular margin loss across diverse emitter recognition tasks with varying numbers of device classes. The method analyzes the expected and observed probability distributions of the SoftMax output to compute an optimal scale at each training step. This self-calibrating property makes it particularly suitable for few-shot device enrollment scenarios where hyperparameter sweeps are impractical due to limited training data per emitter.
MV-SoftMax (Misclassified Vector Guidance)
Extends angular margin loss by explicitly emphasizing hard negative classes during training. MV-SoftMax identifies the non-target class with the highest cosine similarity to a sample and applies an additional penalty to push the feature vector away from that specific class center. This targeted repulsion mechanism is valuable for open-set emitter recognition where certain device classes may have nearly identical hardware impairments, creating confusable class pairs. By focusing the margin on the most challenging negative class rather than applying a uniform margin, MV-SoftMax achieves finer separation between similar transmitters without unnecessarily distorting the embedding space for well-separated classes.
CurricularFace (Adaptive Margin)
Introduces a curriculum learning strategy to angular margin training, where the margin emphasis shifts from easy positive samples early in training to hard negative samples later. In early epochs, CurricularFace behaves like standard CosFace to establish basic class structure. As training progresses, it adaptively increases the importance of difficult negative samples, mimicking the effect of hard negative mining. This prevents the network from collapsing in early training due to overly aggressive margins while still achieving tight class boundaries at convergence. For RF fingerprinting, this approach handles the wide variance in signal quality across different collection environments by gradually increasing discriminative pressure.
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.
Frequently Asked Questions
Explore the mechanics behind angular margin loss functions like ArcFace and CosFace, which enforce discriminative constraints on feature embeddings to maximize inter-class separation in open set emitter recognition.
Angular Margin Loss is a family of loss functions that enforces discriminative constraints on the angular space of feature embeddings rather than Euclidean distance. Unlike traditional SoftMax loss, which separates classes but does not explicitly maximize inter-class margins, angular margin losses—such as ArcFace and CosFace—introduce an additive or multiplicative margin penalty to the angle between feature vectors and their corresponding class weight vectors. The core mechanism involves normalizing both the feature embeddings and the classifier weights to lie on a hypersphere, then computing the cosine of the angle between them. A margin m is added to the target angle, forcing the network to produce more compact intra-class clusters and wider inter-class separations. This geometric constraint is particularly valuable in open set emitter recognition, where unknown transmitters must be rejected based on their distance from known class prototypes in the embedding space.
Related Terms
Key concepts and techniques that underpin angular margin loss functions for discriminative feature embedding and open set recognition.
Feature Normalization and Hypersphere Embedding
Angular margin losses rely on L2 normalization of both feature embeddings and classifier weight vectors, projecting them onto a unit hypersphere. This eliminates radial variance, forcing the network to discriminate solely based on angular proximity. The radius of the hypersphere is controlled by a learnable scale parameter s, which rescales the cosine logits to facilitate convergence. Normalization is critical for open set rejection, as unknown samples naturally fall into low-density angular regions.
Open Set Recognition with Angular Margins
Angular margin losses are inherently suited for open set emitter recognition because they enforce compact, well-separated class clusters in angular space. Unknown transmitters produce embeddings that fall into the angular gaps between known class prototypes. Rejection is performed by thresholding the maximum cosine similarity against all known class anchors. This geometric property provides a principled basis for distinguishing known from unknown devices without requiring explicit outlier exposure training.
Unified Margin Framework (MagFace, AdaFace)
Advanced angular margin formulations that adapt the margin magnitude based on feature quality or sample difficulty. MagFace links the margin to the embedding norm, encouraging high-quality samples to have larger norms and tighter angular constraints. AdaFace dynamically adjusts the margin based on image quality or signal-to-noise ratio, applying stronger margins to clean samples and relaxing constraints for degraded inputs. These adaptive approaches improve robustness in variable RF channel conditions.

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