Skip to content

[NEW FEATURE] Goodness-of-fit outlier rejection #224

Description

@jeipollack

Problem Description
Poor-quality observations, contaminated stars, or samples that are not well represented by the WaveDiff model can adversely affect model training and degrade PSF reconstruction performance.

Given a previously-trained WaveDiff model, evaluate the reconstruction quality of each observation to identify observations with poor reconstruction quality, so they can be excluded from subsequent training iterations. This provides a data-driven mechanism for improving the quality of the training dataset beyond catalogue-based star selection.

Proposed Solution
Implement a configurable goodness-of-fit evaluation as part of the data preprocessing workflow.
The feature should:

  • evaluate each star using a previously trained WaveDiff PSF model;
  • compute one or more configurable goodness-of-fit metrics (e.g. reduced χ² or residual-based statistics);
  • classify observations as acceptable or outliers using configurable thresholds;
  • exclude rejected observations from downstream training (and optionally validation);
  • generate summary statistics describing the rejected sample.

The design should remain extensible so that additional goodness-of-fit metrics can be introduced without modifying the overall workflow.

Alternatives Considered

  • No automated filtering — retain all selected stars regardless of reconstruction quality, relying entirely on the optimisation process to handle poor observations.
  • Manual inspection of residuals — useful during development but not suitable for automated pipeline execution.
  • Fixed quality cuts from catalogue metadata — simple but unable to detect stars that appear valid initially yet exhibit poor agreement with the trained model.

Additional Context
This feature is one component of the Outlier Rejection milestone.
Unlike pixel mask obscuration, which identifies potential data quality issues directly from the observations, this method uses the performance of a trained WaveDiff model to identify observations that are inconsistent with the learned PSF representation.

The intended workflow is:

  1. Load a trained WaveDiff model.
  2. Evaluate goodness-of-fit for observation.
  3. Reject observations exceeding configurable thresholds.
  4. Train the model using the filtered dataset.
  5. Compare model performance before and after outlier rejection.

Tasks-to-complete

  • Define goodness-of-fit metric(s)
  • Implement metric computation
  • Add configurable threshold(s)
  • Integrate with preprocessing workflow
  • Generate rejection statistics
  • Add unit tests
  • Update documentation

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions