Conversation
…s; enhance README with foreground metric details
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
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
ForegroundSSIMandForegroundPSNRinutils/custom_metrics.pyusing 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
korniato 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.
| "torchmetrics", | ||
| "lightning", | ||
| "polars", | ||
| "kornia", |
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding notebook for actual metric eval with metrics from #7. Also adds and evaluates two additional foreground metric variants.