This repository trains a UNet-style image-to-image translation model on cropped nuclei from nuclear_speckles_data.
- Input: cropped DAPI (
CH0) nucleus image - Target: cropped Gold (
CH2) nucleus image - Task: predict Gold crops from DAPI crops
Training uses cached, filtered single-cell crops generated from:
nuclear_speckles_data/IC_corrected_imagesnuclear_speckles_data/Preprocessed_data/single_cell_profiles/*annotated*.parquet
datasets/dataset_00/utils/CropCacheBuilder.py builds the crop cache and manifest when needed. Plate, well, site, and channel metadata are parsed from IC_corrected_images filenames split by _:
- field 1: plate
- field 2: well
- field 3: site
- field 4: channel (
CH0for DAPI input,CH2for Gold target)
Before samples are passed through the model, both input and target crops are normalized by their channel max intensity (dtype max, for example 255 for uint8 and 65535 for uint16) in datasets/dataset_00/utils/ImagePreProcessor.py.
Main entrypoint:
mlflow run . -e train_modelFast smoke run:
uv run train.py --epochs 1 --n-trials 1 --max-train-batches 2 --max-eval-batches 2 --enable-image-savers 0- Optimization loss: L1
- Logged metrics: L1, L2, PSNR, SSIM
Metrics are implemented in metrics/ and logged through callbacks/Callbacks.py.
- Crop-level prediction artifacts can be logged each epoch via
callbacks/utils/SaveEpochCrops.py. - Whole-FOV reconstruction and patch stitching are intentionally removed.