Skip to content

feat(util): GATNoiseProfile — Poisson–Gaussian noise estimator (design + plan) - #176

Draft
Xander-git wants to merge 2 commits into
mainfrom
feat/gat-noise-profile
Draft

Xander-git wants to merge 2 commits into
mainfrom
feat/gat-noise-profile

Conversation

@Xander-git

Copy link
Copy Markdown
Collaborator

Summary

Design spec + implementation plan for GATNoiseProfile, a fitted Poisson–Gaussian noise estimator in phenotypic.util that produces GAT parameters (gain, mu, read_sigma) for the existing GAT-aware denoisers. Docs only so far — implementation to follow (draft).

The repo already applies the GAT (sdk_/_anscombe.py, _GATSupportMixin, ColorDenoise) but the params default to a neutral 1/0/0 "blank" that users must hand-set. This adds a data-driven estimator.

What's here

  • docs/superpowers/specs/2026-06-30-gat-noise-profile-design.md — design spec
  • docs/superpowers/plans/2026-06-30-gat-noise-profile.md — 10 TDD implementation tasks

Design highlights

  • Fitted profile class mirroring ColorCheckerProfile (fit → serialize → dashboard), outside the ImageOperation/pipeline framework, living in util/ (it produces params, it is not a corrector).
  • Robust noise-level-function fit Var = gain·mean + b over weakly-textured local windows, pooled across one or many images; slope → gain, intercept → read_sigma.
  • Three channel modes: gray / detect_mat (scalar) and rgb (per-channel, linear-light) for CBM3D — grounded in the per-channel VST → opponent-transform ordering (Foi 2008; Mäkitalo & Foi 2013; Dabov et al. 2007).
  • μ identifiability handled honestly: μ only from an explicit dark_roi/dark_mask (no genuine photon≈0 zones in these plates), else a flagged prior.
  • Consumed via gat_params() / configure(op); extends ColorDenoise to accept per-channel params (no _anscombe.py change — it already broadcasts).

Deferred / out of scope

  • Cumulant/PoGaIN blind μ, per-image None-sentinel auto-estimation, auto dark-region discovery.
  • Moving ColorCheckerProfile into util/separate PR (large blast radius).

Status

Draft — implementation of the 10-task plan is pending.

🤖 Generated with Claude Code

Xander-git and others added 2 commits June 30, 2026 17:28
Fitted profile in util/ estimating GAT (gain, mu, read_sigma) from one or
pooled images; scalar gray/detect_mat modes plus per-channel linear-light
rgb mode for CBM3D; extends ColorDenoise to consume per-channel params.
ColorCheckerProfile move to util deferred to a later PR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B36TYF2QFiCxVEHttg6h7M
Bite-sized TDD tasks: util skeleton + io constant, NLF fit math, patch
extraction, scalar fit, per-channel rgb fit, gat_params/configure, JSON
round-trip, dashboard, ColorDenoise per-channel params, lint/type/docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B36TYF2QFiCxVEHttg6h7M
@Xander-git
Xander-git marked this pull request as ready for review July 1, 2026 21:37
@Xander-git
Xander-git marked this pull request as draft July 1, 2026 21:37
@Xander-git Xander-git added the feature-request New feature or request label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant