Composing Per-Degradation Feature Modulators to Restore Unseen Mixtures

Real photographs are rarely damaged in only one way. A dashcam frame can carry haze, rain streaks, sensor noise and JPEG artifacts all at once, and the number of possible mixtures grows combinatorially with the number of corruption types and their strengths. Today's "all-in-one" restoration networks are trained on whichever combinations appear in their data. They summarize the input's damage as one flat vector, and nothing in their structure says how a network that has seen "haze" and "noise" separately should handle "haze plus noise." This proposal tests a structural answer. We give each corruption type its own small feature-wise linear modulation module (FiLM: a layer that rescales and shifts each channel of a network's internal features according to a conditioning signal). We then build the modulation for a compound image by composing those affine maps algebraically, in the order that the imaging physics applies the corruptions.

The bet is about generalization, not about peak accuracy on familiar data. If restoring a mixture behaves, in feature space, like undoing its components one after another, then a shared restoration network driven by composed modulators should handle combinations it never saw during training better than a monolithic conditioned network of the same size. It should also do this without the fragile intermediate images that come from chaining separate restorers. Two further properties fall out of the same design. Restoration strength becomes continuous, because each component has an intensity knob. And spatial adaptivity costs almost nothing, because that intensity can be a per-pixel map.

Core Claim

Composing two affine maps gives another affine map. Suppose a compound degradation is the ordered sequence $d_1, \dots, d_k$, running from scene-level corruptions such as haze, rain and snow, through capture corruptions such as blur and noise, to storage corruptions such as JPEG. Each component $d_i$ has a learned modulator with channel scale $\gamma_i$ and shift $\beta_i$. The restoration trunk applies the inverses in reverse order, which collapses to a single composite modulation at each block:

$$ \gamma = \prod_{i=1}^{k} \gamma_i, \qquad \beta = \sum_{i=1}^{k} \Big(\prod_{j>i} \gamma_j\Big)\, \beta_i . $$

This is simply the formula for composing affine maps, so the composite costs one FiLM operation regardless of $k$.

Each component's scale is factored hierarchically by degradation family and strength:

$$ \log \gamma_i(u,v) = s_i(u,v)\,\big(a_{f(i)} + a_i\big). $$

Here $a_{f(i)}$ is a vector shared by all members of the family $f(i)$ (scattering, additive noise, blur, compression), $a_i$ is the leaf-specific refinement for component $i$, and $s_i(u,v) \ge 0$ is a predicted intensity map over pixel coordinates $(u,v)$. The shift $\beta_i$ is factored the same way. Setting $s_i = 0$ switches component $i$ off exactly. Scaling $s_i$ by a constant gives continuous control over restoration strength. A spatial $s_i$ handles patchy rain without a full spatial transform. A lightweight estimator predicts, for each component, whether it is present and its intensity map. The estimator is trained with labels from synthetic data, and the whole system trains end to end.

What is new is the combination: composition happens inside the network's features and is order-aware, the modulators are tied hierarchically by family, and the evaluation explicitly targets combinations held out from training. None of the cited systems has all three.

Relation to Prior Work

Two systems supply the closest ingredients, and both stop short of composition. MoFME shows that cheap affine "feature modulated experts" over a shared feed-forward layer can replace full mixture-of-experts layers for weather removal, with over 74% fewer parameters. It supplies our method's basic unit. However, its experts are selected by a flat router and predicted independently, it is evaluated only on weather, and it never forms a single transform from several active experts. AMIRNet organizes degradations into a coarse-to-fine family tree and injects a binary signature through degradation-specific layer normalization. It motivates our family-level sharing. Its tree is a fixed binary structure with discrete labels rather than continuous intensities, it is evaluated on single degradations, and its authors leave simultaneous mixtures as future work.

A second group conditions one trunk on one flat descriptor. AirNet learns a contrastive degradation vector and modulates features with a spatial affine transform. PromptIR forms a weighted sum of learned prompts and injects it by cross-attention into a Restormer decoder. M2Restore routes features among CNN and Mamba experts using priors from a frozen DA-CLIP model. All three can only handle a mixture if training covered something like it. They are the main competitors on our question, because with enough mixture data they may need no compositional structure at all.

Two works constrain the design. RL-Restore chains small specialist CNNs chosen by a reinforcement-learning agent and documents the "middle state" problem: a partly cleaned image no longer matches what downstream tools expect. We keep its sequential intuition but move the sequence into feature space, where no intermediate image is ever produced. PRISM is the closest in spirit. It trains a CLIP encoder so that degradation embeddings obey arithmetic over sub-mixtures, and it drives Stable Diffusion for selective restoration. It also reports that full restoration can hurt downstream analysis. PRISM's compositionality lives in an embedding that conditions a heavy, multi-step generator. Ours lives in the restoration operator itself, is deterministic and single-pass, and offers continuous rather than categorical control.

On the composition side, Slice-and-Pack reassembles functional fragments of classifiers but needs repair layers to avoid "ability collapse." That warns us that per-component modules can lose shared low-level features, which is why our modulators sit on a single shared trunk rather than on separate sub-networks.

Research Program

The trunk is a NAFNet-style encoder-decoder, chosen because AMIRNet builds on it and it is cheap. Composite FiLM is inserted at every block, with separate composite parameters per stage. The degradation vocabulary has six components in four families: haze and rain (scattering), Gaussian noise (additive noise), defocus or motion blur (blur), and JPEG (compression). Training data come from DIV2K and the standard single-task sets (Rain100L, RESIDE, BSD400/WED). Degradations are applied synthetically in the physical order described above, with randomly sampled intensities and spatial masks.

The central experimental device is a compositional split. Training uses all single degradations and a chosen subset of pairs. Testing uses held-out pairs, all triples, and quadruples. Combinations are held out at the family level too: for example, no scattering-plus-compression pair appears in training. This separates "interpolating within seen mixtures" from "composing parts."

We run three analyses beyond restoration scores. First, an oracle-modulation probe. We freeze the trained trunk and directly optimize per-block $\gamma, \beta$ on each held-out mixture. The gap between composed and oracle modulation measures how much error comes from the composition rule, as opposed to the limits of what any affine conditioning of this trunk can achieve. Second, an intensity-sweep test. We vary $s_i$ and check whether residual degradation, measured by PSNR against partially degraded targets, changes monotonically. This addresses the missing continuous control noted for current all-in-one models. Third, an order test. We compare the ordered composition with a commutative one, which simply sums $\log\gamma_i$ and $\beta_i$. We do this on mixtures where physical order matters, such as noise added before versus after JPEG.

Baselines

The naive reference is the degraded input itself, together with a single unconditioned NAFNet trained on the same mixtures. The unconditioned network shows how much conditioning buys at all.

The sequential reference chains specialist restorers, one per component, in the true reverse order. It is given the oracle order and component labels, so it is an optimistic version of RL-Restore. We also run RL-Restore itself on its native DIV2K blur, noise and JPEG setting, where the paper reports gains of 0.2 to 0.3 dB PSNR over its baselines. Beating the oracle-ordered chain on held-out mixtures would show that feature-space composition avoids the middle-state problem rather than merely reordering it.

The strongest existing competitors are PromptIR and AirNet. Both are retrained on exactly our training split with the same iteration count, the same augmentation and the same hyperparameter-search budget, and PromptIR's trunk is width-matched so that parameter counts are within 10% of ours. We add MoFME-style flat FiLM experts with its uncertainty-aware router, on the same trunk, to isolate the effect of composition from the effect of using FiLM at all.

On the established All-weather benchmark, M2Restore reports an average PSNR of 31.65 dB and SSIM of 0.936, which we treat as the external number to approach. On the PromptIR three-task setting, PromptIR reports an average 0.86 dB over AirNet, and AirNet reports 34.90 dB PSNR on Rain100L. On our held-out-combination split there is no reported result found on Lacuna, so all baselines there are our own retrainings.

Two ablations isolate the key ingredient. The first is a multi-hot FiLM generator: an MLP that maps the same component-plus-intensity estimate directly to $\gamma, \beta$, with the same parameters and estimator but no composition rule. The second removes the family vectors $a_{f}$, which tests whether hierarchical sharing matters.

Success means two things. On held-out triples and quadruples, our model must beat both the width-matched PromptIR and the multi-hot generator by a margin larger than the seed-to-seed spread across three seeds. On seen combinations, it must stay within roughly 0.3 dB of them.

Why not just…?

Why not just train PromptIR on every mixture? With six components, varying intensities and order effects, exhaustive coverage is impractical. Even so, a monolithic model trained on a large random sample of mixtures may interpolate well. This is a real threat. We include a "dense coverage" condition in which baselines see a superset of training pairs, and we measure how the held-out gap shrinks as coverage grows. If the gap vanishes at realistic coverage, the compositional structure is not worth its constraints, and we will report that.

Why not just feed a multi-hot label vector to an ordinary FiLM generator? An MLP can in principle learn any composition, so this is the most dangerous alternative. It is the central ablation, run with identical inputs and parameter count. The claim survives only if the explicit affine-composition rule beats it on combinations the MLP never saw. The oracle-modulation probe will show whether any shortfall comes from the rule or from the trunk.

Why not just chain specialist restorers in the right order? RL-Restore shows that intermediate outputs drift off the input distribution of later tools, and Deep Joint Rain Detection and Removal from a Single Image shows that heavy rain couples local streaks with global veiling, which separate stages handle poorly. The oracle-ordered chain baseline tests this directly, and it also costs $k$ full forward passes against our one.

Why not just use PRISM-style embedding arithmetic? PRISM reaches 22.08 dB PSNR on its Mixed Degradations Benchmark, against 20.84 dB for the next diffusion model. But it relies on multi-step Stable Diffusion sampling and categorical prompts. We run it on its benchmark as a reference point, and we compare runtime and controllability rather than claiming parity in that domain.

Decisive Checks

The idea is supported if three things hold. First, composed modulation beats the multi-hot generator and the retrained PromptIR on held-out triples, at matched parameters. Second, the composed-versus-oracle modulation gap is small relative to the gap between baselines and the oracle. Third, ordered composition beats commutative composition on order-sensitive mixtures. We also check that intensity sweeps change the output monotonically and that downstream segmentation on RainCityscapes and HazeCityscapes, as in MoFME's protocol, benefits from partial restoration settings, echoing PRISM's "more is less" finding.

The idea is refuted if the multi-hot generator matches us on held-out combinations. It is also refuted if commutative composition does as well as ordered composition. In that case the physics-ordered structure is decoration, and the cheaper flat design should be preferred.