\section{Introduction}
\label{sec:intro}

Identity document (IDs) verification is an essential process in online banking, healthcare and business. The rapid advancement of generative AI has made it significantly easier to create and produce fraudulent fake IDs, posing a serious challenge in the Know Your Customer (KYC) process. Traditional machine learning treatments of fraud are framed as supervised classification on static datasets. That framing is often mismatched to real-world production identity fraud. In production identity verification, fraud spans at least two operational regimes. The first is \textbf{opportunistic (non-adaptive)} fraud, where submissions are low-effort or visually obvious and are often well handled by supervised classifiers or rules trained on historical examples. The second is \textbf{adaptive (adversarial)} fraud, where attackers adapt to defenses, modify document templates and fabrication pipelines, and quickly exploit newly successful attack patterns at scale. This second regime is more challenging because it is non-stationary (future fraud traffic is not fully represented by historical labeled fraud), weakly labeled, and often campaign-structured. Our paper focuses on this adaptive regime. In this setting, a useful model must do more than scoring isolated documents; it must surface previously unseen fraud families, expand from a small number of confirmed seeds, and enable cluster-level triage by investigators (e.g., \cite{lunghi2023adversarial}). 

One challenge of fraudulent ID layout detection is the vast number of possible layouts which are ever-growing and highly imbalanced. Many countries maintain a large number of supported ID layouts issued by the national and subdivisions. For instance, the United States alone has at least 886 supported ID layouts as of 2026. Existing datasets cover only a small fraction of these variants, and newly issued layouts are not labeled in advance, requiring models to generalize effectively to unseen layouts.

Secondly, in real-world scenarios, ID documents are captured using mobile phone cameras under various conditions, including different illumination, orientation, noise and backgrounds. Real-world ID images may exhibit a number of adverse scenarios that impact image quality further complicating the ID layout and fraud recognition task. 

Finally, labeled data is costly to obtain due to privacy obligations and the diversity of document designs. Maintaining comprehensive, up-to-date annotations becomes increasingly impractical. These challenges motivate approaches that can leverage unlabeled data, learn discriminative representations, and generalize beyond seen document layouts.

ID layouts exhibit high intra-class variance and low inter-class variance. This requires the learning of fine-grained, discriminative features that capture the invariant structural layout of the document. We propose a ID layout training framework that leverages self-supervised pre-training and supervised metric learning. Our contributions are summarized below:
\begin{itemize}
\item We introduce a layout-aware document embedding model that supports similarity search, clustering, and centroid-based anomaly scoring for fraud analysis.
\item We show strong cross-domain transfer from U.S. training data to Canadian IDs. By adding a lightweighted MLP to the embedding, the model achieves 99.83\% classification accuracy on Canadian IDs. 
\item We demonstrate concrete anti-fraud value in production traffic, including identifying anomalous clusters and similarity-based expansion from a single confirmed fraud seed that surfaces numerous sophisticated fraud uncaught by incumbent supervised models.
\end{itemize}