Per-Angle Scaling and Anti-Degeneracy¶
A subtle but critical issue arises when fitting the laminar-flow model simultaneously to data from multiple azimuthal angles \(\phi\): the optical contrast \(\beta(\phi)\) and the constant offset in \(c_2\) are mathematically degenerate with the physical parameters \(D_0\) and \(\dot{\gamma}_0\). This page explains the degeneracy mechanism and the per-angle scaling strategy that prevents it.
The Parameter Absorption Degeneracy¶
The laminar-flow model at a single angle \(\phi_k\) is:
The angle-dependent contrast \(\beta(\phi_k)\) arises from beam partial coherence, pixel geometry, and sample inhomogeneities. If \(\beta(\phi_k)\) is treated as free parameters to be optimized independently at each angle, the optimization landscape has a flat direction:
Degeneracy direction: Increasing \(D_0 \to D_0 + \delta\) and simultaneously increasing \(\beta(\phi_k) \to \beta(\phi_k) \cdot e^{q^2\delta t_\mathrm{ref}}\) for all \(k\) produces identical \(c_2\) values. The physical parameters are not identifiable from the per-angle contrasts without a constraint.
This degeneracy is generic whenever:
Per-angle \(\beta(\phi_k)\) are freely optimized.
The number of angle-specific parameters exceeds the information content per angle.
The diffusion contribution and the contrast contribution have the same functional form.
Warning
Using per_angle_mode: "individual" (free \(\beta(\phi_k)\) for all \(k\))
without strong priors will produce unphysical solutions where \(D_0 \approx 0\)
with inflated per-angle contrasts, or vice versa. Always verify that fitted \(D_0\)
is physically reasonable.
Per-Angle Modes¶
The anti-degeneracy system provides four modes, configured in YAML:
optimization:
nlsq:
anti_degeneracy:
per_angle_mode: "auto" # recommended
Mode: ``constant``
The simplest fix: estimate \(\beta(\phi_k)\) and \(c_\mathrm{offset}(\phi_k)\) from the data using a quantile estimator before optimization, then hold them fixed during the NLSQ run. Only the 7 physical parameters are optimized.
This prevents degeneracy by construction, but may introduce systematic bias if \(\hat{\beta}\) is inaccurate (e.g., when the zero-lag estimator is contaminated by noise).
Mode: ``individual``
Each angle has independently optimized \(\beta(\phi_k)\) and offset. This adds \(2 N_\phi\) free parameters (where \(N_\phi\) is the number of angle sectors). For \(N_\phi = 23\), this gives 53 total parameters.
Use only when:
Physical contrast variation across angles is expected and significant.
Excellent initial estimates for \(\beta(\phi_k)\) are available (e.g., from a prior
constantrun).The dataset is large enough to constrain 53 parameters.
Mode: ``fourier``
Models the angular variation of contrast as a truncated Fourier series (default \(K = 2\)):
This adds \(2K + 1 = 5\) contrast parameters (for \(K=2\)) instead of \(2N_\phi\). The physical constraint is that contrast must vary smoothly with angle, as expected from beam coherence geometry.
Total parameters: \(7 + 2K + 2 = 7 + 2K + \text{offsets}\) (approximately 17 for \(K=2\)).
Mode: ``auto`` (recommended)
Examines the number of angle sectors \(N_\phi\):
If \(N_\phi \geq 3\): uses averaged scaling — computes per-angle \(\beta(\phi_k)\) and offset by quantile estimation, averages them to get a single \(\bar{\beta}\) and \(\bar{c}_\mathrm{offset}\), and optimizes these 2 averaged values alongside the 7 physical parameters (total 9 parameters).
If \(N_\phi < 3\): falls back to
individual.
Auto mode breaks the degeneracy because:
The averaged scaling is initialized from data (not zero), providing a good starting point.
Only 2 scaling parameters are free (not \(2N_\phi\)), so the problem is well-posed.
The quantile-based initialization ensures the optimizer starts near the true solution.
Mathematical Formulation¶
Let \(\hat{\mu}_k\) and \(\hat{\sigma}_k\) be the estimated mean contrast and offset for angle \(\phi_k\). The auto-mode averaging is:
The model then becomes:
where \(\theta = (D_0, \alpha, D_\mathrm{offset}, \dot{\gamma}_0, \beta_\gamma, \dot{\gamma}_\mathrm{offset}, \phi_0)\) are the 7 physical parameters and \((\bar{\beta}, \bar{c}_\mathrm{offset})\) are the 2 optimized scaling parameters.
Parameter Count Summary¶
Mode |
Parameters (23 angles) |
Notes |
|---|---|---|
|
7 |
Scaling fixed; may bias if quantile estimate poor |
|
9 |
Recommended: 7 physical + 2 averaged scaling |
|
17 |
7 physical + 10 Fourier coefficients (contrast + offset) |
|
53 |
7 physical + 46 per-angle parameters; risk of degeneracy |
When to Use Each Mode¶
Mode |
Recommended when |
|---|---|
|
Default for all production runs. \(N_\phi \geq 3\) (virtually always true). |
|
Debugging. When physical contrast variation is known to be negligible and quantile estimate is reliable. Fastest convergence. |
|
Strong azimuthal contrast variation expected (anisotropic beam or sample).
More parameters than |
|
Post-hoc analysis only. Use |
Implementation Reference¶
The anti-degeneracy system is implemented in:
homodyne.optimization.nlsq.anti_degeneracy_controller— orchestratorhomodyne.optimization.nlsq.fourier_reparam— Fourier modehomodyne.optimization.nlsq.hierarchical— hierarchical optimizerhomodyne.optimization.nlsq.adaptive_regularization— CV-based regularizationhomodyne.optimization.nlsq.gradient_monitor— gradient collapse detectionhomodyne.optimization.nlsq.shear_weighting— shear-sensitivity weighting
The five-layer defense system (beyond per-angle mode selection) includes:
Fourier/Constant Reparameterization — transforms the parameter space to remove the flat direction algebraically.
Hierarchical Optimization — first fits physical parameters with fixed scaling, then jointly refines all.
Adaptive CV-based Regularization — penalizes solutions where the coefficient of variation of residuals per-angle is anomalously large.
Gradient Collapse Monitoring — detects when gradient norms collapse (flat landscape) and restarts with perturbed initialization.
Shear-Sensitivity Weighting — upweights data points near \(\phi = 0\) where the shear term is most informative.
See ADR-003: Anti-Degeneracy Layer for Laminar Flow for the architectural rationale.
See also
Homodyne Scattering: Laminar Flow Model — the full \(c_2\) equation
ADR-003: Anti-Degeneracy Layer for Laminar Flow — architectural decision record
homodyne.optimization.nlsq.anti_degeneracy_controller— implementation