Single-Pixel Pattern Optimisation for learning measurement patterns in single-pixel imaging, with a focus on biomedical reconstruction workflows.
spi.mp4
This project ships an environment file: environment.yml.
First, clone the repository and navigate to the project directory:
git clone https://github.com/CrisSherban/sppo
cd sppoThen create the environment and activate it using either Conda or Mamba:
conda env create -f environment.yml
conda activate sppoShow training CLI options:
python sppo/bilevel_patterns.py --helpRun a small training example:
python sppo/bilevel_patterns.py --n_epochs 1 --train_size 100 --batch_size 16 --num_patterns 64The pattern-learning procedure is written as the bilevel program:
subject to
In this repository:
-
$sign(Z)$ gives binary sensing patterns from the learnable real-valued matrix$Z$ . -
$\alpha$ is the regularisation weight in the reconstruction objective. -
$J(x)$ is the image regulariser (for example TDV in the provided experiments). - The lower-level argmin is solved approximately with a finite iterative solver (e.g. nmAPG), and gradients are propagated through that approximation (with STE for the sign operation).
