Skip to content

Conversation

@jscanvic
Copy link
Collaborator

@jscanvic jscanvic commented Dec 11, 2025

The library has all of the building blocks necessary to compute benchmarks on different imaging modalities. Yet, there is no standardized way to do that at the moment and we do not showcase it in the docs. The goal of this PR is to remedy that.

Plan

  • Create a module deepinv.benchmark for the benchmark-related code
  • Add standard benchmarks (Gaussian denoising, Super-Resolution)
  • Create a GitHub action to compute the benchmarks on a GPU
  • Add the benchmarks to the docs

Inspirations

TODO

  • Create a simple benchmark PoC for Gaussian denoising or super-resolution
  • Test multiple denoisers
  • Write the GitHub action

Copy link
Collaborator

@Andrewwango Andrewwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool idea @jscanvic !

Hello pandas, old friend...



benchmark = Benchmark()
models = [dinv.models.DRUNet(), dinv.models.Restormer()]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super cool!

however, is the benchmark conflating multiple things - arch, how-well-weights-are-pretrained, model size?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now it's a somewhat crude benchmark of the models featured out of the box in deepinv

dinv.physics.GaussianNoise(sigma=25 / 255, rng=rng)
).to(device)

psnr_fn = dinv.metric.PSNR(min_pixel=0.0, max_pixel=1.0).to(device)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to use modality-specific metrics e.g. our ERGAS etc. for spectral imaging benchmarks

x = x.mul(255.0).round().div(255.0).clamp(0.0, 1.0)

psnr = psnr_fn(x_hat, x).item()
psnrs.append(psnr)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use the AverageMeter we use in the trainer (utils/logger.py)

@jscanvic
Copy link
Collaborator Author

Thanks Andrew, I'll make the changes over there deepinv/benchmarks#1 (closing this)

@jscanvic jscanvic closed this Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants