-
Notifications
You must be signed in to change notification settings - Fork 1
Update README.md #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wli51
wants to merge
1
commit into
WayScience:main
Choose a base branch
from
wli51:dev-v0.4.3-main-readme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update README.md #16
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,78 @@ | ||
| # virtual_stain_flow | ||
| For developing virtual staining models | ||
| # `virtual_stain_flow` - For developing virtual staining models | ||
|
|
||
| ## Overview | ||
| `virtual_stain_flow` is a framework for the reproducible development and training of image-to-image translation models that enable virtual staining (the prediction of "virtual" stains) from label-free microscopy images. | ||
| The package provides comprehensive experiment tracking that spans the entire model development workflow, from dataset construction, augmetnation, model customization to training. | ||
|
|
||
| --- | ||
|
|
||
| ## Supported Model Architectures | ||
|
|
||
| - **U-Net** – A classical encoder–decoder architecture with skip connections. | ||
| This lightweight design has been widely used for virtual staining tasks, as demonstrated by [Ounkomol et al., 2018](https://doi.org/10.1038/s41592-018-0111-2). | ||
|
|
||
| - **wGAN-GP** – A Wasserstein GAN with Gradient Penalty. | ||
| This generative adversarial setup combines a U-Net generator with a convolutional discriminator regularized via gradient penalty for stable training. | ||
| As shown by [Cross-Zamirski et al., 2022](https://doi.org/10.1038/s41598-022-12914-x), adversarial training enhances the realism of synthetic stains. | ||
|
|
||
| - **ConvNeXt-UNet** – A fully convolutional architecture inspired by recent computer vision advances. | ||
| Drawing from [Liu et al., 2022](https://doi.org/10.48550/arXiv.2201.03545) and [Liu et al., 2025](https://doi.org/10.1038/s42256-025-01046-2), this variant incorporates transformer-like architectural refinements to improve the fidelity of virtual staining details, at the cost of higher computational demand. | ||
|
|
||
| ### Showcasing of model prediction | ||
|
|
||
|  | ||
| **Prediction (DNA, Hoechst 33342)** generated by `virtual_stain_flow` using the ConvNeXt-UNet model, from brightfield microscopy images of the U2-OS cell line. | ||
|
|
||
| ## Core Components | ||
|
|
||
| - **[datasets/](./src/virtual_stain_flow/datasets/)** - Data loading and preprocessing pipelines | ||
| - **[models/](./src/virtual_stain_flow/models/)** - Virtual staining models and building blocks | ||
| - **[trainers/](./src/virtual_stain_flow/trainers/)** - Training loops | ||
| - **[transforms/](./src/virtual_stain_flow/transforms/)** - Image normalization and augmnentation | ||
| - **[vsf_logging/](./src/virtual_stain_flow/vsf_logging/)** - Experiment tracking and logging | ||
|
|
||
| --- | ||
|
|
||
| ## Quick Start | ||
|
|
||
| Check out the **[examples/](./examples/)** directory for complete training scripts and tutorials demonstrating various use cases and configurations. | ||
|
|
||
| ```python | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like two separable blocks of code. Consider describing each with a bit more specific detail, separately |
||
| from virtual_stain_flow.models import UNet, Conv2DNormActBlock | ||
|
|
||
| model = UNet( | ||
| input_channels=1, | ||
| output_channels=3, | ||
| comp_block=Conv2DNormActBlock, | ||
| depth=4 | ||
| ) | ||
|
|
||
| from virtual_stain_flow.datasets import BaseImageDataset | ||
| from virtual_stain_flow.transforms import MaxScaleNormalize | ||
|
|
||
| dataset = BaseImageDataset( | ||
| file_index=file_index_df, | ||
| input_channel_keys="phase", | ||
| target_channel_keys=["dapi", "tubulin", "actin"], | ||
| transform=MaxScaleNormalize(normalization_factor='16bit') | ||
| ) | ||
|
|
||
| from virtual_stain_flow.trainers import Trainer | ||
| from virtual_stain_flow.vsf_logging import MlflowLogger | ||
|
|
||
| logger = MlflowLogger(experiment_name="virtual_staining") | ||
| trainer = Trainer(model, dataset) | ||
| trainer.train(logger=logger) | ||
| ``` | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| pip install virtual-stain-flow | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## License | ||
|
|
||
| See the [LICENSE](LICENSE) file for full details. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.