Certifying Shape from Polarization Against Sparse Attacks by Turning Normals into Choices

A polarization camera photographs a scene through polarizing filters at several angles. From the result it can read off, at every pixel, how strongly the reflected light is polarized and in which direction. Physics then narrows the surface orientation at that pixel down to a handful of candidates. The best-known gap is the "π-ambiguity": the polarization direction fixes the in-plane orientation of the surface only up to a 180° flip. Deep networks for shape from polarization are trained to pick the right candidate from image context. This note asks two questions. First, can an attacker who changes only a few pixels, for example with small polarizing stickers, make such a network flip large regions of a surface inside-out? Second, can that be prevented with a guarantee rather than a heuristic?

The opening is a structural observation. Certified defenses against few-pixel attacks are known for classification but not for dense continuous outputs such as normal maps. The physics of polarization converts normal estimation into per-pixel classification over a small, physically fixed candidate set, and a pixel the attacker did not touch keeps its candidate set no matter what the attacker does elsewhere. We propose to build shape-from-polarization networks that choose among physics-derived candidates, to attack them with adapted sparse attacks, and to certify their per-pixel choices with randomized ablation.

Core Claim

At an unperturbed pixel, the measured angle of polarization, the degree of polarization, and a refractive index together determine a finite set of normals. That set comes from three sources: the π-flip, the 90° shift between diffuse and specular reflection, and the two zenith solutions on either side of the Brewster angle for specular light. With $n$ discretized to a small grid, the set has at most a few dozen members. A sparse attacker who modifies a set $A$ of at most $\rho$ pixels changes the candidate sets only inside $A$. Outside $A$, the attacker can only change which candidate the network selects.

That selection is a classification problem. The randomized ablation of Robustness Certificates for Sparse Adversarial Attacks by Randomized Ablation keeps a random subset of pixels, hides the rest, and takes a majority vote over many such views. It therefore applies directly to every output pixel at once, and one ablated forward pass casts a vote for all pixels.

The result is a guarantee with three parts. At every pixel outside $A$ whose vote margin is large enough, the predicted normal is provably the same candidate it would be without the attack. Its error is then whatever physics-plus-classification error the clean prediction had. At most $\rho$ pixels are left uncertified by construction.

Gap 2 of the research file notes that no such bound exists for continuous normal or depth maps. The ambiguity that the field treats as a nuisance is exactly what supplies the discrete structure a certificate needs.

The idea has a known limit, and it is part of the claim. The candidate sets are exact only where the smooth-surface reflection model holds. Recovery of surface orientation from diffuse polarization shows that roughness lowers the degree of polarization and biases the zenith toward flat. SfPUEL notes that as the degree of polarization approaches zero, the cues vanish. We therefore expect certified coverage to fall off with the degree of polarization. We will report that curve rather than hide it.

Research Program

The work has three parts.

A candidate-selection network. We take the architecture of Shape from Polarization for Complex Scenes in the Wild (hereafter Lei et al.): a per-pixel viewing-direction encoding, the continuous phase encoding $[\cos 2\phi, \sin 2\phi]$, and self-attention. We keep its inputs and replace its regression head with a per-pixel softmax over the enumerated candidates. Several cases fall back to a separate output that carries no certificate: pixels whose degree of polarization is below a threshold, or whose candidates are degenerate, or whose errors come from roughness that a refractive-index grid cannot absorb. This makes the boundary of the specular assumption explicit in the output.

Deep Shape from Polarization supplies the precedent. It already feeds analytically derived ambiguous normals to a network as priors. Our change is to make the output a choice among those normals instead of a free regression conditioned on them.

Sparse attacks on normal estimation. No paper in the file attacks shape-from-polarization models; the file lists this as Gap 1. We will adapt three attacks to an objective that maximizes the fraction of flipped pixels and the mean angular error of the normals.

  1. GreedyFool, a white-box attack that greedily adds then prunes pixels.
  2. Sparse-RS, a black-box attack based on random search.
  3. The differential-evolution attack of Attacking Convolutional Neural Network using Differential Evolution.

Perturbations act on the raw polarizer-angle intensities, so that every perturbed pixel corresponds to a physically measurable Stokes state. A physically constrained variant is rendered in the SfPUEL Mitsuba pipeline as small polarizing-film patches placed on object surfaces.

This tests a claim in Lei et al. Their "printed image" experiment shows that polarization resists passive two-dimensional illusions. We ask whether that resistance survives an active attacker.

Certification. Randomized ablation is applied with per-pixel voting. One practical issue is that shape-from-polarization networks rely on spatial context, so keeping few pixels hurts. We will tune the retention fraction and train the base network on ablated inputs, as Levine and Feizi do. A second issue is cost: the file flags thousands of samples per query as the main cost. The shared votes across pixels are what make this tolerable for dense prediction, and we will measure runtime against SfPUEL's reported 1.61 s per image.

Aggregation, as a secondary regime. The fourth direction, the fragility of a central aggregator, enters only here and only as a small extension. In multi-view polarimetric fusion, a single fusion step combines all cameras. One tampered camera's flips can then propagate into the shared reconstruction, a small analogue of the single-point failures discussed in Dispersed Federated Learning. Certified per-view choices allow a simple robust fusion: a vote counting only certified candidates across views. We will test this on multi-view data. The federated-training and poisoning questions in Gaps 3 and 4 are out of scope.

Baselines

Naive reference. The undefended network of Lei et al., trained and attacked on the same data. On the in-the-wild dataset (SPW) it reports a mean angular error of 17.86°, against 28.43° for DeepSfP and more than 50° for physics-only methods. This is the clean accuracy our certified model must approach. The do-nothing point under attack is its error and flip rate at each pixel budget.

Strongest image-level method. SfPUEL reports 11.16° on its real set and 12.39° on its synthetic set. It will be attacked identically, to check whether its masked cross-attention, which filters unreliable low-polarization pixels, already gives incidental robustness.

Empirical defense. An $\ell_0$ adversarial-training baseline: Lei et al. trained against GreedyFool perturbations.

Smoothing without discreteness. The same ablation sampling as ours, applied to Lei et al.'s regression output, aggregated by per-pixel geometric median. The file contains no certificate for this aggregator, so it is compared on empirical attacked error only.

Projection-only ablation. This isolates the key ingredient. Our candidate-selection network is used without ablation smoothing, so its output is restricted to physical candidates but carries no guarantee.

Fairness and the bar to beat. All methods share the same training data, the same backbone capacity, the same hyperparameter-tuning budget, and the same attack budgets and attack iterations. The proposal beats the field if it does three things together:

  1. stays within a few degrees of 17.86° clean error on SPW,
  2. reduces attacked flip rate and attacked error below every empirical baseline under the strongest adaptive attack, and
  3. certifies a reported fraction of pixels at a nonzero radius.

Why not just…?

Why not just snap the network's output to the nearest physical candidate? This is the most serious alternative, and it is our projection-only ablation. Snapping limits each pixel's error to "small" or "flipped", but flips are exactly what the attacker wants, and nothing stops them at unperturbed pixels. If the projection-only model turns out to be nearly as robust as the certified one under adaptive attacks, the contribution shrinks to the certificate itself. The comparison under GreedyFool and Sparse-RS will show this directly.

Why not just median-filter the polarization images? The file reports that heuristic sparse defenses are routinely bypassed by adaptive attacks. GreedyFool also places perturbations in textured regions where they evade a learned detector (67.90% detection versus 86.79% for SparseFool). A median filter also smears the phase near edges, which is where disambiguation matters most. We will include it with an attack that is aware of the filter.

Why not just use multiple views, which remove the π-ambiguity physically? Polarimetric Normal Stereo does remove it, but it needs calibrated lights and costly belief propagation, and reports 21.8° on its "Pig" object. More views also do not stop an attacker who tampers with all of them. Single-shot robustness matters for monocular sensing. Our fusion extension shows how certified single views compose when multiple views are available.

Why not just adversarially train against sparse attacks? It is a baseline. It offers no guarantee, and the file attributes the only formal $\ell_0$ guarantees to randomized ablation. If adversarial training matches our empirical robustness, the remaining value is the certificate.

Proposed Experiments

The datasets are SPW for scenes, the DeepSfP 25-object set across three lighting conditions, and SfPUEL synthetic and real for metallic and dielectric objects and rendered physical patches. Pixel budgets run from 0.1% to 2% of pixels. The metrics are:

  • mean angular error, clean and attacked;
  • flip rate, meaning the fraction of pixels whose azimuth error exceeds 90°;
  • certified pixel fraction at radius $\rho$;
  • mean angular error restricted to certified pixels;
  • runtime.

All of these are additionally broken down by degree-of-polarization bin and by material.

Four checks decide the outcome:

  1. Do undefended shape-from-polarization networks suffer large region-level flips from budgets under 1%? This answers Gap 1 and probes Lei et al.'s robustness claim.
  2. Does the certified model keep clean error near Lei et al.'s 17.86° while certifying a majority of high-polarization pixels?
  3. Does certified coverage fall with the degree of polarization in the way the roughness physics predicts? This would confirm that the specular assumption, not the attack, sets the limit.
  4. On PANDORA's synthetic multi-view objects, where PANDORA reports 3.91°, does fusing only certified votes stop one tampered camera from corrupting the reconstruction?