docs: clarify ControlNet finetuning data prep (§4.3) + add data-prep …#39
Conversation
…skill Rewrite data/README.md §4.3 into clear steps and document how to derive the preprocessed files (image embedding, VISTA-3D pseudo labels, combined labels) from a user's own original image + mask. Add skills/finetune_data-prep.md covering the same flow, including remapping a new class onto any unclaimed label index (0-255). Fix two errors in the old text: the backwards fold comment (held-out fold = validation) and stale dataset paths (maisi/dataset -> datasets/). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename skills/finetune_data-prep.md -> controlnet_finetune_data-prep.md, update the skill `name` field and the README link to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR rewrites
Confidence Score: 5/5Documentation-only change with no impact on runnable code; safe to merge. Both changed files are markdown documentation. The fold-semantics fix and path corrections are accurate and verified against the surrounding codebase. Cross-references to infer_image-from-mask.md resolve correctly. The one new finding is a // comment in a json fenced block that would break copy-paste into a config file, but it carries no runtime risk. No files require special attention beyond the minor //-in-JSON note in skills/finetune_image-from-mask_data-prep.md. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Original Image\n*.nii.gz] --> B[Step 1: VAE Encode\nscripts/diff_model_create_training_data.py\nautoencoder_v1.pt]
A --> C[Step 2: NV-Segment\nexternal tool]
B --> D[image_emb.nii.gz]
C --> E[Organ labels only\nno body envelope]
E --> F[add_body_envelope\nscripts.utils]
F --> G[mask_pseudo_label.nii.gz\norgans + body 200]
H[Original Mask\n*.nii.gz] --> I[Step 3a: remap_labels\nto MAISI indices]
I --> J[remapped mask]
G --> K[Step 3b: Overlay\nwrite remapped mask on top]
J --> K
K --> L[mask_combined_label.nii.gz]
D --> M[JSON data list\nimage + label + spacing + fold]
L --> M
M --> N[scripts.train_controlnet\nControlNet finetuning]
Reviews (4): Last reviewed commit: "docs: fix markdownlint MD051/MD028 in fi..." | Re-trigger Greptile |
Document how to produce the body envelope (label 200): the segmenter never emits it, so defer to Option A of infer_image-from-mask.md (NV-Segment CT_BODY -> add_body_envelope) instead of duplicating it. Replace all VISTA-3D references with NV-Segment in both the skill and README §4.3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The body-region one-hots are consumed only when include_body_region is true, which is set in config_network_ddpm.json. rflow-ct (config_network_rflow.json) sets it false and ignores the fields, so they can be omitted. Note this in the JSON examples and field notes in both the skill and README §4.3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A new/unseen label is not mandatory — finetuning to a new site/dataset with only existing MAISI classes follows the same pipeline. Reframe the skill intro, description, and the weighted_loss section as new-class-only/optional. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
weighted_loss_label up-weights the L1 loss on any label index (e.g. a tumor), new or existing — it is not required for adding a class and not new-class-only. Decouple it from the label_dict.json rename in the skill and README §4.3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@zephyrie Hi Michael, may I ask if you can help run the ci/cd test? I was removed from the maintainer...Thank you!! |
|
This update helps clarify creating data for fine-tuning the model. The original README missed critical information on how the embeddings, pseudo label and combined label is created from original dicom and label images |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…skill
Rewrite data/README.md §4.3 into clear steps and document how to derive the preprocessed files (image embedding, VISTA-3D pseudo labels, combined labels) from a user's own original image + mask. Add skills/finetune_data-prep.md covering the same flow, including remapping a new class onto any unclaimed label index (0-255). Fix two errors in the old text: the backwards fold comment (held-out fold = validation) and stale dataset paths (maisi/dataset -> datasets/).