Hiding Messages Outside the Lighting Subspace: Steganography That Survives Dark Capture and JPEG

Learned steganography hides a message inside an image so that a decoder can read it back while people cannot see it. Systems of this kind are now expected to survive two hostile processes that pull in opposite directions. Lighting changes, such as dimming, colour casts, shadows and low-light sensor noise, mostly alter the smooth, low-frequency part of an image. So current deep hiding methods put the message in fine high-frequency texture, where lighting barely reaches. JPEG compression does the reverse: it throws away high-frequency detail first. The usual remedy is to augment training with both kinds of damage and hope the network finds a compromise. We think that treats the problem as two independent noise sources when it is not. In real capture, lighting acts on the hidden signal before the codec does. A photo taken in dim light scales the hidden residual down by the same factor that darkens the scene, while JPEG's quantization steps stay fixed. A payload that would survive JPEG-50 in daylight falls below the quantization threshold at night and is deleted outright. No decoder, however well regularized, can recover it.

We propose to constrain where the encoder is allowed to put the message, not how the decoder represents it. The encoder's residual is projected onto a subspace with two properties. It lies inside the frequency bands that JPEG keeps. It is also orthogonal to the "lighting tangent space" of the cover, meaning the set of pixel changes that small variations in gain, bias, tone curve and white balance would produce in that particular image. The decoder applies the same projection to the received image, divides out an estimated local gain, and only then reads bits. A quantization-margin loss, computed at the darkest gain we commit to supporting, keeps the payload above JPEG's step size after darkening. In two sentences: lighting changes and the message are made to live in perpendicular directions of pixel space, so lighting cannot be mistaken for message and the message cannot hide where lighting will distort it. The message is also placed where the codec keeps it, with enough amplitude to outlast darkening.

Core Claim

The joint failure of current methods under illumination and compression comes from an interaction between the two. Darkening shrinks the payload relative to fixed quantization steps, and lighting-induced pixel changes overlap with the payload's own directions. This interaction can be removed by a cheap, explicit orthogonality constraint in the carrier's signal space. The same constraint applied to the decoder's internal features, which is the obvious transplant of domain-separation ideas, does not remove it. If the claim holds, then over a grid of darkening factor and JPEG quality, bit error for augmentation-trained baselines should grow faster than the two marginal degradations predict. Our method should show roughly additive degradation instead.

Grounding in Prior Work

The motivating evidence comes from UDH: Universal Deep Hiding. UDH adds a cover-independent residual to the cover image. It shows that deep hiding encodes secrets as high-frequency patterns, which makes it robust to intensity shifts: average pixel discrepancy is 3.5 under a 50/255 shift, against 32.4 for cover-dependent hiding. The authors themselves note that this same high-frequency placement is what JPEG discards. Our proposal starts from that paradox but rejects UDH's purely architectural separation in favour of an explicit geometric one.

StegaStamp and Learning Invisible Markers represent the end-to-end alternative. Both train an encoder and decoder through a differentiable chain of warps, blur, colour shifts and approximate JPEG. Neither imposes any structure separating lighting from message, and neither models the order of operations in which lighting precedes compression. StegaStamp also reports visible noise in smooth regions, which is a symptom of the encoder spending energy wherever the augmentations allow rather than where it is safe.

The method comes from the representation-orthogonality literature. Domain Separation Networks split features into a shared part and a private part that absorbs domain-specific variation, and penalize their cross-correlation. Multitask AET with Orthogonal Tangent Regularity makes the directions in which features change under lighting orthogonal to the directions that carry object identity. It also supplies a physics-based sensor and ISP model (shot noise, read noise, gamma, white balance) that we reuse to define the lighting tangent space. Both papers apply orthogonality to features of a recognition model. We apply it to the pixels of the transmitted signal, where it governs what information physically survives. We keep the feature-level version only as a competing baseline.

Robust Image Steganography: Hiding Messages in Frequency Coefficients supplies the codec-aligned half of the constraint, embedding in DCT coefficients that JPEG retains. It also defines the strongest simple competitor.

The negative constraint comes from the invertible-network line, including Large-Capacity and Flexible Video Steganography via Invertible Neural Network. Invertibility guarantees exact recovery only for small perturbations of the stego image. We therefore do not rely on it.

Mechanism

Let $C$ be the cover image, $\tilde r$ the raw residual produced by the encoder from the message, and $\Phi_\theta$ a differentiable lighting model with parameters $\theta$. In the log domain, $\theta$ covers a low-order smooth gain field per colour channel, a smooth bias field, a few tone-curve basis functions, and white balance, with $\theta_0$ the identity. Let $M$ be the subspace of block-DCT coefficients retained at the target JPEG quality, with orthogonal projector $P_M$. The lighting tangent space at the cover is

$$T(C) = \mathrm{span}\left\{ \frac{\partial \Phi_\theta(C)}{\partial \theta_i}\Big|_{\theta_0} \right\}_{i=1}^{k},$$

which has roughly a hundred directions for a 128×128 colour image. Write $\Pi_{A}$ for the orthogonal projector onto a subspace $A$. The transmitted residual is

$$r = \left(P_M - \Pi_{P_M T(C)}\right)\tilde r.$$

This lies in $M$ and is orthogonal to every tangent direction $t$, because $\langle r, t\rangle = \langle r, P_M t\rangle = 0$. It costs one small QR decomposition per image and adds no learned parameters.

The decoder receives $y$. It recomputes the tangent span from $y$ itself, removes it, and estimates a local gain map $\hat g$ from the removed component. It then decodes from $(P_M - \Pi_{P_M T(y)})\, y / \hat g$.

During training the degradation chain is lighting first, then JPEG, then optionally a second recompression, which matches real camera capture and re-upload. The training objective adds a hinge loss on each payload-carrying DCT coefficient. Let $r_j$ be that coefficient, $q_j$ its JPEG quantization step, $g_{\min}$ the darkest gain the system promises to support, and $\gamma$ a margin. The loss is

$$\mathcal{L}_{\text{margin}} = \sum_j \max\left(0,\; \gamma\, \frac{q_j}{2\, g_{\min}} - |r_j|\right).$$

This makes explicit the trade between how dark a capture we survive and how detectable the payload becomes. Choosing $g_{\min}$ is a stated design choice, not a hidden tuning knob.

The projection is first-order. A large global gain still leaves the payload scaled rather than mixed with lighting, because $g \odot (C + r) - C$ splits into a tangent component and $g \odot r$. Shadows with sharp edges and clipped highlights are not in the span. Those are exactly the cases where we expect the method to degrade, and we test them separately.

Research Program

The work has three parts. First is a diagnostic study. We measure, for trained UDH and StegaStamp-style models, what fraction of the payload's energy falls inside $T(C)$ and outside $M$. We then test whether this fraction predicts per-image bit error under combined darkening and JPEG. A strong correlation would confirm the mechanism before we build anything.

Second, we build the projected encoder and decoder on the UDH backbone, at 128×128 image-into-bits capacity matched to UDH's watermarking setting. We also build a StegaStamp-capacity variant with 100 bits at 400×400.

Third, we evaluate on a factorial grid of degradations. Lighting comes from three sources. The first is the Multitask AET ISP simulator. The second is real tone and gain transforms fitted to paired low and normal-light images from the LOL dataset and applied to stego images. The third is real shadow masks taken from ISTD shadow and shadow-free pairs, which deliberately include non-smooth shadows. JPEG quality ranges from 90 down to 30. Finally, a physical test displays stego images on a screen and recaptures them with a phone under controlled dimming, followed by platform-style recompression.

Baselines

The naive reference point is UDH as published, trained without lighting or JPEG augmentation, evaluated on the same grid. This shows the size of the interaction when nothing is done. Its reported JPEG-50 bit accuracy on ImageNet 128×128 is 91.5%, against 63.0% for HiDDeN (UDH). We will first reproduce that 91.5% in the daylight cell of our grid before trusting any other number.

The strongest competitor is a StegaStamp-style end-to-end model (StegaStamp) retrained on the same covers. Its noise layer contains our full lighting model, in the same lighting-then-JPEG order, plus margin-free differentiable JPEG. It is the strongest competitor because it sees exactly the same degradations and differs only in having no geometric constraint. Its reported physical-capture mean bit accuracy is 98.7%, with above 86% at the 5th percentile. Learning Invisible Markers reports about 2% bit error rate against StegaStamp's above 14% under moderate warping. These figures come from different setups from ours, so we treat them as sanity anchors rather than targets. For fairness, every learned model gets the same backbone size, number of training steps and degradation samples, and an equal hyperparameter search budget of 20 trials over loss weights.

The DCT baseline embeds in mid-band coefficients with sign modulation, following Robust Image Steganography: Hiding Messages in Frequency Coefficients. The file reports no result for it on Lacuna under combined lighting and compression.

The feature-orthogonality baseline places a domain-separation decoder on the StegaStamp-style model. It has a private branch that predicts lighting parameters and a Frobenius cross-correlation penalty against the message branch, following Domain Separation Networks. This isolates the question of whether orthogonality belongs in features or in signal space.

Three ablations isolate our ingredients: removing the tangent projection, removing the margin loss, and training with JPEG before lighting instead of after.

Beating the strongest baseline means two things. First, a lower bit error rate in the dark-and-compressed corner of the grid (gain 0.3 or below, JPEG quality 50 or below) at matched cover PSNR, which we fix at 37–39 dB to bracket UDH's 39.13 dB. Second, a learned steganalyzer trained on BOSSbase-style data must show no worse detection error. The file reports no detection-error number for any method on BOSSbase.

Why not just…?

Why not just augment harder and train end to end? This is the most likely threat, and the matched StegaStamp-style baseline tests it directly. Our argument is mechanistic rather than anecdotal. Augmentation does not tell the encoder that darkening precedes quantization, and gradient descent through approximate JPEG gives weak signal once a coefficient is quantized away. The domain-separation results also show that unconstrained alignment lets nuisance variation leak into the useful representation: DANN reaches 77.4% against DSN's 83.2% on MNIST to MNIST-M (Domain Separation Networks). If the augmented baseline matches us in the dark-compressed corner, the claim is wrong and we will report that.

Why not just brighten the image with a low-light enhancer before decoding? Enhancement cannot restore coefficients that JPEG already set to zero, because the deletion happens before the enhancer runs. Learned enhancers also rewrite fine pixel structure. Multitask AET found that enhancement-then-detect pipelines underperform: YOLOv3 with Zero-DCE scores 0.717 mAP and with KinD 0.729, against 0.788 for degradation-aware training. FeatEnHancer documents the same gap between what looks good to people and what helps machines. We will nonetheless run Zero-DCE and a log-domain high-pass filter in front of the strongest baseline's decoder. The high-pass filter is the classical homomorphic shortcut to removing smooth lighting.

Why not just embed in mid-band DCT coefficients? This is a real threat. For purely smooth global lighting, our subspace largely reduces to block mid-band AC coefficients. Two differences should matter. The tangent space depends on the cover, so it removes the gain-times-content directions that fixed bands miss under colour casts and tone curves. And the margin loss addresses the amplitude collapse that fixed-strength DCT embedding ignores. If the DCT baseline matches us everywhere except the cover-dependent cast conditions, the honest conclusion is that the projection adds little beyond the margin loss. The margin-only ablation is designed to reveal exactly that.

Why not just put the orthogonality in the decoder, as domain separation does? Feature separation can stop lighting from confusing the decoder. It cannot recover bits that quantization has erased. The feature-orthogonality baseline should therefore improve the bright-compressed and dark-uncompressed cells but not the dark-compressed corner. If it improves that corner too, our central argument about where orthogonality must act fails.

Decisive Checks

The first decisive check is the shape of the error surface over darkening and JPEG quality. We fit an additive model of the two marginal error rates and measure the interaction residual. Baselines should show a large positive interaction; our method should drive it toward zero. The second is the pre-registered diagnostic: payload energy inside the lighting tangent space should predict baseline errors, and the projection should drive that energy to zero by construction. The third is the ISTD shadow condition, where the first-order tangent space is known to be wrong. We expect a measured loss of advantage there, which both defines the method's limits and motivates a nonlinear extension. The fourth is the physical display-and-recapture test under dimming. It is the only setting where neither lighting nor compression is simulated, and we treat it as the final arbiter.