# Invertible Diffusion Models for Compressed Sensing

Invertible diffusion models make end-to-end compressed sensing reconstruction practical

Bin Chen, Zhenyu Zhang, Weiqi Li, Chen Zhao, Jiwen Yu, Shijie Zhao and 2 more · arXiv · 2024-3-25

- **Problem** Learned compressed sensing networks must be trained from scratch, and diffusion-based reconstructors reuse noise estimators trained for one step only. Fine-tuning the whole multi-step sampler end-to-end was too memory-intensive to attempt.
- **Method** IDM fine-tunes a multi-step DDNM-style diffusion sampler end-to-end to recover images directly from measurements. It makes the sampling steps and the U-Net invertible, so intermediate features are cleared during training.
- **Results** IDM outperforms existing state-of-the-art CS networks by up to 2.64 dB in PSNR. It reduces GPU memory use by up to 93.8 percent.

## Why one-step noise estimators hold CS back

Learned CS networks usually have to be designed and trained from scratch, which takes time and often lands on weaker results. Diffusion-based reconstructors avoid part of that cost by reusing generative priors from pre-trained models. But their noise estimators are trained for one step of noise prediction, not for the whole path from measurement to image.

Fig. 1 (b) shows that these estimators lack awareness of the entire recovery process, which reduces their adaptability to CS. The authors call this a task shift, since the deep features aren't necessarily tuned to map y to x. Such solvers also often need between 10 and 1000 iterations to give good results.

DDNM is a training-free recovery method that reuses a pre-trained noise estimator, so it inherits this task shift. Its three DDIM substeps estimate the clean image, enforce measurement consistency, and take a deterministic sampling step. Training the whole diffusion sampler end-to-end would close that gap by fitting the DDNM steps directly to the mapping from y to x.

Non-invertible training caches every intermediate feature, so memory grows with the number of sampling steps. A T=3 sampler built on the SD v1.5 U-Net couldn't be trained directly on four 80GB A100 GPUs.

IDM answers this with a two-level invertible design that clears most intermediate features during the forward pass. The first level wires the sampling steps together, so each step recomputes its inputs during back-propagation. Together these changes reduce GPU memory by up to 93.8%, which makes end-to-end fine-tuning practical.

## Training a DDNM sampler as the network

IDM treats a DDNM sampler as a trainable network rather than a fixed solver. DDNM is a training-free recovery method that iterates three DDIM sub-steps. The first sub-step estimates the clean image from the current noisy state and the noise estimate, using the equation for x̂0\|t. The second sub-step enforces measurement consistency with the pseudo-inverse A†, giving x̄0\|t = A†y + (IN − A†A)x̂0\|t.

The third sub-step is a deterministic DDIM update that produces x̂t−1 from x̄0\|t and the noise estimate.

The paper stacks T such sampling steps into a T-layer network F = F1 ◦ F2 ◦ · · · FT. IDM fine-tunes both the diffusion parameters {αt} and the pre-trained weights of ϵΘ, so the features are tuned for the CS task. The training loss is an L1 distance between the output x̂ = x̂0 and the ground truth x, with L(x̂, x) = (1/N)‖x̂ − x‖1. Fine-tuning used T = 3 and a batch size of 32 for 50000 iterations, with a starting learning rate of 0.0001.

The authors argue that this end-to-end setup lets the whole recovery process adapt to CS, not only the noise estimation.

The sampler doesn't start from random noise, because the authors set the initial estimate to a scaled back-projection. The initial estimate is x̂T = √ᾱT A†y, where A†y is the minimum-norm least-squares solution. In the ablation, changing only this start back to random noise costs 1.74 dB of PSNR. That drop suggests the deterministic start matters most when the sampler has only a few steps.

## Making the sampler and U-Net invertible

The wiring step starts by adding connections between consecutive DDNM sampling steps, so each step's input can be recovered from its output. Each connection carries the input of one step into a later step, weighted by two learnable scalars u\_t and v\_t with u\_t + v\_t = 1. The forward pass computes the output of a wired layer as u\_t times F\_t plus v\_t times h\_t, and passes the input on as h\_t-1.

The inverse pass recovers the input as x\_t = h\_t-1, and rebuilds h\_t from the next output minus u\_t times F\_t, divided by v\_t.

During back-propagation, the method recalculates each layer's inputs and features from its outputs, then clears them while moving from step t back to step t+1. The authors state that cached memory drops from linear complexity O(T) to constant complexity O(1) once the step count and the noise estimator architecture are fixed. Figure 3 shows the cached and cleared features in the original forward pass, the wired forward pass, and the wired backward pass.

The authors point out that the wiring works for arbitrary diffusion models and solvers, and that it reuses the pre-trained weights of the noise estimator.

![Figure 3: Illustration of our wiring technique, exemplified with three diffusion sampling steps and a three-scale noise estimation U- Net. Here, light-colored…](https://refivu.com/papers/6aec800a-0663-470f-a512-df85b2b5c826/figures/figure-6ffec69a23f549db2dff72859af718b6.png?thumb=512)

**Fig. 3** . Illustration of our wiring technique, exemplified with three diffusion sampling steps and a three-scale noise estimation U- Net. Here, light-colored rectangles with diagonal dashed lines represent images/features that are cleared, while dark-colored, empty rectangles indicate images/features that must be preserved. (a) The original non- invertible forward pass caches all inputs, features, and outputs, causing memory usage to increase linearly with the step number. (b) We add connections to construct invertible layers, reducing memory usage to a constant level. (c) During back-propagation, the necessary intermediate inputs/features are sequentially recomputed and cleared to obtain gra- dients from the last to the first step. Our wired sampling framework is equivalent to the original setup in (a) when ut = 1 and vt = 0.

[Original paper](https://arxiv.org/abs/2403.17006v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Bin Chen, Zhenyu Zhang, Weiqi Li, Chen Zhao, Jiwen Yu, Shijie Zhao, Jie Chen, Jian Zhang · Invertible Diffusion Models for Compressed Sensing · Original paper figure · Extracted the figure area from page 4 of the original PDF.

The second level applies the same idea inside each step's noise estimator, which is a U-Net with memory-intensive residual and attention blocks. Consecutive transformation blocks in each down- and up-sampling block are grouped and wired together. During training, all inputs and intermediate activations of these grouped blocks are cleared, while only the first and last convolutions and the skip branches keep their features.

The authors say this second-level design further reduces memory usage and makes IDM training feasible on standard consumer-grade GPUs.

Across both levels, IDM reduces fine-tuning memory by up to 93.8% (about 15/16) at T=12. Without invertibility, a non-invertible variant at T=3, batch size 32 and patch size 256 can't fit on 4 A100 GPUs, and its maximum batch size is 184 with invertibility versus 20 without. The two-level invertible models keep the peak memory per GPU at 14.64GB, while the non-invertible variant with batch size 20 reaches 70.08GB.

## Injecting measurements into the noise estimator

Feeding the measurement only at the input layer of each step can lose it, because A and y are hard to keep in deep features. The authors say that simply appending the measurement at the input, as in SR3, can give unsatisfactory results. Using the physics only to initialize the image and in the RND step limits quality in complex scenes, so the authors inject it directly into the layers.

The injectors sit behind every grouped block of the noise estimation U-Net, so each block sees the measurement again.

An injector takes an intermediate feature F\_in of size (H/r)×(W/r)×C and maps it to an image-domain map f with Conv1 and a pixel shuffle. It concatenates f, A†Af and A†y into a three-channel tensor, which Conv2 then processes before a pixel unshuffle returns the result to feature size. The output is a residual sum, so the injector adds measurement information without replacing the original feature.

Both convolutions are 3 × 3, and the pixel shuffle and unshuffle layers use scaling ratio r.

![Figure 4: Illustration of our modified noise estimation U-Net ϵΘ for image CS reconstruction tasks, based on the SD v1.5 models \[35\], \[36\]. (a) Injectors are a…](https://refivu.com/papers/6aec800a-0663-470f-a512-df85b2b5c826/figures/figure-6d3dc2a70fdfd0820b29d0131aa18e64.png?thumb=512)

**Fig. 4** . Illustration of our modified noise estimation U-Net ϵΘ for image CS reconstruction tasks, based on the SD v1.5 models \[35\], \[36\]. (a) Injectors are added behind each residual and attention block and grouped within downsampling, upsampling, and middle blocks (marked as DB, UB, and MB) for invertibility. Our method is orthogonal to and compatible with network pruning \[71\] for enhanced efficiency.(b) Each injector learns to fuse measurement physics {y, A} into deep features using convolutions and residual connections.

[Original paper](https://arxiv.org/abs/2403.17006v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

Figure 4 shows the injectors in the modified U-Net, placed behind the residual and attention blocks. The injectors are grouped with the downsampling, upsampling and middle blocks, so the second-level wiring keeps them invertible. The injectors are jointly wired and learned inside each block group, so the measurement pathways train with the features.

Injector modules are orthogonal to pruning, which the authors apply to the same U-Net.

## Results against end-to-end CS networks

IDM with T = 3 was compared against twenty end-to-end learned CS networks on the luminance component of test images. Table 1 reports average PSNR at CS ratios of 10%, 30% and 50% on Set11, CBSD68, Urban100 and DIV2K. Across the four benchmark sets, IDM exceeds PRL-PGD+ by average PSNR margins of 0.96dB on Set11, 1.22dB on CBSD68, 2.14dB on Urban100 and 0.48dB on DIV2K.

The authors trained on randomly cropped 256 × 256 patches of the Waterloo exploration database, using block-based Gaussian matrices with a 32 × 32 block size.

The authors call the gains on CBSD68 and Urban100 generally statistically significant, because those sets contain more test images. Baseline numbers come from original publications, or from the authors' own hyperparameter tuning and re-training. Where a replicable algorithm was unavailable, the table marks the missing cell with a dash.

Visually, IDM recovers sharper building edges and windows in the Figure 5 comparison, where competing CS networks produce oversmoothed textures. In Figure 7, IDM renders the garment with more detail and keeps the strips around the parrot's eye free of artifacts. On RGB images in Table 2, IDM outperforms the second-best contenders by an average of 7.27dB in PSNR and 0.1652 in SSIM.

## Results against diffusion-based methods

On RGB Urban100 at a 10% ratio, IDM scores 30.85 dB PSNR, while DDNM scores 20.76 dB. IDM reaches an SSIM of 0.8970, compared to 0.4682 for DDNM at the same ratio. The gap narrows at higher ratios, but IDM still leads DDNM at 50% on Urban100 with 39.16 dB against 32.86 dB.

Perceptual quality is measured with FID and LPIPS in Table 3, where lower values are better. On Urban100 at 10%, IDM gets an FID of 42.72, while DDNM gets 212.84. Across Urban100 and DIV2K, the authors report 15 to 127 lower FID and 0.04 to 0.22 lower LPIPS than the compared diffusion-based methods. They attribute these gaps to generative priors that lose data fidelity and to noise estimation networks that aren't adapted to CS.

In Figure 6, DDNM and GDP produce noise-like artifacts in the sky and window regions, while IDM avoids them.

Speed is measured on a 256 by 256 RGB image on an NVIDIA A100 GPU, as listed in Table 4. IDM takes 0.63 s per image, while DDNM takes 9.16 s and PSLD takes 233.10 s. The authors state that IDM is up to 14.54 times faster than DDNM. IDM uses 3 neural function evaluations, whereas the competing methods need at least 100. The authors also note that SR3 needs 240 hours and 75GB of memory per GPU for training, while IDM needs 76 hours and 15GB.

## What each component contributes to IDM

Variant (1) is the DDNM baseline on the SD backbone, and variant (9) is the full IDM model. Comparing (1) with (9), the authors report a 5.91dB PSNR gain on average over Urban100 and DIV2K at γ = 10%. That gain comes with a 98% cut in training time and a storage size reduced by 88%. The full model needs 8.0 hours of fine-tuning and 4.9GB of GPU memory, against 417.3 hours for variant (1).

The injectors are the cheapest component in the ablation, so their gain stands out. Comparing (6) with (7), injectors improve PSNR by 2.10 to 3.01dB. They need only an extra 1.9 hours of training and a marginal (0.005T)% or (0.006T)M increase in parameters. Two-level invertibility works differently: it cuts memory, but it costs time. The authors offset that time cost by reusing pre-trained weights, which yields 0.17 to 1.42dB PSNR improvements and cuts training time by 90.3 to 97.0%.

The authors also test the wiring and injectors on two other CS networks, RK-CCSNet and CSNet+, on Set11 at γ = 50%. For RK-CCSNet, the invertible design cuts training memory by 53.8%, from 1.3GB to 0.6GB, with the parameter number unchanged. For CSNet+, the invertible design cuts memory usage by 40.5%. Applying both components jointly reaches 38.95dB for RK-CCSNet and 39.77dB for CSNet+ in PSNR.

The authors didn't test these two networks on the RGB benchmarks used for IDM itself.

## Transfer to an unseen CS ratio

The question is whether one IDM model can handle a CS ratio it never saw during training. Most natural image CS work trains a separate model for each ratio, and IDM follows that common practice. To test transfer, the authors trained IDM at a 30% ratio and evaluated it at a 50% ratio. They compared this against PRL-PGD+, the previous best end-to-end learned CS network.

On Set11, the IDM trained at 30% reaches 41.60 dB on the unseen 50% ratio. That result is slightly below the 42.48 dB of IDM trained specifically at 50%. PRL-PGD+ scores 28.85 dB on the same unseen 50% ratio, so IDM leads by 12.75 dB. The authors read this as a strong degree of generalization to unseen CS ratios.

This is one comparison on Set11, and it rests on a single unseen ratio pair. The paper still trains a separate model for each ratio as the usual practice.

## Limitations of IDM: determinism, training cost and open scope

The first constraint is the cost of training, because enabling invertibility roughly doubles training time. Intermediate features are recomputed during back-propagation, so the saving in memory is paid for with extra computation. The authors reduce that cost by reusing pre-trained model weights, which they say yields 0.17 to 1.42dB PSNR improvements.

Reuse also cuts training time by 90.3 to 97.0%, so an unpruned IDM can be trained within one day.

The second constraint concerns theory: IDM is deterministic and uses a limited number of sampling steps. Because of this, the authors say IDM may not strictly align with solving SDEs or ODEs via posterior sampling. Instead, they describe IDM as an iterative reconstruction model optimized specifically for image CS. They justify this choice by practical gains in performance and efficiency rather than by the posterior-sampling theory.

The reported experiments train a separate model for each CS ratio, which the authors describe as the common practice. Their ratio-transfer test is a single comparison on Set11, where a 30% model was applied to an unseen 50% ratio. The speed numbers come from one NVIDIA A100 GPU and 256 × 256 RGB images. The paper doesn't report speed on other GPUs or image sizes in these tables.

## Paper info

- **Authors**: Bin Chen, Zhenyu Zhang, Weiqi Li, Chen Zhao, Jiwen Yu, Shijie Zhao, Jie Chen, Jian Zhang
- **Venue**: arXiv · Preprint
- **First published**: 2024-3-25
- **Added**: 2026-11-6
- **Updated**: 2025-2-3
- **Version**: v2
- **arXiv**: 2403.17006
- **Category**: cs.CV
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2403.17006v2) · [PDF ↗](https://arxiv.org/pdf/2403.17006v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

While deep neural networks (NN) significantly advance image compressed sensing (CS) by improving reconstruction quality, the necessity of training current CS NNs from scratch constrains their effectiveness and hampers rapid deployment. Although recent methods utilize pre-trained diffusion models for image reconstruction, they struggle with slow inference and restricted adaptability to CS. To tackle these challenges, this paper proposes Invertible Diffusion Models (IDM), a novel efficient, end-to-end diffusion-based CS method. IDM repurposes a large-scale diffusion sampling process as a reconstruction model, and fine-tunes it end-to-end to recover original images directly from CS measurements, moving beyond the traditional paradigm of one-step noise estimation learning. To enable such memory-intensive end-to-end fine-tuning, we propose a novel two-level invertible design to transform both (1) multi-step sampling process and (2) noise estimation U-Net in each step into invertible networks. As a result, most intermediate features are cleared during training to reduce up to 93.8% GPU memory. In addition, we develop a set of lightweight modules to inject measurements into noise estimator to further facilitate reconstruction. Experiments demonstrate that IDM outperforms existing state-of-the-art CS networks by up to 2.64dB in PSNR. Compared to the recent diffusion-based approach DDNM, our IDM achieves up to 10.09dB PSNR gain and 14.54 times faster inference. Code is available at https://github.com/Guaishou74851/IDM.

## Quote from the paper

Bin Chen, Zhenyu Zhang, Weiqi Li, Chen Zhao, Jiwen Yu, Shijie Zhao, Jie Chen, Jian Zhang (2024). Invertible Diffusion Models for Compressed Sensing. arXiv:2403.17006v2. https://arxiv.org/abs/2403.17006v2

**BibTeX**

```
@misc{chen2024invertible,
  title = {{Invertible Diffusion Models for Compressed Sensing}},
  author = {Bin Chen and Zhenyu Zhang and Weiqi Li and Chen Zhao and Jiwen Yu and Shijie Zhao and Jie Chen and Jian Zhang},
  year = {2024},
  eprint = {2403.17006},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.17006v2}
}
```

## Related papers

- [Reconciling European Electricity Data with Diffusion Priors Learned from Observations Alone](https://refivu.com/en/papers/9b64e54c-076c-496c-9236-8744425c1c5a-reconciling-european-electricity-data-with-diffusion-priors.md)
- [Residual Dense Network for Image Super-Resolution](https://refivu.com/en/papers/01bf3f14-f3f5-49d6-9844-02a897713390-residual-dense-network-for-image-super-resolution.md)
- [SwinIR: Image Restoration Using Swin Transformer](https://refivu.com/en/papers/16285f4a-51a3-41dc-9740-c5a9259d2b18-swinir-image-restoration-using-swin-transformer.md)
- [Restormer: Efficient Transformer for High-Resolution Image Restoration](https://refivu.com/en/papers/df4b04d0-730a-42b5-952f-56ce280f457e-restormer-efficient-transformer-for-high-resolution-image.md)
- [MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model](https://refivu.com/en/papers/d7e4c79d-ac46-4e0f-aef6-34e570d43e2f-magicanimate-temporally-consistent-human-image-animation.md)
- [Image Super-Resolution via Iterative Refinement](https://refivu.com/en/papers/3eef3bfb-00fb-4f8e-9c82-8b12a576f54c-image-super-resolution-via-iterative-refinement.md)

## Other paper commentary

- [Fast-GANFIT: Generative Adversarial Network for High Fidelity 3D Face Reconstruction](https://refivu.com/en/papers/f7e4dd6d-1545-4e0e-bedc-1b05afe076ef-fast-ganfit-generative-adversarial-network-for-high-fidelity.md)
- [Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions](https://refivu.com/en/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4-train-for-the-worst-plan-for-the-best.md)
- [Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow](https://refivu.com/en/papers/a0c4439d-88d7-4d0f-be30-5509d158003e-flow-straight-and-fast-learning-to-generate-and.md)
- [Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding](https://refivu.com/en/papers/eaa0c3ba-e0e4-4517-8ef7-d6ec6ba261b6-photorealistic-text-to-image-diffusion-models-with-deep.md)
- [Consistency Models](https://refivu.com/en/papers/f97e5129-1522-4b93-9b60-0a1f3af22d42-consistency-models.md)
- [Ultra-fine Entity Typing with Indirect Supervision from Natural Language Inference](https://refivu.com/en/papers/ec3b192e-6258-46de-ab68-df02723dc86f-ultra-fine-entity-typing-with-indirect-supervision-from.md)
- [One Metric to Measure them All: Localisation Recall Precision (LRP) for Evaluating Visual Detection Tasks](https://refivu.com/en/papers/e8473a0a-98be-40cc-858d-b86eef9c3ff5-one-metric-to-measure-them-all-localisation-recall.md)
- [One-step regression and classification with crosspoint resistive memory arrays](https://refivu.com/en/papers/3d9de6a9-144e-4dd9-bf46-2e45035031ef-one-step-regression-and-classification-with-crosspoint.md)
- [Spectral Bias and Task-Model Alignment Explain Generalization in Kernel Regression and Infinitely Wide Neural Networks](https://refivu.com/en/papers/0dfeefcb-6d9e-459c-9bec-7d099df6b4b6-spectral-bias-and-task-model-alignment-explain.md)
- [ROAD: The ROad event Awareness Dataset for Autonomous Driving](https://refivu.com/en/papers/01e6bd29-da3b-4a4b-a7bd-d94b12442017-road-the-road-event-awareness-dataset-for-autonomous.md)
- [LPAC: Learnable Perception-Action-Communication Loops with Applications to Coverage Control](https://refivu.com/en/papers/c2b80a60-dd94-4389-b898-b6edeb33088f-lpac-learnable-perception-action-communication-loops-with.md)
- [Reinventing 2D Convolutions for 3D Images](https://refivu.com/en/papers/6c574208-811f-453b-ad33-424db79250ce-reinventing-2d-convolutions-for-3d-images.md)

## Terms in this paper

- [SSIM](https://refivu.com/en/terms/a5c530b66e8d-ssim)
- [LPIPS](https://refivu.com/en/terms/21dda2beca88-lpips)
- [diffusion models](https://refivu.com/en/terms/39b044617fcd-diffusion-models)
- [DDIM](https://refivu.com/en/terms/6c24451d09a5-ddim)
- [DDPM](https://refivu.com/en/terms/f18692fc86b6-ddpm)
- [Urban100](https://refivu.com/en/terms/2ea226eb2e5e-urban100)
- [DIV2K](https://refivu.com/en/terms/ef8c4161aa33-div2k)
- [network pruning](https://refivu.com/en/terms/b21137ad83b0-network-pruning)
- [DDNM](https://refivu.com/en/terms/2ff4ebefc52c-ddnm)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/6aec800a-0663-470f-a512-df85b2b5c826-invertible-diffusion-models-for-compressed-sensing)
