# L1 Principle — Coded Aperture Snapshot Spectral Imaging (CASSI)

**ID:** `L1-003` · **Status:** ⊙ Testnet (genesis · founder-vetted) · **Difficulty:** Standard (δ = 3) · **Carrier:** Photon

> *Adapted from the canonical [cassi.md walkthrough](https://github.com/integritynoble/pwm/blob/main/papers/Proof-of-Solution/mine_example/cassi.md) — Principle #25 in the PWM registry. Triple-verified 2026-04-21 by physics / numerics / cross-domain verifiers.*

---

## 1. Introduction

**Coded Aperture Snapshot Spectral Imaging (CASSI)** captures a full **3-D hyperspectral cube** `f(x, y, λ) ∈ ℝ^{H × W × N_λ}` in a **single 2-D snapshot** `y(x, y)`. A binary aperture mask modulates the scene, a prism disperses each wavelength band by an axis-dependent shift, and the detector integrates the modulated and dispersed cube onto one 2-D image. Recovering the full cube from the snapshot is the inverse problem this principle defines.

CASSI is a textbook **compressive linear inverse problem**: the compression ratio is `N_λ : 1` (e.g. 28 : 1 for 28 spectral bands). Recovery is possible only because the underlying spectral cube is compressible — solvers exploit spectral smoothness and spatial sparsity through priors such as Total Variation, learned dictionaries, or deep unrolled networks.

The principle is **carrier = photon**, **noise = shot Poisson + read Gaussian**, and lives in the **3-D spectral** solution space.

## 2. Forward Model

Physical chain: **scene `f(x,y,λ)`** → broadcast mask across bands → element-wise modulate by binary mask `C` → spectral shear by prism (shift `a·λ` pixels) → spectral integration onto detector → **snapshot `y(x,y)`**.

```
y(x, y) = Σ_λ  C(x, y + a·λ)  ·  f(x, y + a·λ, λ)  +  n(x, y)
```

where:
- `C ∈ {0, 1}^{H × W}` is the binary coded aperture mask (fill factor ≈ 0.5);
- `a` is the dispersion slope in pixels per spectral band;
- `n` is Poisson shot noise plus Gaussian read noise;
- The detector record `y ∈ ℝ^{H × (W + a·N_λ)}` is a single 2-D image.

**Inverse problem:** recover `f ∈ ℝ^{H × W × N_λ}` from `y ∈ ℝ^{H × W'}` — underdetermined by the compression ratio.

### Operator DAG (`G = (V, A)`, |V| = 4, |A| = 3, n_c = 0)

| Primitive | Action | Equation |
|---|---|---|
| `L.broadcast.spectral` | Replicates the 2-D mask across spectral bands `C(x,y) → C(x,y,λ)` | `B_λ` |
| `L.diag.binary` | Hadamard product `C ⊙ f` — element-wise mask multiplication | `M ⊙` |
| `L.shear.spectral` | Prism dispersion `f(x,y,λ) → f(x, y + a·λ, λ)` | `S_λ` |
| `∫.spectral` | Detector sums all bands → collapses 3-D cube to 2-D snapshot | `Σ_λ` |

`L_DAG = (|V| − 1) + log₁₀(κ_sys / κ₀) + n_c = 3 + log₁₀(5000 / 1000) + 0 = **3.70**` (with κ₀ = 1000, κ_sys ≈ 5000).

## 3. Physics Fingerprint

| Property | Value |
|---|---|
| Domain | Compressive Imaging |
| Sub-domain | Hyperspectral snapshot |
| Carrier | photon |
| Sensing mechanism | coded_aperture |
| Integration axis | spectral |
| Problem class | linear_inverse |
| Noise model | shot_poisson |
| Solution space | 3D_spectral |
| Difficulty (δ) | 3 (standard) |

**Operator primitives:** `L.broadcast.spectral`, `L.diag.binary`, `L.shear.spectral`, `∫.spectral`.

This fingerprint is the immutable identity used for deduplication. Example distances: vs. DD-CASSI = 0.42 (*Related* — depth sensing variant) · vs. X-ray CT = 0.79 (*Distinct* — different carrier and DAG).

## 4. Well-Posedness Certificate (W)

| Property | Status | Notes |
|---|---|---|
| **Existence** | ✅ YES | Underdetermined but regularisable; compressive-sensing theory guarantees recovery when the mask satisfies RIP-like conditions |
| **Uniqueness** | ✅ YES (under sparsity prior) | Binary random mask at 50 % fill + spectral compressibility in wavelet/DCT basis |
| **Stability** | ⚠ Conditional on mask quality + calibration | Sub-operator κ ≈ 1 each. Compound κ_sys ≈ 5000. Effective κ_eff ≈ 50 (calibrated) → 200 (with mismatch). |

**Mismatch model** declares 5 Ω dimensions: `Φ_true = D(a₁, α) · T(dx, dy, θ) · Φ_nominal`, where `(dx, dy, θ)` is mask alignment and `(a₁, α)` is dispersion-slope / angle error.

## 5. Convergence / Error-Bounding (C)

- **Primary metric:** PSNR per channel · **Secondary:** SSIM, SAM° · **Tertiary:** residual_norm.
- **Convergence rate:** `q = 2.0` (`O(h²)` for iterative solvers).
- **S3 check:** `‖y − Φ x̂‖₂` must decrease monotonically across iterations.
- **S4 certificate:** records `r = (residual_norm, error_bound, ratio)`, `c = (resolutions[], fitted_rate, theoretical_rate, K)`, `d = (consistent: bool)`, `Q ∈ [0.75, 1.0]`.

## 6. Operating Range (Ω)

| Parameter | Symbol | Range | Unit |
|---|---|---|---|
| Spatial resolution | H, W | 64 – 2048 | px |
| Spectral bands | N_λ | 8 – 128 | bands |
| Mask density | ρ | 0.3 – 0.7 | dimensionless |
| Noise level | σ | 0.001 – 0.1 | rel. intensity |
| Dispersion-slope error | a₁ | 0 – 0.05 | dimensionless |
| Dispersion-angle error | α | 0 – 0.3 | dimensionless |
| Mask shift (x, y) | dx, dy | 0 – 1.0 | px |
| Mask rotation | θ | 0 – 0.5 | rad |

## 7. Reference Datasets

- **KAIST Hyperspectral** (primary) — 30 scenes, 256×256×28 visible/NIR cubes, 450–650 nm.
- **CAVE Multispectral** (secondary).
- **ICVL Hyperspectral** (tertiary).

## 8. On-chain Registration

- **Chain hash:** see `chain_hash` field of [`L1-003.json`](./L1-003.json)
- **Chain tx hash:** see `chain_tx_hash`
- **Block:** see `chain_block`
- **Document hash:** committed to the registry as proof of immutability.

---

## File Mapping

This bundle consists of: `L1-003.md`, `L1-003.json`.

| File | Role | How to regenerate |
|------|------|-------------------|
| `L1-003.md` | **Source of truth — hand-curated** by the founder team | Edited by humans; LLMs may suggest improvements |
| `L1-003.json` | Structured metadata for the on-chain registry | LLM regenerates from §1 Introduction, §2 Forward Model, §3 Physics Fingerprint, §4–6 fields above |

**Prompt for your LLM after editing this Markdown:**

> Read the attached `L1-003.md`. Regenerate `L1-003.json` so every field matches.
> Schema: `{ artifact_id, layer, title, domain, sub_domain, physics_fingerprint{carrier,sensing_mechanism,integration_axis,problem_class,noise_model,solution_space,primitives[],L_DAG,difficulty_delta}, observable_profile{metric,secondary,regime}, size_tiers{center_spec{omega,problem_class,forward_operator,epsilon_fn_center,input_format},omega_bounds,epsilon_bounds,allowed_problem_classes,allowed_omega_dimensions,allowed_forward_operators}, hardness_fn{type,metric,kappa,delta}, initiator_dataset[{name,weight,ipfs_cid,license_hash}] }`
> Output only the JSON object — no prose, no fences.

_This Markdown is hand-curated from the [canonical CASSI walkthrough](https://github.com/integritynoble/pwm/blob/main/papers/Proof-of-Solution/mine_example/cassi.md). To submit a derivative principle, fork it via [`/submit/principle`](/submit/principle)._
