{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "victorbutoi-flexray--fine-tune-flexray-onto-a-custom-label-protocol",
 "repo": "VictorButoi/FleXray",
 "repo_url": "https://github.com/VictorButoi/FleXray",
 "repo_slug": "victorbutoi-flexray",
 "title": "Fine-tune Fle Xray onto your own X-ray label set",
 "page_title": "How to fine-tune Fle Xray onto your own X-ray label set with Fle Xray",
 "summary": "Map your masks to the Fle Xray protocol, pack the data, and train from the released weights.",
 "who": "An ML engineer at a research group with labeled X-ray masks that use a different set of anatomical labels than the released model.",
 "problem": "The released model predicts its own label protocol, so a custom label set needs a training path that starts from the existing weights.",
 "outcome": "A fine-tuned run that starts from VictorButoi/flexray with a replaced head, checked first with a CPU dry run on the packaged example.",
 "steps": [
  "Install the training extra with `python -m pip install \"flexray[train]\"`.",
  "Scaffold a dataset spec with `fxr-dataset scaffold xray-seg --images ./images --masks ./masks --name MyXrays --output dataset.yml`.",
  "Compile the label mapping with `fxr-protocol compile --dataset CustomHips.yml`, then pack the data with `fxr-dataset pack dataset.yml /data/MyXrays`.",
  "Dry-run training on CPU with `fxr-train train_custom.yml --set log.root=\"$PWD/work/runs\" --device cpu --dry-run --smoke-data` before a real run, and add `--init-from VictorButoi/flexray --replace-head` to start from the released weights. (inferred, check the README)"
 ],
 "agent_prompt": "In the FleXray repo, scaffold a dataset from <images-dir> and <masks-dir> with fxr-dataset, then dry-run fxr-train on CPU with --init-from VictorButoi/flexray --replace-head. Expect a dry run that completes without error and a packed ThunderDB dataset. Verify that the label mapping in the compiled protocol covers every mask id in your data.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "3 hours",
 "basis": "readme",
 "caveat": "The released weights are under CC-BY-NC-4.0 unless a model card says otherwise, so a fine-tuned model may carry the same non-commercial limit.",
 "category": "Research",
 "tags": [
  "Research"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.10 or newer and pip",
  "One or more X-ray images in PNG, JPEG, TIFF, BMP, or DICOM (DICOM needs the dicom extra)",
  "Internet access to download pretrained weights from Hugging Face on first run",
  "For training only: a labeled dataset, and a GPU or CPU for the dry run; the README says training is single-process with at most one GPU",
  "For the MCP use case: an MCP-capable client such as Claude Code or Claude Desktop"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/victorbutoi-flexray/fine-tune-flexray-onto-a-custom-label-protocol/",
 "md": "https://dedupedai.com/use-cases/victorbutoi-flexray/fine-tune-flexray-onto-a-custom-label-protocol/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/victorbutoi-flexray--fine-tune-flexray-onto-a-custom-label-protocol.json",
 "api_version": "v1"
}
