Which Nonlinearities Make High Frequencies? Spectrally Guided Activation Removal for Fast Image Restoration

A common way to make neural networks fast on real hardware is to delete some of their activation functions. Once the nonlinearity between two convolutions is gone, the two layers can be multiplied together into one dense layer, and GPUs run one dense layer much faster than a chain of thin ones. This works well for image classifiers. For image restoration it has a problem that the classification literature never had to face. A stack of convolutions with no nonlinearity in between is a linear, shift-invariant filter. Such a filter can only rescale and mix the frequencies already present in its input; it cannot create new ones. In super-resolution, the job is to create high-frequency detail that the low-resolution input lacks. That job falls to the nonlinearities. If we choose which activations to delete by looking at pixel loss, we will tend to delete the wrong ones: pixel losses are dominated by low-frequency energy and barely notice when fine texture disappears.

We propose to pick which activations to remove by measuring how much high-frequency content each one generates beyond what the best linear replacement could produce, and to train the collapsed network with a frequency-weighted loss. In two sentences: activations in restoration networks act as frequency generators, and removal criteria based on pixel error are blind to exactly what they generate. Scoring activations by the frequency content they alone can produce should yield collapsed restoration networks that are as fast as existing ones but keep far more texture.

Core Claim

The claim is structural, not only empirical. Consider a block of layers whose internal activations have all been removed. That block computes a multichannel convolution. In the Fourier domain its output at spatial frequency $k$ is $Y(k) = H(k)X(k)$, where $X(k)$ and $Y(k)$ are the vectors of input and output channel spectra and $H(k)$ is a channel-mixing matrix fixed per frequency. Output energy therefore cannot appear at a frequency where the input has none. Pointwise nonlinearities such as ReLU or GELU break this rule. They produce harmonics and cross-frequency products, and this is the mechanism by which a restoration network turns blurry features into sharp ones. Removing an activation is harmless when its frequency-generating role is small. It destroys detail when that role is large, and a spatial loss will under-report the damage.

This yields a concrete score. For an activation $\sigma$ at a given location in the network, we fit on calibration images the best per-frequency linear map $\hat H(k)$ from the block's input spectrum to its output spectrum. We then measure the energy that this linear surrogate cannot explain, weighted toward high frequencies:

$$S(\sigma) = \sum_k (1+|k|^2)^s \, \mathbb{E}\,\big\| Y(k) - \hat H(k)X(k) \big\|^2 .$$

Here $Y(k)$ is the true block output with $\sigma$ in place, the expectation runs over calibration images, and $(1+|k|^2)^s$ is the Sobolev weight that raises the importance of high frequencies. The weight is taken from Coloring the Noise: Adversarial Sobolev Alignment, which uses it with $s=1.5$ to align super-resolution training with the power-law spectrum of natural images. Activations with low $S$ are removed first. The collapsed network is then fine-tuned with a spectral loss.

The claim also makes a falsifiable prediction that separates it from generic "frequency losses help" results. In denoising, the target has less high-frequency energy than the input, and a linear filter can remove frequencies. So the gap between spectral and spatial removal criteria should be large for super-resolution and small for denoising. If the gap is the same in both, the frequency-generation story is wrong.

Relation to Prior Work

The method builds on activation-removal work. DepthShrinker learns a continuous mask per activation in inverted residual blocks and replaces unneeded activations with identity. It then merges each 1×1–3×3–1×1 sequence into one dense convolution, reporting 3.06% higher ImageNet accuracy and 1.53× throughput over MetaPruning on a V100. We keep its remove-then-merge pipeline and its self-distillation fine-tuning. We replace its selection signal, which is task loss on classification, with the spectral residual score, and we move the setting to restoration, where that choice matters. RePaViT takes a different route. It lets a fixed 75% of feed-forward channels skip the activation so that those channels can be merged, which gives large speedups on ViT-Large. It also reports the result that most constrains us: on DeiT-Tiny, accuracy falls from 72.1% to 64.2%. Small restoration networks are exactly the NTIRE-scale regime, so a naive channel-idle scheme is a real risk here, and we treat RePaViT's fixed ratio as a baseline rather than a design to copy. Double-Win NAS avoids the issue by searching only over collapsible linear blocks. RMNet and To Fold or Not to Fold settle when residuals and batch normalization can be folded exactly. We use those results to guarantee that our merges are exact once activations are gone.

The spectral side supplies the loss and motivates the diagnosis. Focal Frequency Loss shows that pixel losses neglect hard high-frequency coordinates. It adds a dynamically weighted Fourier loss, reporting a StyleGAN2 CelebA-HQ FID improvement from 5.696 to 4.972 at about 0.003 s per iteration of overhead in pix2pix. Coloring the Noise argues for Sobolev weighting over isotropic losses. Both use spectral losses to train fixed architectures. Neither asks whether the architecture still has the nonlinear capacity to produce the frequencies the loss asks for, and that question is ours.

The closest cross-over work leaves our question open. CFDP scores channels by the DCT energy of their feature maps and prunes them on classification networks. It never removes activations or merges layers, and it uses frequency only as a post-hoc ranking, not as a statement about what linear operators cannot do. The NTIRE 2025 Efficient Super-Resolution Challenge Report shows that top entries already merge multi-branch linear convolutions, such as the winning team's SConvLB, and train with spatial and distillation losses. None of them removes activations. Restormer keeps nonlinear gating in every feed-forward block and is our target for testing the idea on a transformer.

Research Program

The first stage is diagnostic. We take a trained compact super-resolution network in the style of NTIRE 2025 entries and a small Restormer. For every activation we compute $S(\sigma)$ on DIV2K/LSDIR calibration crops. We then remove each activation one at a time, without retraining, and measure the damage in radial frequency bands of the output. The diagnostic succeeds if $S$ predicts high-band damage much better than two alternatives: the unweighted linear residual, and the change in pixel L1 error. It is also informative if the spatial-error ranking and the spectral ranking disagree most on the activations nearest the upsampling layer, which is where we expect frequency generation to concentrate.

The second stage builds the method. We greedily remove activations in order of increasing $S$ until a latency target is met, measured with the NTIRE protocol on an RTX A6000. The freed linear chains are merged exactly. Merging can widen a layer: a 1×1–3×3–1×1 chain becomes a dense 3×3 whose width is set by the outer channels. We therefore report actual runtime and not assume speedups. The collapsed network is fine-tuned with L1 plus a Sobolev-weighted Fourier loss, with self-distillation from the uncollapsed network as in DepthShrinker. The whole selection costs one calibration pass per activation, far cheaper than a differentiable mask search. For Restormer we apply the score at the level of channel groups inside the gated feed-forward block. This gives a data-driven alternative to RePaViT's fixed 75% ratio.

The third stage runs the denoising control on SIDD with the same backbones and procedure. It tests the predicted asymmetry between super-resolution and denoising.

Baselines

The naive reference is the uncollapsed network trained with L1. It sets the quality ceiling and the latency floor we try to beat. We also include the same network collapsed by removing activations at random up to the same latency, which shows how much any selection rule matters at all.

The strongest existing method on the efficiency axis is the NTIRE 2025 recipe: multi-branch linear reparameterization in the SConvLB style, trained with spatial and distillation losses, with all activations kept. The report gives the fidelity constraint as at least 26.90 dB PSNR on DIV2K_LSDIR_valid and at least 26.99 dB on the test split. The fastest runtime reported is 8.62 ms, for ShannonLab on an RTX A6000. The file has no reported per-team PSNR for the winning entry. We therefore retrain an SConvLB-style model under our data and schedule and do not quote a figure. Beating it means meeting the 26.90 dB constraint at lower measured A6000 runtime, or matching its runtime with lower high-band spectral error and Log-Spectral Distance.

The strongest existing activation-removal method is DepthShrinker's differentiable mask search, ported to the same backbone. It is trained with L1 and self-distillation, with the same number of search and fine-tuning epochs, the same data and the same hyperparameter sweep budget as our method. For the Restormer experiments, RePaViT's fixed-ratio channel idling at the same latency is the corresponding baseline. No super-resolution or restoration numbers for either method appear on Lacuna. The only file numbers are classification results: DepthShrinker's +3.06% over MetaPruning and RePaViT's DeiT-Tiny drop from 72.1% to 64.2%.

The key ablation separates selection from supervision. It crosses two selection rules (spatial versus spectral score) with two fine-tuning losses (L1 versus L1 plus Sobolev Fourier loss), all at a matched latency. If our claim holds, the spectral selection with Fourier fine-tuning cell beats the spatial selection with Fourier fine-tuning cell on high-band error. A further ablation drops the Sobolev weight from $S$ to check that the high-frequency emphasis in the score is doing the work.

Why not just…?

Why not just run DepthShrinker's search with pixel loss and fine-tune the result with Focal Frequency Loss? This is the most serious threat. If a frequency loss applied during fine-tuning can re-grow the lost texture through the activations that remain, the selection rule adds nothing. Our argument says it cannot fully do so. Once a merged block is linear, no loss can make it generate new frequencies, so which blocks stay nonlinear should limit what fine-tuning can recover. The 2×2 ablation above settles this directly. If the spatial-selection plus Fourier-fine-tuning cell matches ours within noise, we will report that the contribution is the diagnosis rather than the method.

Why not just keep all activations and use the NTIRE-style linear branch merging? That approach is fast already. But its merging cannot cross activations, so the network keeps its full sequential depth at inference. DepthShrinker's profiling shows that on GPUs, sequences of thin convolutions run far slower than their FLOP count suggests, with block latency cut by up to 88.2% after collapse on an RTX 2080Ti. Whether that advantage carries over to super-resolution backbones is an open empirical question. The latency comparison against our retrained SConvLB baseline answers it.

Why not just prune channels with a frequency-aware score, as CFDP does, and train with a spectral loss? Channel pruning makes layers narrower but keeps the thin sequential structure that DepthShrinker found to be hardware-inefficient compared with collapsing. CFDP's own evidence is limited to classification: 57.2% fewer FLOPs on GoogLeNet/CIFAR-10 and 60% of FLOPs on ResNet-50/ImageNet. We include CFDP-style channel pruning with Fourier fine-tuning at matched A6000 latency. If it wins, activation removal is the wrong axis for restoration, and we will say so.

Why not just use a perceptual loss instead of a spectral one? Perceptual losses might recover texture by a different route. However, FFL reports that models trained with perceptual and adversarial losses still show spectral discrepancies and periodic artifacts, and a perceptual loss would give no per-activation signal comparable to $S$. We add a VGG-perceptual fine-tuning arm as a secondary control.

Proposed Experiments

Training uses DIV2K and LSDIR for ×4 super-resolution. Evaluation follows the NTIRE protocol on DIV2K_LSDIR_valid and test, with runtime measured on an RTX A6000 and repeated on one embedded GPU, because gains from dense collapsed operators are known not to transfer evenly to edge hardware. Real-sensor generalization is checked on RealSR and DRealSR, and denoising on SIDD with a small Restormer. Metrics are PSNR and SSIM for the fidelity constraint, LPIPS, Log-Spectral Distance, and error per radial frequency band, which is the metric the claim is actually about.

Three checks decide the proposal. First, $S$ must predict high-band damage from single-activation removal better than pixel-error change does, with the difference quantified as rank correlation across all activations in both backbones. Second, at matched A6000 latency, spectral selection must beat spatial selection on high-band error while both are fine-tuned with the same Fourier loss, and the result must pass the 26.90 dB constraint. Third, the advantage of spectral selection must shrink markedly on SIDD denoising compared with super-resolution, as the frequency-generation account predicts. Passing all three would show that activations in restoration networks should be removed according to what they generate, not according to how much pixel error they explain. Failing the second while passing the first would still be a useful negative result: frequency losses at fine-tuning time would be enough, and removal criteria for restoration would not need to change.