Explaining Away Light Changes Inside Video Segmentation Memory

Video object segmentation systems follow an object through a clip by comparing each new frame to remembered past frames. They break when the lighting changes over time. A car drives into a tunnel, or sunlight slides across a seat, and the tracked object no longer looks like its stored copies, so the match fails. A related failure is that the edge of a moving shadow looks like an object boundary, and the predicted mask follows the shadow from frame to frame. We propose to use the video itself as the remedy. Each remembered frame is a second photograph of the same surfaces under different light. For true lighting changes, the ratio between a pixel's current color and its remembered color should follow a simple, spatially smooth pattern: a global color gain plus a shadow term that darkens along a fixed color direction. Real changes in what the object looks like do not follow that pattern. We fit this pattern robustly at matching time, remove it, and then match again.

The opportunity comes from two lines of work that have not met. Classical photometric invariants show that ratios across several images taken under different lighting cancel the lighting and leave the material (A Class of Photometric Invariants). They need those multiple acquisitions, and they assume a static scene. Memory-based video segmentation stores exactly such multiple acquisitions of moving objects, but it compares raw appearance features and has no notion of lighting (Learning Position and Target Consistency for Memory-Based Video Object Segmentation). Our claim is that letting the memory explicitly explain away the lighting gives masks that are both more accurate and more stable over time under moving shadows and exposure shifts. We further claim that photometric augmentation alone cannot deliver this, because the shadow-versus-boundary ambiguity cannot be resolved from a single frame.

Core Claim and Mechanism

A memory network (the kind of segmenter that matches the current "query" frame against stored past frames) produces soft correspondences $\pi(x)$ between query pixels $x$ in frame $t$ and pixels in a memory frame $m$. For corresponded pixels that are not clipped, we model the log-color ratio as

$$\log I_t(x) - \log I_m(\pi(x)) = a + s(x)\,d + \varepsilon(x),$$

where the terms are defined as follows. $a \in \mathbb{R}^3$ is a global per-channel gain, which captures exposure and color-temperature shifts under the standard diagonal model of illuminant change. $d \in \mathbb{R}^3$ is a per-clip shadow direction in log-RGB. Outdoor shadows remove direct sunlight and leave bluish skylight, so they shift color along a roughly fixed direction. $s(x) \ge 0$ is a piecewise-smooth shadow-strength map. $\varepsilon(x)$ is the residual that the lighting model cannot explain.

We fit $a$, $d$ and $s$ with iteratively reweighted least squares, using a total-variation penalty on $s$ so that shadows can have sharp edges. The weighting is borrowed from Intrinsic Decomposition of Image Sequences from Local Temporal Variations, which fits shading robustly over time but treats passing shadow edges as outliers. We instead model them explicitly. That paper also tracks appearance at fixed pixel coordinates and therefore requires a static camera. We replace fixed coordinates with the memory's learned correspondences, which lifts that restriction.

After fitting, the query frame is compensated toward the memory frame's lighting and re-encoded. The memory readout is then repeated, so correspondence and lighting estimation alternate for two or three rounds. The residual $\varepsilon$ is kept as an extra signal, since a large residual indicates a real appearance change such as an occluder or a new part coming into view.

Two constraints from the illumination literature shape the design. First, ratio invariants become noise-dominated when the lighting barely changes (A Class of Photometric Invariants). We therefore gate the module on the size of the estimated change $\|a\| + \max s$, so that it is skipped when there is nothing to explain. Second, saturated highlights and crushed shadows destroy color information, as reported in field robotics (High Precision - Low-Cost Apple Feature Recognition Model). Pixels near clipping are therefore excluded from the fit, and their compensation is filled in from the smooth $s$ map.

Research Program

The base system is a Space-Time Memory segmenter with position and first-frame anchoring in the style of LCM (LCM). LCM's position guidance restricts where the model searches, but it cannot tell a shadow edge from an object edge. Our module sits between memory retrieval and mask decoding. It can run with frozen pretrained weights, and it can also be trained end to end with the residual fed to the decoder. We will report both.

Two evaluation sets are needed, because no benchmark in the file pairs video masks with controlled lighting change.

The first, which we call DAVIS-Lit, is built from DAVIS 2017 validation (DAVIS benchmark). We composite moving cast shadows that follow the sun-and-sky color model, and add exposure and white-balance ramps. Ground-truth masks are unchanged because the objects are unchanged. To keep the comparison honest, we use two separate shadow generators. Generator A, with procedural occluder shapes, is the only one allowed during any training or augmentation. Generator B, with shadows rendered from 3D foliage and window geometry and including spatially varying color temperature, is used only for testing.

The second is a small real test set of roughly thirty clips with hand-annotated masks. Sources are tunnel entries and tree-shadow driving clips drawn from the Waymo and DROID sources used in the TC-Light benchmark (TC-Light), plus short in-cabin videos recorded under the conditions that the ISSO study found destroy classical segmenters (Background-foreground segmentation for interior sensing).

Metrics follow DAVIS: region similarity $J$, contour accuracy $F$, and temporal stability $T$. We add a "shadow-attraction" score, defined as the fraction of predicted boundary pixels lying within a few pixels of a ground-truth shadow edge (known exactly on DAVIS-Lit) rather than an object edge. This targets the specific failure in which contours snap to shadow boundaries, as seen with morphological snakes on ISSO.

Baselines

The naive reference point is the base memory segmenter run unchanged. On standard data, LCM reports 83.5% on DAVIS 2017 validation and 82.0% overall on YouTube-VOS 2018, where STM reports 79.4% (LCM). We found no reported result on Lacuna for any video segmenter under controlled illumination change. We therefore first measure the drop from clean DAVIS to DAVIS-Lit and to the real clips. That drop defines the gap the proposal must close. If it is under one point of $J\&F$, the problem is not worth this machinery.

A second reference point is a strong per-frame segmenter, Mask R-CNN, run with no temporal model. It reached 75.5% IoU on the ISSO cabin images (Background-foreground segmentation for interior sensing). We expect it to hold up reasonably on $J$ and to do poorly on $T$, as DAVIS documented for per-frame methods.

The strongest competitor is the same memory segmenter fine-tuned with physically based photometric augmentation. Training clips receive Generator A shadows, exposure ramps and color-temperature shifts, with the tuning budget and number of iterations matched to our end-to-end variant. It is the main threat because it attacks the same failure with no new inference-time computation. Beating it means a statistically reliable gain in $J\&F$ and $T$ on Generator B and on the real clips, not only on Generator A.

The fourth baseline places preprocessing in front of the unmodified segmenter: TC-Light's Stage I exposure alignment, which fits a per-frame 3×4 affine color transform (TC-Light). It isolates whether a global correction is enough.

The fifth applies Lai et al.'s recurrent consistency filter to the output mask probabilities (Learning Blind Video Temporal Consistency). It tests whether blind temporal smoothing recovers stability.

Three ablations isolate the key ingredient. In the first, the shadow term is removed, leaving $a$ only. In the second, the alternation is removed: correspondence is computed once from uncompensated features. In the third, the fit uses fixed pixel coordinates instead of memory correspondences, mimicking the static-camera assumption. Our method combined with augmentation is also reported, since the two could be complementary.

Why not just…?

Why not just train with aggressive shadow and color augmentation? This is a real threat, and it may close most of the gap on in-distribution synthetic shadows. RelightVid's illumination-invariant ensemble shows that brightness-scaling augmentation helps with global changes (RelightVid). Scalar scaling does not model spatially varying shadows, but our physically based augmentation does, so we treat the threat seriously. Our argument is that a single frame often cannot distinguish a shadow edge from a material edge, while the ratio to a remembered frame can. The decisive test is the held-out Generator B and the real clips. If augmentation matches us there, we will report that the explicit lighting model is unnecessary.

Why not just feed illumination-invariant color channels, such as normalized opponent chromaticity, to the network? Opponent-space descriptors achieve invariance to light intensity (Evaluation of color descriptors). However, they discard intensity and handle neither chromatic shadow shifts nor clipping. We will train the base segmenter on these channels as a further baseline. We expect gains on exposure ramps and little gain on colored cast shadows.

Why not just normalize lighting per frame, or run a video relighting model first? Independent per-frame tone correction, such as the adaptive gamma pipeline in Luminance Partition Correction, applies a different curve to each frame and adds flicker. This is why TC-Light needed explicit exposure alignment. TC-Light itself relies on optical flow, which breaks across hard shadows, and it reports failures in exactly those conditions. The Stage I baseline and the $a$-only ablation show what global correction buys.

Why not just smooth the masks afterwards? Blind filters trade stability for blur (Learning Blind Video Temporal Consistency). Deep Video Prior needs about two seconds per frame and careful early stopping (Deep Video Prior). Both can make a mask that follows a shadow more consistent, but they cannot correct it. The post-filter baseline should raise $T$ and leave shadow attraction unchanged.

Decisive Checks

The proposal succeeds if three things hold. First, on the real clips and Generator B, it beats the augmentation baseline on $J\&F$ and on shadow attraction. Second, it improves $T$ without lowering $F$. Third, removing the shadow term or the memory-based correspondences gives most of the gain back. It fails if augmentation alone matches it on the held-out data. It is also limited if the gain appears only on Generator A, which would mean the method has learned our synthetic shadow model rather than real lighting physics. We will measure runtime overhead against the reported 6% overhead of LCM's modules and report it alongside accuracy.