Authenticate, Then Erase: Localized Identity Repair for Style Transfer

When a generator restyles a photo of a person, whether turning a portrait into anime or making a surveillance crop look like it came from a different camera, it usually damages the person's identity somewhere. Current methods fight this with one global penalty: a similarity loss between the identity embeddings of the input and output. That penalty cannot say where identity was lost. So it spends its budget everywhere, and the model has to weaken the style across the whole image to protect a few fragile regions.

We propose borrowing a single structural idea from verifiable quantum secret sharing. In that field, attaching an authentication check to each share turns unknown, arbitrary corruption into known erasures. Because known erasures are much easier to correct than unknown errors, this roughly doubles the amount of corruption the scheme can survive. Our method applies the same move to style transfer. It splits identity into local part-level "shares," authenticates each part of the stylized output against the source with a calibrated statistical test, marks failing parts as erasures, and regenerates only those parts under stronger identity conditioning. Parts that pass keep the full style. The claim is that this gives a strictly better trade-off between style strength and identity preservation than any setting of a global identity loss. We test it on person re-identification and on face stylization benchmarks.

Where the idea comes from, and what is deliberately not borrowed

The source of the analogy is Approximate Quantum Error-Correcting Codes and Secret Sharing Schemes. Exact quantum codes of length $n$ cannot correct more than $n/4$ arbitrary errors. Crépeau et al. relax the goal to approximate reconstruction, with fidelity at least $1-2^{-s}$ for security parameter $s$, and reach a tolerance of $\lfloor (n-1)/2 \rfloor$. They get there by authenticating each register, treating registers that fail authentication as erasures, and running an erasure decoder. That paper supplies the method's architecture. Two other works play the same conceptual role: Verifiable threshold quantum secret sharing with sequential communication embeds an auxiliary qudit as an internal verification trap, and A verifiable framework of entanglement-free quantum secret sharing with information-theoretical security carries verification values alongside the secret. Both show that per-share verification can be cheap relative to the payload.

We deliberately do not put quantum hardware or cryptographic certification into the pipeline. The research file suggests "cryptographically certified style transfer" and quantum-secret-shared identity embeddings. The closest existing quantum-vision work, Hybrid Quantum-Classical Style Transfer (Student Abstract), replaces convolutions with variational quantum circuits on $3\times256\times256$ images but reports only qualitative figures. The verification machinery in Formulations and Constructions of Remote State Preparation with Verifiability, with Applications covers narrow state families and reports no numerical benchmark. A literal quantum system would therefore have no measurable baseline, and its threat model (an adversarial stylization server) is weakly motivated. The transferable lesson is about decoding, not physics.

On the vision side, the method builds on and competes with identity-preserving translators. SPGAN adds a Siamese self-similarity loss and a domain-dissimilarity loss to CycleGAN. It also pools horizontal strips at test time because translated images carry artifacts, which is evidence that identity damage is local. PTGAN restricts an identity loss to a segmented foreground. Infinite-ID decouples identity from text in a diffusion model (a generator that learns by denoising random noise into images) and acknowledges residual drift in small facial regions. CSGO separates content and style injection in Stable Diffusion XL and still reports identity loss on real portraits. All four apply identity pressure uniformly or by a fixed mask. None of them detects, per output, which regions actually lost identity.

Core Claim

Identity damage under strong stylization is sparse and localized. A detector that flags damaged parts with a controlled false-alarm rate, followed by repair that touches only flagged parts, should therefore preserve identity at style strengths where global losses fail.

The quantitative prediction mirrors the errors-versus-erasures gap. Repair should keep identity until roughly half of the parts are corrupted. Global correction should degrade once a much smaller fraction is corrupted, because it never knows which parts to fix.

Research Program

The source identity is split into $k$ part embeddings. For people these are horizontal body strips, the same partition SPGAN's pooling uses. For faces they are landmark-defined regions (eyes, nose, mouth, jaw), plus one global embedding. Each part is a "share."

For each part $i$, the method computes the similarity $s_i$ between the source and stylized part embeddings and flags the part as an erasure when

$$s_i < \tau_i, \qquad \tau_i = \text{the } \alpha\text{-quantile of } s_i \text{ over same-identity, different-image pairs},$$

where $\alpha$ is the target false-alarm rate. The threshold is calibrated on genuine cross-view pairs of the same person, so the test asks whether the part looks less like the source than another real photo of that same person would. This mirrors per-share authentication: a pass means the part is consistent with the source identity, and a fail marks a known erasure.

Repair regenerates only the flagged regions by masked inpainting with the base generator. The style strength is lowered inside the mask, and the conditioning uses the passing parts together with the source part. For the GAN re-ID setting, the flagged strips are instead blended toward a second translation produced with a higher identity weight. Repair then iterates authentication up to a fixed number of rounds.

The analysis has three parts. First, it measures how sparse identity damage actually is, as the distribution of flagged parts across style strengths. Second, it traces the identity-versus-style frontier. Third, it tests the threshold prediction by injecting controlled corruption into a chosen number of parts.

Baselines

The naive reference point is translation with no identity constraint. For re-ID this is CycleGAN, which SPGAN reports at 38.5% Rank-1 on Market-1501→DukeMTMC-reID, against 33.1% for direct transfer without translation. For faces it is the base stylizer with identity conditioning turned off.

The strongest re-ID competitor is SPGAN itself. Its reported Rank-1 is 46.9% on Market→Duke and 58.1% on Duke→Market, and it is the most direct embodiment of a global identity loss. We will reproduce it on the same splits with the same ResNet-50 re-ID backbone and the same training schedule. Our repair will run on top of SPGAN's generator, so any gain comes from authenticate-and-erase alone. Beating it means a Rank-1 gain beyond seed variance at matched or stronger style, where style is measured by a target-domain classifier's confidence.

The strongest face competitor is Infinite-ID, at a reported $M_{\text{FaceNet}}$ of 0.689 against 0.513 for IP-Adapter-Face and 0.502 for PhotoMaker. The style-side reference is CSGO's reported Color-Style Discrepancy (CSD) of 0.5146 and Content Alignment Score (CAS) of 0.8386 on IMAGStyle. Both methods will be run at matched sampling steps. Repair adds compute, so we will also give the baselines an equal compute budget through best-of-$N$ sampling selected by global identity score. Beating them means higher $M_{\text{FaceNet}}$ at equal or better CSD.

A global-weight sweep traces the full frontier of a single identity-loss weight. This is the fair version of the "just tune it" baseline, and success means our points lie outside its frontier.

PTGAN-style foreground masking, which reports CUHK03→PRID Rank-1 rising from 2.0% to 37.5%, is the strong fixed-mask baseline.

Two ablations isolate the key ingredient. The first repairs every part regardless of the test. The second repairs a random set of parts of the same size as the flagged set. If either matches the full method, then detection is not doing the work.

To avoid circularity, the embedders used for authentication (ArcFace for faces, a strip model for re-ID) are never used for evaluation. Evaluation uses FaceNet, and re-ID evaluation uses a separately trained retrieval model.

Why not just…?

Why not just raise the global identity-loss weight? This is the main threat. If identity damage is spread diffusely rather than concentrated in a few parts, a well-tuned global weight will match our method. The sparsity measurement and the frontier comparison against the full weight sweep settle this directly. If the frontiers coincide, the claim is false.

Why not just mask the subject and paste original pixels, as PTGAN does? Pasting works when style can stop at the body boundary, which is how camera adaptation behaves. It fails when style must reshape the subject itself, as in anime or artistic portraits. Repair keeps style on every part that passes, whereas pasting removes style from the entire foreground. The face experiments, where pasting will score high on identity but poorly on CSD, show this difference.

Why not just use real quantum secret sharing or cryptographic verification? No benchmark in the file reports numbers for such systems on images; the hybrid quantum style-transfer work is qualitative only. A threat model with an adversarial stylizer is also not what limits current identity preservation. The bottleneck is ordinary drift, and that is what this proposal targets.

Why not just run off-the-shelf face restoration afterward? Restoration pushes faces toward a generic prior and does not condition on the source. It is included as a baseline at matched compute, and we expect it to lose on held-out $M_{\text{FaceNet}}$.

Proposed Experiments

The re-ID experiments use Market-1501↔DukeMTMC-reID, with MSMT17 as the larger-scale check. The face experiments use portraits stylized with references from IMAGStyle, scored with $M_{\text{FaceNet}}$, CSD, and CAS.

The decisive check is the corruption-injection test. In it, $m$ of the $k$ parts are replaced with another identity's stylized parts, for $m$ from 0 to $k$. We then plot held-out identity accuracy against $m$ for three conditions: authenticate-and-erase, the best global weight, and random-erasure repair. The analogy predicts that our curve holds until roughly $m \approx k/2$ and that the others collapse earlier. If the curves do not separate, the erasure idea does not transfer and the proposal fails cleanly.

A second check is calibration. The measured false-alarm rate on genuine pairs should track $\alpha$, so that the per-part flags can be read as an auditable identity report rather than a heuristic.