Skip to content

Add evaluation notebook and metrics implementation for degraded image… - #9

Closed
wli51 wants to merge 1 commit into
WayScience:mainfrom
wli51:eval_degraded_metrics
Closed

wli51 wants to merge 1 commit into
WayScience:mainfrom
wli51:eval_degraded_metrics

Conversation

@wli51

@wli51 wli51 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Adding notebook for actual metric eval with metrics from #7. Also adds and evaluates two additional foreground metric variants.

…s; enhance README with foreground metric details
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an analysis notebook to evaluate full-reference IQA metrics on simulated degradation/reference Lance pairs, and extends the metric suite with foreground-masked SSIM/PSNR variants (Otsu mask from the reference) to better focus evaluation on salient pixels in microscopy images.

Changes:

  • Implement ForegroundSSIM and ForegroundPSNR in utils/custom_metrics.py using a per-image Otsu-derived foreground mask.
  • Add notebook + nbconverted script to run metric evaluation over paired Lance datasets and write results to Parquet.
  • Update READMEs to document the metric set and the new foreground-masked variants; add kornia to dependencies.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
utils/custom_metrics.py Adds foreground-masked SSIM/PSNR metric implementations built around fixed-range per-image Otsu thresholding.
pyproject.toml Adds kornia to project dependencies.
2.train_models/README.md New README describing goals/approach/metrics for the analysis workflow.
1.image_degradation_simulation/README.md Documents foreground-masked metric behavior (Otsu mask, NaN on empty foreground).
1.image_degradation_simulation/nbconverted/1.4.evaluate_metrics_on_degraded_image.py Adds a script version of the evaluation notebook for metric computation and Parquet output.
1.image_degradation_simulation/1.4.evaluate_metrics_on_degraded_image.ipynb Adds the evaluation notebook to run the metrics over paired reference/degraded Lance datasets.
Suppressed comments (3)

2.train_models/README.md:27

  • Grammar/pluralization: “36 degraded variant per image” should be plural.
This produces 36 degraded variant per image in our Cell Painting dataset.

2.train_models/README.md:44

  • Spelling/grammar: “Per every… varaint” contains typos and is awkwardly phrased.
Per every pair of degraded image variant and its original reference image, we evaluate our collection of 7 metrics, yielding 7 metric values per degraded varaint.

2.train_models/README.md:50

  • Multiple spelling errors in the variance-partitioning description (“variantions”, “indenitity”, “densitiy”).
We then analyze with ANOVA variance partitioning and nested regression to what extents are variantions in metric values explained by the known degradation severity changes,
cell line indenitity of the images,
seeding densitiy label associated with the images,
and other known data inherent factors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pyproject.toml
"torchmetrics",
"lightning",
"polars",
"kornia",
Comment thread 2.train_models/README.md
Comment on lines +21 to +25
- Erosion (grayscale morpholical operation)
- Dilation (grayscale morpholical operation)
- Gamma correction (dimming and brightening)
- Grid distortion
We apply these to the fluoresence Cell Painting channels of our dataset in 6 incremental levels of severity by tuning a single transformation parameter while leaving others fixed (see code for details).
@wli51 wli51 closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants