Photometric stereo recovers the 3D orientation of every surface point from many photos taken by a fixed camera while the light moves. It works because brightness depends on the angle between the surface and the light. Deep networks now do this well on bulgy objects, but they disagree on a basic design question. Global models, transformers that let every pixel see every other pixel, lead the real-world benchmark. Yet on flat objects with fine engraving, simple per-pixel networks recover detail better than networks that pool over space. We think part of this disagreement comes from a confound nobody has isolated: large receptive fields may be doing two jobs at once. One job is genuine non-local physics, such as cast shadows and light bouncing between surfaces. The other is simply evening out brightness differences between regions, which come from dark albedo, falloff, or oblique shading. If the second job explains much of the benefit, it can be done locally and cheaply, without blurring fine geometry.
We propose a normalization layer that is safe to use in photometric stereo. It divides every observation at a location by one local brightness statistic, pooled over a small spatial window and over all lights. Because every image at that location is scaled by the same positive number, the ratios between lights are left intact, and those ratios are what encode the surface orientation. The layer removes slowly varying albedo and gain, and it preserves the scale symmetry that bias-free photometric stereo networks rely on. We use it as a diagnostic tool. With the brightness-equalizing job handled locally, we can measure how much of the advantage of global context is left, and where that remainder is concentrated.
Core Claim
Local contrast normalization, meaning rescaling each pixel by statistics of its neighbourhood, has been dangerous to apply to photometric stereo. Standard versions subtract a local mean and normalize each image separately, which destroys the brightness relationship $I_m = \rho\,(\mathbf{n}\cdot\mathbf{l}_m)$ that links observation $m$ to normal $\mathbf{n}$, albedo $\rho$ and light $\mathbf{l}_m$. Our layer avoids both operations. Let $I_m(x)$ be the intensity (or a feature) at pixel $x$ under light $m$, $M$ the number of lights, and $W(x)$ a $k\times k$ window. The layer computes
$$\hat I_m(x) = \frac{I_m(x)}{\sqrt{\epsilon^2 + \frac{1}{M|W|}\sum_{y\in W(x)}\sum_{m'=1}^{M} I_{m'}(y)^2}}$$
Here $\epsilon$ is a floor that plays the role of the clip limit in contrast-limited histogram equalization: it stops near-black regions from being amplified into noise.
Two properties follow directly. First, within a Lambertian window the denominator is the same for all $m$, so the light-to-light ratios at $x$, and therefore the least-squares normal, are unchanged. Second, if albedo or overall gain is constant across the window, it cancels exactly. The output is then invariant to any smooth multiplicative field, and the window size $k$ sets what counts as "smooth."
Setting $k=1$ recovers per-pixel observation normalization. Setting $k$ to the full image recovers global intensity normalization. So $k$ is an explicit, measurable trade-off between photometric robustness and spatial context. Because the layer is degree-zero homogeneous, a network made of bias-free convolutions plus this layer stays exactly invariant to global intensity scaling.
The empirical claim is in two parts. First, an intermediate $k$ beats both extremes on detail-rich and albedo-varying surfaces. Second, once this layer is present, a network with a small receptive field closes most of the gap to global models on convex and near-planar objects. The remaining gap should concentrate on concave, self-shadowing geometry, where non-local physics is real.
Research Program
The method is supplied by two papers from outside photometric stereo. Local Context Normalization normalizes features over a local window using summed-area tables, which keeps the cost constant regardless of window size. It showed that image-wide normalization washes out local signal in dense prediction. We reuse its integral-image implementation but change what is pooled (all lights jointly) and drop mean subtraction. ALCN learns a mixture of Gaussian normalization kernels jointly with a downstream task and restores recognition under harsh lighting. It never touched normal estimation, and its per-image normalization would break the cross-light ratios that photometric stereo needs. We borrow its idea of letting the network choose among several window sizes, constrained to light-shared, divisive kernels.
The host architectures come from photometric stereo. Leveraging Spatial and Photometric Context is a bias-free network with separable photometric and spatial convolutions that is equivariant to intensity scaling. It deliberately uses no normalization, and our layer is designed to keep its symmetry. PS-FCN from Deep Photometric Stereo for Non-Lambertian Surfaces fuses lights by max-pooling and offers a per-pixel normalized variant that is exactly our $k=1$ case. For the universal setting, where lighting is unknown, we insert the layer into a reimplementation of UniPS-GLC before its encoder and in its full-resolution decoder.
The motivation comes from two findings in prior work. DiLiGenT-Pi found that per-pixel CNN-PS beats all-pixel PS-FCN on micro-relief, and that low contrast hurts rough and translucent planar surfaces. Light of Normals obtains the best DiLiGenT score with global cross-image attention plus a wavelet branch added to recover lost high frequencies. That fix suggests global processing loses detail.
Our work has three parts. First, we place the layer at the input and after each spatial block, applied per channel group but always shared across lights. We train with a learned mixture over $k\in\{1,3,7,15,31\}$ and also with each fixed $k$. Second, we run a controlled synthetic study on CyclesPS-style renders. Each test tensor is multiplied by smooth random fields of known bandwidth, one shared across lights (an albedo or vignetting proxy) and one varying per light (a near-field falloff proxy). Our layer is predicted to cancel only the first kind, and we report that limit honestly. Third, we run a receptive-field decomposition. Using the same backbone, we compare small-receptive-field, deep pooled, and criss-cross-attention variants, with and without the layer. CCNet supplies the attention: it reaches every pixel by attending along rows and columns twice, at roughly $N\sqrt{N}$ cost. This lets us add global context at full resolution rather than at a downsampled canonical size.
Baselines
The do-nothing reference is the classical least-squares Lambertian solve with the Position Threshold heuristic from the DiLiGenT benchmark paper. That heuristic discards the brightest and darkest 40% of observations per pixel and is reported to rival complex models with dense lighting; no reported numeric value was found on Lacuna. It is run on identical image subsets.
The strongest calibrated local competitor is the bias-free network of Leveraging Spatial and Photometric Context, which reports 6.37° mean angular error on DiLiGenT. It is the most direct test of whether normalization can add anything to a scale-equivariant design. We retrain it on CyclesPS with and without our layer, using an identical schedule, parameter budget (about 0.5M), and hyperparameter search. Beating it means at least a 0.3° average improvement across three seeds on DiLiGenT, plus a significant gain on DiLiGenT-Pi rough and translucent scenes.
PS-FCN with its per-pixel normalization is the $k=1$ ablation in disguise. PS-FCN without normalization reports 7.4° on DiLiGenT in Deep Photometric Stereo for Non-Lambertian Surfaces. We run it at $k=1$, at the best $k$, and at full-image $k$ within the same codebase, which isolates the spatial window as the key ingredient. A further ablation replaces our layer with the standard local context normalization layer (mean-subtracting, per image) and with group normalization. We predict both hurt, because they break cross-light ratios or pool across shadow boundaries.
The strongest global method is Light of Normals (LINO UniPS), which reports 4.65° mean angular error on DiLiGenT and 9.43° on LUCES. UniPS-GLC reports 13.8° on PS-Wild. We do not expect a small local network to beat LINO overall. Retraining LINO on PS-Verse is likely beyond our compute, so we compare against its published numbers. The fair comparison we can control is our layer added to the UniPS-GLC reimplementation, trained under the same budget as the plain reimplementation. Success means improving that model on DiLiGenT-Pi, PS-Wild, and LUCES. It also means showing, per object, that the local-plus-layer calibrated model sits closer to the global models on convex and planar objects than on HARVEST and the DiLiGenT102 Turbine.
Why not just…?
Why not just normalize each pixel's observations, as PS-FCN already does? This is the real threat, because it already removes albedo exactly. Its weaknesses are predictable. Pixels that are dark under most lights get divided by a tiny number and become noisy. All relative brightness between neighbours is discarded, even though DiLiGenT-Pi suggests faint neighbour contrast carries the micro-relief signal. The window sweep settles the question directly. If $k=1$ matches the best $k$ on DiLiGenT-Pi and the synthetic albedo-field test, the spatial part of our proposal is unnecessary, and we will report that.
Why not just apply CLAHE or Difference-of-Gaussians as preprocessing? Both remap each image independently and non-linearly, so the ratio $I_m/I_{m'}$ at a pixel no longer reflects $\mathbf{n}\cdot\mathbf{l}_m/\mathbf{n}\cdot\mathbf{l}_{m'}$. ALCN also found fixed DoG far behind learned normalization even in detection (AUC 0.611 against 0.787). We include CLAHE-preprocessed inputs to PS-FCN as a baseline, and we expect it to underperform no preprocessing at all on calibrated data.
Why not just use a global transformer and accept the cost? For overall DiLiGenT accuracy, LINO's 4.65° is the number to beat, and we do not claim to beat it with a small model. Our claim is narrower and testable. Part of the global advantage is brightness equalization that a local layer can supply without the detail loss DiLiGenT-Pi documents. The criss-cross arm shows whether adding true global context on top of the layer still helps, and where. If adding the layer does not shrink the local-versus-global gap on convex objects, the hypothesis is wrong.
Why not just keep the bias-free design with no normalization? Bias-free layers handle one global intensity scale but not spatially varying contrast. The smooth-field stress test is built to expose this gap. If the bias-free baseline is flat under shared multiplicative fields, our layer has no reason to exist in the calibrated setting.
Proposed Experiments
Training uses CyclesPS for calibrated models and PS-Wild for universal models. Evaluation covers DiLiGenT (all 96 lights and a 10-light sparse subset), DiLiGenT-Pi per material group, DiLiGenT102 per shape and material, LUCES, and PS-Wild, all scored by mean angular error. For DiLiGenT-Pi we add a detail metric: angular error restricted to pixels with high ground-truth normal gradient, which is where pooling should hurt.
Four results are decisive. First, the error-versus-$k$ curve must have an interior minimum on DiLiGenT-Pi and on the synthetic albedo-field test; otherwise the spatial window adds nothing. Second, under shared smooth multiplicative fields, the normalized model's error must stay flat as field amplitude grows while unnormalized baselines degrade; under per-light fields both should degrade. That second outcome bounds the method honestly for near-field capture like LUCES. Third, mean-subtracting or per-image local normalization must hurt relative to our layer, confirming that preserving cross-light ratios is the ingredient that matters. Fourth, the receptive-field decomposition, reported per object, must show the local-plus-layer model's gap to the criss-cross variant shrinking on convex and near-planar scenes but persisting on HARVEST and Turbine. We will also report normal-inversion rates on DiLiGenT-Pi to check whether the layer helps or worsens the convexity ambiguity raised by LINO. We do not predict it will fix that ambiguity, since normalization carries no information about which side the light comes from.
References
- Local Context Normalization: Revisiting Local Normalization
- ALCN: Adaptive Local Contrast Normalization
- Leveraging Spatial and Photometric Context for Calibrated Non-Lambertian Photometric Stereo
- Deep Photometric Stereo for Non-Lambertian Surfaces
- Universal Photometric Stereo Network using Global Lighting Contexts
- DiLiGenT-Π: Photometric Stereo for Planar Surfaces with Rich Details - Benchmark Dataset and Beyond
- Light of Normals: Unified Feature Representation for Universal Photometric Stereo
- CCNet: Criss-Cross Attention for Semantic Segmentation
- A Benchmark Dataset and Evaluation for Non-Lambertian and Uncalibrated Photometric Stereo