Skip to content

[Research] Implement NMF-based spectral denoising #185

@KedoKudo

Description

@KedoKudo

Parent Epic

Part of #172 (2D Resonance Imaging)

Description

Implement Non-negative Matrix Factorization (NMF) for denoising hyperspectral data.

Approach

NMF decomposes the data matrix X ≈ W × H where:

  • X: (n_pixels × n_energies) data matrix
  • W: (n_pixels × k) abundance matrix
  • H: (k × n_energies) spectral components

This exploits:

  • Spectral correlations across pixels
  • Non-negativity constraints (physical)
  • Low-rank structure (few isotopes)

Proposed Interface

class NMFDenoising:
    """NMF-based spectral denoising."""
    
    def __init__(
        self,
        n_components: int | None = None,  # Auto-detect if None
        max_iter: int = 200,
        tol: float = 1e-4,
    ):
        ...
    
    def fit(self, data: np.ndarray) -> "NMFDenoising":
        """Fit NMF model to hyperspectral data."""
        # data shape: (n_pixels, n_energies)
        ...
    
    def denoise(self, data: np.ndarray) -> np.ndarray:
        """Denoise data using fitted model."""
        ...
    
    def get_components(self) -> np.ndarray:
        """Return learned spectral components."""
        ...

Research Questions

  1. How to choose number of components?
  2. How does NMF affect resonance peak shapes?
  3. What's the impact on fitting accuracy?
  4. How to handle pixels with very few counts?

Tasks

  • Implement NMF denoising class
  • Test on synthetic data with known noise
  • Evaluate impact on fitting accuracy
  • Compare to spatial binning baseline
  • Document method and best practices

References

  • scikit-learn NMF implementation
  • NMF for hyperspectral imaging literature

Assignees

Jean (LANL)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions