Designing a computational imaging system -- selecting operators, setting parameters, validating consistency -- requires weeks of specialist effort per modality, creating an expertise bottleneck that excludes the broader scientific community from prototyping imaging instruments. We introduce spec.md, a structured specification format, and three autonomous agents -- Plan, Judge, and Execute -- that translate a one-sentence natural-language description into a validated forward model with bounded reconstruction error. A design-to-real error theorem decomposes total reconstruction error into five independently bounded terms, each linked to a corrective action. On 6 real-data modalities spanning all 5 carrier families, the automated pipeline matches expert-library quality (98.1 +/- 4.2%). Ten novel designs -- composing primitives into chains from 3D to 5D -- demonstrate compositional reach beyond any single-modality tool.
Figures & tables
Figure 1: Specification-driven design pipeline. A natural-language prompt is the sole user input. AP generates a spec.md ; AJ validates in three sequential stages: (1) structural compilation (6 checks C1–C6), (2) Triad gate evaluation [ 3 ] ( G1 – G3 ), (3) cost and feasibility assessment. Two feedback paths handle failures: an automatic inner loop ( AP↔AJ , up to 3 rounds, dashed red) for structural/parametric corrections, and an outer loop (dashed blue) returning diagnostics to the user when automatic repair is exhausted. AE executes reconstruction and outputs A^ with an explicit ε -bound report.
Figure 2: The spec.md specification format. Eight mandatory fields fully determine an imaging system design. Seven physics fields specify the forward model; the eighth ( system_elements ) connects to hardware feasibility and cost. Three examples span X-ray (CT), optical (CASSI), and spin (MRI) carriers. Each forward_model field is a primitive chain over the 11 FPB operators.
Modality
Chain
Carrier
PSNR (dB)
ρtime
ρrecov
Data
X-ray
CT
Π→D
X-ray
24.8±2.4
420
∼ 1.0
Real
Optical photons
CASSI
M→W→Σ→D
Photon
24.3±1.5
310
0.85
Real
CACTI
M→Σ→D
Photon
30.2±1.1
300
∼ 1.0
Real
OCT
P+P→Σ→D
Photon
30.5±1.1
290
0.86
Synth.
Table 1: Cross-modality validation (22 of 39 modalities), grouped by carrier family. ρrecov : 4-scenario recovery ratio [ 3 ] . 95% CIs via bootstrap ( n=1000 ). Bold = real measured data (challenging conditions: 60-view CT, 4-coil MRI); † = self-reference metric (no ground truth); ∗ = new system designs validated in the algorithm-comparison study (Extended Data Table 7 ). Φz denotes depth-parameterised convolution: C applied with a depth-dependent PSF Φ(z) ; it is the convolution primitive C , not a 12th element of the FPB.
Figure 3: Error decomposition by modality. Stacked bars show the relative contribution of each Theorem 1 error term for 6 representative modalities. For well-conditioned systems (CT, MRI, e-ptychography), parameter mismatch εparam dominates and is reducible by calibration. For scattering-dominated systems (DOT), unmodeled physics εunmod dominates and requires tier-lifting. εFPB<1% in all cases. εspec=εtrans=0 for 31/36 modalities; CASSI shows nonzero εtrans due to dispersion–accumulation chain ambiguity.
Figure 4: Design-to-real validation. (a) A natural-language prompt is translated into a structured spec.md by the Plan Agent. (b) The Judge Agent validates all gates and checks (3 Triad gates + 6 compiler checks), producing a certificate. (c) Reconstruction results on three real-data modalities with ground truth: CT ( 24.8 dB, FISTA-TV on LoDoPaB), MRI ( 31.7 dB, HybridCascade++ on M4Raw), and CASSI ( 24.3 dB, GAP-TV on KAIST TSA [ 6 ] ). (d) Quality ratio (agent/expert PSNR) across 6 real-data modalities spanning all 5 carrier families: mean 98.1±4.2 %; theorem tightness ratio τ∈[1.8,5.2] , median 2.9.
Configuration
Valid
≤ε
Redesign
Time
Dominant failure
Full ( AP+AJ+AE )
12/12
12/12
1.7 ± 0.6
4.8 min
—
No AJ
8.2/12
6.4/12
0
2.9 min
Invalid spec, unbounded ε
No AE
12/12
9.6/12
1.7 ± 0.6
3.4 min
Suboptimal parameters
No AP (manual)
10.4/12
10.4/12
0
52 min
Human error (14%)
Template only
—
3/12
0
0.5 min
No coverage (75%)
Table 2: Ablation study (5 trials × 12 modalities = 300 runs). “Valid”: passes all compiler checks. “ ≤ε ”: reconstruction within Theorem 1 error bound. No single agent is dispensable.
PSNR (dB)
Setup
Modality
Agent
Expert
Agent
Expert
Quality
LoC
Established modalities ( 98.1±4.2 %)
CT (real)
24.8
24.0
25 min
7 d
103.3%
12 vs 340
MRI (real)
31.7
32.4
20 min
5 d
97.8%
14 vs 520
CASSI (real)
24.3
26.1
18 min
4 d
93.1%
11 vs 280
OCT
30.5
31.2
22 min
6 d
97.8%
13 vs 450
Table 3: Agent vs. established reconstruction methods. “Agent”: best-performing automated algorithm; “Expert”: established variational method (FISTA+TV [ 38 ] or GAP-TV). Bold = real measured data; ∗ = new system designs. For novel systems ( ∗ ), no system-specific expert baseline exists; “Expert” denotes the best generic variational method. Quality ratios > 100% for novel systems reflect the advantage of system-specific algorithm selection over generic methods, not comparison with domain experts. Established modalities: 98.1±4.2 %; novel systems: 114±10 % (vs. generic baselines). Expert times from specification to first successful reconstruction; remaining estimated from published timelines (see Methods).
Figure 5: Validation pyramid. Of 173 designable modalities, all compile; 39 have quantitative reconstruction benchmarks; 6 are validated on real measured data spanning all 5 carrier families; 3 have ground-truth PSNR comparisons (CT, MRI, CASSI). Each tier is a strict subset.
Tier
Physics
Validation
Example
0 (geometric)
Ray optics, transforms
Invertibility, adjoint
LiDAR
1 (Fourier)
Paraxial, angular spectrum
Parseval energy, adjoint
SIM, holography
2 (shift-variant)
Radon, k-space, Mie
Positivity, reciprocity, cost
CT, MRI
3 (full-physics)
FDTD, BPM, MC, NeRF
Agreement, uncertainty
DOT, NeRF
Table 4: Extended Data Table 1: Four-tier fidelity hierarchy. All 11 primitives are implemented at every tier.
Domain
Low tier
High tier
Correction
εunmod
εlift
DOT
Tier-2 (P 1 )
Tier-3 (P 3 RT)
Higher-order moments
7.8%
<10−12
Coherent
Tier-1 (ang. spec.)
Tier-3 (FDTD)
Evanescent + scatter
147%
<10−12
Table 5: Extended Data Table 2: Tier-lifting validation. Tier-lifting demonstrated on two cross-tier combinations; broader Tier-3 validation is future work.
Modality
Domain
Carrier
Tier
Chain
Status
Real?
Dom. ε
X-ray
CT
Medical
X-ray
1–2
Π→D
FV
Yes
εparam
CBCT
Medical
X-ray
2
Π→Λ→D
T
No
εparam
CT (polychromatic)
Medical
X-ray
2
Π→Λ→D
T
No
εunmod
Phase contrast
Medical
X-ray
1–2
Π→P→M→D
HO
No
εparam
DEXA
Medical
X-ray
2
M→Π→D
T
No
εparam
Table 6: Extended Data Table 3: Modality registry (39 validated canonical decompositions). Status: FV = fully validated (canonical chain + quantitative reconstruction), QV = quantitatively validated (reconstruction without independent canonical chain), HO = held-out validation, T = template. Φz : depth-parameterised C (see Table 1 ). An additional ∼ 134 modalities pass all compiler checks but lack per-modality reconstruction benchmarks; the full list is in the repository.
Figure 6: Extended Data Figure 2: Algorithm sensitivity by modality. (a) Inter-algorithm PSNR Coefficient of Variation (CoV) for the top-5 published reconstruction algorithms per modality. Well-conditioned systems (blue, CoV ≈ 3.5–6.2%) show tight convergence among the top algorithms. SIM shows moderate CoV (15.0%). Ill-conditioned compressive systems (red, CoV > 40%) show a wider spread, indicating greater sensitivity to algorithm selection. (b) Individual algorithm PSNR values (dots) with mean (horizontal bar) for each modality. Data from Extended Data Table 7 .
CT
MRI
Method
Algorithm
PSNR
Type
Algorithm
PSNR
M1
iRadonMAP
36.9
Deep Learning
HUMUS-Net
37.3
M2
FBPConvNet
38.5
Deep Learning
PromptMR+
39.9
M3
DuDoTrans
42.1
Transformer
ReconFormer
40.1
M4
Score-CT
43.0
Diffusion
E2E-VarNet
40.5
M5
LEARN
43.1
Deep Unrolling
PromptMR
41.5
Table 7: Extended Data Table 4: Algorithm-comparison study (5 published algorithms × 5 modalities). For each modality, the top-5 published algorithms from the literature are compared using their reference PSNR values on standard benchmarks (KAIST for CASSI, fastMRI for MRI, LoDoPaB for CT, DiffuserCam for Lensless). Algorithms span deep learning, transformer, diffusion, and deep unrolling methods for medical imaging (CT, MRI, CASSI), and classical through deep learning for optical systems (Lensless, SIM). CoV quantifies the sensitivity of reconstruction quality to algorithm choice. PSNR values in dB.
Figure 7: Extended Data Figure 1: Execute Agent calibration. Predicted vs. actual PSNR for 39 validated modalities. Shaded band: ±1.8 dB (overall MAE). Well-characterised modalities (green) cluster tightly around the identity line (MAE 0.9 dB); scattering-dominated modalities (red) show systematic under-prediction, reflecting unaccounted εunmod at lower tiers.