YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Reconstruct Anything Model (RAM)
A non-iterative, lightweight foundational model for computational imaging.
Matthieu Terris, Samuel Hurault, Maxime Song, JuliΓ‘n Tachella
π₯ News: Introducing RAM 2!
π RAM 2 is here! We've continued developing the Reconstruct Anything Model at Blur Labs and released RAM 2, our next-generation foundation model for computational imaging.
RAM 2 delivers significantly improved reconstruction quality, faster inference, and stronger generalization across imaging modalities β including MRI, CT, PET, microscopy, photography, and more β without task-specific retraining.
π Explore RAM 2: Results & Demos | GitHub: Code & Pretrained Weights | Blur Labs
π₯ RAM 2 is available as an open-source 2D model. We've also developed 3D reconstruction models for medical and industrial imaging. Get in touch with Blur Labs to learn more.
This repository contains the original RAM (RAM 1), published at ICLR 2026. For the latest model, please visit the RAM 2 repository.
RAM 1 Overview
The Reconstruct Anything Model (RAM) is a single, non-iterative neural network architecture designed to solve a wide range of imaging inverse problems β including denoising, deblurring, inpainting, MRI, CT, and super-resolution β without task-specific tuning or retraining.
RAM builds upon DRUNet and introduces several key innovations:
- Proximal Estimation Module for robust initialization using a learned proximal operator.
- Krylov Subspace Module (KSM) to inject physics-based priors via learned combinations of gradient and adjoint terms.
- Multiscale Operator Conditioning that allows solving ill-posed problems efficiently on coarser grids.
- Noise Conditioning using Poisson-Gaussian models for real-world robustness.
- Modality-Aware Layers supporting grayscale, color, and complex-valued inputs with shared weights.
Visual Demo
Explore our interactive web demo here:
π RAM Project Page
HuggingFace Real-Time Demo
Explore our hugging face demo here:
π RAM Hugging Face Space
Applications
RAM supports many tasks out-of-the-box or with few-shot self-supervised fine-tuning, such as:
- Low-light imaging (Poisson noise)
- Medical imaging (MRI, CT)
- Microscopy
- Super-resolution
- Compressed sensing
- Deblurring (motion, Gaussian)
- Inpainting
- Demosaicing
- General inverse problems with known physics
Installation
pip install git+https://github.com/matthieutrs/ram
Usage
See the demo scripts in ram/demo for more details! You can also run this script in Google Colab.
Inference with pretrained weights
from ram import RAM
import deepinv as dinv
# run on GPU
device = 'cuda'
# Load the pretrained model
model = RAM(device=device)
# load image
x = dinv.utils.load_url_image(url=dinv.utils.get_image_url("butterfly.png"), img_size=256).to(device)
# create forward operator
physics = dinv.physics.Inpainting(tensor_size=(3, 256, 256), mask=.3, noise_model=dinv.physics.GaussianNoise(.05), device=device)
# generate measurement
y = physics(x)
# run inference
with torch.no_grad():
x_hat = model(y, physics=physics)
# compute PSNR
in_psnr = dinv.metric.PSNR()(x, y).item()
out_psnr = dinv.metric.PSNR()(x, x_hat).item()
# plot
dinv.utils.plot([x, y, x_hat], ["Original", "Measurement\n PSNR = {:.2f}dB".format(in_psnr), "Reconstruction\n PSNR = {:.2f}dB".format(out_psnr)])
Paper
If you use RAM in your work, please cite:
@article{terris2025ram,
title={Reconstruct Anything Model: a lightweight foundational model for computational imaging},
author={Terris, Matthieu and Hurault, Samuel and Song, Maxime and Tachella, JuliΓ‘n},
journal={arXiv preprint arXiv:2503.08915},
year={2025}
}
- Downloads last month
- 12