[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Project-MONAI--tutorials":3,"tool-Project-MONAI--tutorials":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",142651,2,"2026-04-06T23:34:12",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":77,"owner_website":78,"owner_url":79,"languages":80,"stars":97,"forks":98,"last_commit_at":99,"license":100,"difficulty_score":32,"env_os":101,"env_gpu":102,"env_ram":101,"env_deps":103,"category_tags":114,"github_topics":115,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":121,"updated_at":122,"faqs":123,"releases":153},4683,"Project-MONAI\u002Ftutorials","tutorials","MONAI Tutorials","MONAI Tutorials 是专为医疗影像人工智能领域打造的学习资源库，旨在帮助用户快速掌握 MONAI 框架的核心功能。它通过一系列结构清晰的 Jupyter Notebook 示例，覆盖了从基础的 2D 分类、3D 分割到复杂的模型训练与部署等全流程任务，有效解决了初学者在面对专业医疗数据格式（如 DICOM、NIfTI）和复杂深度学习流程时“上手难、环境配置繁琐”的痛点。\n\n这套教程特别适合医学影像研究人员、AI 开发者以及希望进入医疗 AI 领域的学生使用。其独特亮点在于提供了“一键式”的 Google Colab 运行支持，用户无需在本地耗费精力配置复杂的 CUDA 或 PyTorch 环境，即可利用云端 GPU 资源直接运行代码并验证结果。此外，教程还针对常见的版本冲突和数据加载问题提供了详细的解决方案与最佳实践建议，确保学习过程顺畅高效。无论是想复现经典算法，还是探索最新的医疗影像分析技术，MONAI Tutorials 都能提供切实可行的代码指引和理论支撑，是连接理论知识与实际应用的理想桥梁。","# MONAI Tutorials\nThis repository hosts the MONAI tutorials.\n\n### 1. Requirements\nMost of the examples and tutorials require\n[matplotlib](https:\u002F\u002Fmatplotlib.org\u002F) and [Jupyter Notebook](https:\u002F\u002Fjupyter.org\u002F).\n\nThese can be installed with:\n\n```bash\npython -m pip install -U pip\npython -m pip install -U matplotlib\npython -m pip install -U notebook\n```\n\nSome of the examples may require optional dependencies. In case of any optional import errors,\nplease install the relevant packages according to MONAI's [installation guide](https:\u002F\u002Fdocs.monai.io\u002Fen\u002Flatest\u002Finstallation.html).\nOr install all optional requirements with:\n\n```bash\npip install -r https:\u002F\u002Fraw.githubusercontent.com\u002FProject-MONAI\u002FMONAI\u002Fdev\u002Frequirements-dev.txt\n```\n\n#### Run the notebooks from Colab\n\nMost of the Jupyter Notebooks have an \"Open in Colab\" button.\nPlease right-click on the button, and select \"Open Link in New Tab\" to start a Colab page with the corresponding notebook content.\n\nTo use GPU resources through Colab, please remember to change the runtime type to `GPU`:\n\n1. From the `Runtime` menu select `Change runtime type`\n1. Choose `GPU` from the drop-down menu\n1. Click `SAVE`\nThis will reset the notebook and may ask you if you are a robot (these instructions assume you are not).\n\nRunning:\n\n```bash\n!nvidia-smi\n```\n\nin a cell will verify this has worked and show you what kind of hardware you have access to.\n\n#### Google Colab Setup (CUDA 12.x, PyTorch 2.6, MONAI 1.5)\n\nIn Google Colab, the default environment may cause version conflicts with MONAI.\nTo ensure compatibility, install PyTorch and MONAI explicitly as follows:\n\n# Install PyTorch 2.6.0 with CUDA 12.4\npip install --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu124 \\\n  torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0\n\n# Install MONAI and common dependencies\npip install \"monai[all]\" nibabel pydicom ipywidgets==8.1.2\n\n\n### Known issues and fixes\n\n- Torchaudio mismatch\n  Colab may come with torchaudio 2.8.0, which is incompatible with torch 2.6.0.\n  Installing the versions above resolves this issue.\n\n- filelock conflicts with nni\n  Some preinstalled packages (such as pytensor with newer filelock) may conflict.\n  Use the following commands to fix:\n\n  pip uninstall -y pytensor\n  pip install -U filelock\n\n- Too many workers warning\n  Colab has limited CPU resources, and high num_workers settings may freeze execution.\n  It is recommended to use --num_workers=2 when running tutorials and adjust the `num_workers` parameters where it is used in notebooks (eg. for data loaders).\n\n\n### Quick smoke test\n\nAfter installation, verify the environment by running:\n\ngit clone https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002Ftutorials.git\ncd tutorials\u002F3d_segmentation\u002Ftorch\npython -u unet_training_array.py --max_epochs 2 --batch_size 1 --num_workers 2\n\nIf the logs show decreasing training loss and a Dice score, the setup is correct.\n\n**Note:** In most cases, users can run MONAI tutorials directly in Colab notebooks without additional installation.\nThe steps above are mainly for resolving dependency conflicts when installing extra packages.\n\n#### Data\n\nSome notebooks will require additional data.\nEach user is responsible for checking the content of datasets and the applicable licenses and determining if suitable for the intended use.\n\n### 2. Questions and bugs\n\n- For questions relating to the use of MONAI, please use our [Discussions tab](https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002FMONAI\u002Fdiscussions) on the main repository of MONAI.\n- For bugs relating to MONAI functionality, please create an issue on the [main repository](https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002FMONAI\u002Fissues).\n- For bugs relating to the running of a tutorial, please create an issue in [this repository](https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002FTutorials\u002Fissues).\n\n### 3. Become a contributor\n\nYou can read details about adding a tutorial in our [CONTRIBUTING GUIDELINES](CONTRIBUTING.md).\n\n### 4. List of notebooks and examples\n#### \u003Cins>**2D classification**\u003C\u002Fins>\n##### [mednist_tutorial](.\u002F2d_classification\u002Fmednist_tutorial.ipynb)\nThis notebook shows how to easily integrate MONAI features into existing PyTorch programs.\nIt's based on the MedNIST dataset which is very suitable for beginners as a tutorial.\nThis tutorial also makes use of MONAI's in-built occlusion sensitivity functionality.\n\n#### \u003Cins>**2D segmentation**\n##### [torch examples](.\u002F2d_segmentation\u002Ftorch)\nTraining and evaluation examples of 2D segmentation based on UNet and synthetic dataset.\nThe examples are standard PyTorch programs and have both dictionary-based and array-based versions.\n\n#### \u003Cins>**3D classification**\u003C\u002Fins>\n##### [ignite examples](.\u002F3d_classification\u002Fignite)\nTraining and evaluation examples of 3D classification based on DenseNet3D and [IXI dataset](https:\u002F\u002Fbrain-development.org\u002Fixi-dataset).\nThe examples are PyTorch Ignite programs and have both dictionary-based and array-based transformation versions.\n##### [torch examples](.\u002F3d_classification\u002Ftorch)\nTraining and evaluation examples of 3D classification based on DenseNet3D and [IXI dataset](https:\u002F\u002Fbrain-development.org\u002Fixi-dataset).\nThe examples are standard PyTorch programs and have both dictionary-based and array-based transformation versions.\n\n#### \u003Cins>**3D regression**\u003C\u002Fins>\n##### [densenet_training_array.ipynb](.\u002F3d_regression\u002Fdensenet_training_array.ipynb)\nTraining and evaluation examples of 3D regression based on DenseNet3D and [IXI dataset](https:\u002F\u002Fbrain-development.org\u002Fixi-dataset).\n\n#### \u003Cins>**3D segmentation**\u003C\u002Fins>\n##### [ignite examples](.\u002F3d_segmentation\u002Fignite)\nTraining and evaluation examples of 3D segmentation based on UNet3D and synthetic dataset.\nThe examples are PyTorch Ignite programs and have both dictionary-based and array-based transformations.\n##### [torch examples](.\u002F3d_segmentation\u002Ftorch)\nTraining, evaluation and inference examples of 3D segmentation based on UNet3D and synthetic dataset.\nThe examples are standard PyTorch programs and have both dictionary-based and array-based versions.\n##### [brats_segmentation_3d](.\u002F3d_segmentation\u002Fbrats_segmentation_3d.ipynb)\nThis tutorial shows how to construct a training workflow of multi-labels segmentation task based on [MSD Brain Tumor dataset](http:\u002F\u002Fmedicaldecathlon.com), and how to convert the pytorch model to an onnx model for inference and comparison.\n##### [spleen_segmentation_3d_aim](.\u002F3d_segmentation\u002Fspleen_segmentation_3d_visualization_basic.ipynb)\nThis notebook shows how MONAI may be used in conjunction with the [`aimhubio\u002Faim`](https:\u002F\u002Fgithub.com\u002Faimhubio\u002Faim).\n##### [spleen_segmentation_3d_lightning](.\u002F3d_segmentation\u002Fspleen_segmentation_3d_lightning.ipynb)\nThis notebook shows how MONAI may be used in conjunction with the [PyTorch Lightning](https:\u002F\u002Fgithub.com\u002FPyTorchLightning\u002Fpytorch-lightning) framework.\n##### [spleen_segmentation_3d](.\u002F3d_segmentation\u002Fspleen_segmentation_3d.ipynb)\nThis notebook is an end-to-end training and evaluation example of 3D segmentation based on [MSD Spleen dataset](http:\u002F\u002Fmedicaldecathlon.com).\nThe example shows the flexibility of MONAI modules in a PyTorch-based program:\n- Transforms for dictionary-based training data structure.\n- Load NIfTI images with metadata.\n- Scale medical image intensity with expected range.\n- Crop out a batch of balanced image patch samples based on positive \u002F negative label ratio.\n- Cache IO and transforms to accelerate training and validation.\n- 3D UNet, Dice loss function, Mean Dice metric for 3D segmentation task.\n- Sliding window inference.\n- Deterministic training for reproducibility.\n##### [unet_segmentation_3d_ignite](.\u002F3d_segmentation\u002Funet_segmentation_3d_ignite.ipynb)\nThis notebook is an end-to-end training & evaluation example of 3D segmentation based on synthetic dataset.\nThe example is a PyTorch Ignite program and shows several key features of MONAI, especially with medical domain specific transforms and event handlers for profiling (logging, TensorBoard, MLFlow, etc.).\n##### [COVID 19-20 challenge baseline](.\u002F3d_segmentation\u002Fchallenge_baseline)\nThis folder provides a simple baseline method for training, validation, and inference for [COVID-19 LUNG CT LESION SEGMENTATION CHALLENGE - 2020](https:\u002F\u002Fcovid-segmentation.grand-challenge.org\u002FCOVID-19-20\u002F) (a MICCAI Endorsed Event).\n##### [unetr_btcv_segmentation_3d](.\u002F3d_segmentation\u002Funetr_btcv_segmentation_3d.ipynb)\nThis notebook demonstrates how to construct a training workflow of UNETR on multi-organ segmentation task using the BTCV challenge dataset.\n##### [unetr_btcv_segmentation_3d_lightning](.\u002F3d_segmentation\u002Funetr_btcv_segmentation_3d_lightning.ipynb)\nThis tutorial demonstrates how MONAI can be used in conjunction with [PyTorch Lightning](https:\u002F\u002Fwww.pytorchlightning.ai\u002F) framework to construct a training workflow of UNETR on multi-organ segmentation task using the BTCV challenge dataset.\n##### [vista3d](.\u002F3d_segmentation\u002Fvista3d)\nThis tutorial showcases the process of fine-tuning VISTA3D on [MSD Spleen dataset](http:\u002F\u002Fmedicaldecathlon.com) using MONAI. For an in-depth exploration, please visit the [VISTA](https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002FVISTA) repository.\n\n#### \u003Cins>**2D registration**\u003C\u002Fins>\n##### [registration using mednist](.\u002F2d_registration\u002Fregistration_mednist.ipynb)\nThis notebook shows a quick demo for learning based affine registration of `64 x 64` X-Ray hands.\n\n#### \u003Cins>**3D registration**\u003C\u002Fins>\n##### [3D registration using paired lung CT](.\u002F3d_registration\u002Fpaired_lung_ct.ipynb)\nThis tutorial shows how to use MONAI to register lung CT volumes acquired at different time points for a single patient.\n\n##### [3D registration using unpaired brain MR](.\u002F3d_registration\u002Flearn2reg_oasis_unpaired_brain_mr.ipynb)\nThis tutorial shows how to get started on using the general-purpose registration framework `VoxelMorph` offered in MONAI to register unpaired brain MR volumes.\n\n##### [DeepAtlas](.\u002Fdeep_atlas\u002Fdeep_atlas_tutorial.ipynb)\nThis tutorial demonstrates the use of MONAI for training of registration and segmentation models _together_. The DeepAtlas approach, in which the two models serve as a source of weakly supervised learning for each other, is useful in situations where one has many unlabeled images and just a few images with segmentation labels. The notebook works with 3D images from the OASIS-1 brain MRI dataset.\n\n#### \u003Cins>**Deepgrow**\u003C\u002Fins>\n##### [Deepgrow](.\u002Fdeepgrow)\nThe example show how to train\u002Fvalidate a 2D\u002F3D deepgrow model.  It also demonstrates running an inference for trained deepgrow models.\n\n#### \u003Cins>**DeepEdit**\u003C\u002Fins>\n##### [DeepEdit](.\u002Fdeepedit\u002Fignite)\nThis example shows how to train\u002Ftest a DeepEdit model. In this tutorial there is a Notebook that shows how to run\ninference on a pretrained DeepEdit model.\n\n\n#### \u003Cins>**Deployment**\u003C\u002Fins>\n##### [BentoML](.\u002Fdeployment\u002Fbentoml)\nThis is a simple example of training and deploying a MONAI network with [BentoML](https:\u002F\u002Fwww.bentoml.ai\u002F) as a web server, either locally using the BentoML repository or as a containerized service.\n##### [Ray](.\u002Fdeployment\u002Fray)\nThis uses the previous notebook's trained network to demonstrate deployment a web server using [Ray](https:\u002F\u002Fdocs.ray.io\u002Fen\u002Fmaster\u002Fserve\u002Findex.html#rayserve).\n##### [Triton](.\u002Fdeployment\u002FTriton\u002F)\nThis is example walks through using a Triton Server and Python client using MONAI on the MedNIST classification problem. The demo is self contained and the Readme explains how to use Triton \"backends\" to inject the MONAI code into the server.  [See Triton Inference Server\u002Fpython_backend documentation](https:\u002F\u002Fgithub.com\u002Ftriton-inference-server\u002Fpython_backend#usage)\n\n#### \u003Cins>**Experiment Management**\u003C\u002Fins>\n##### [Aim](.\u002Fexperiment_management\u002Fspleen_segmentation_aim.ipynb)\nAn example of experiment management with [Aim](https:\u002F\u002Faimstack.io\u002Faim-monai-tutorial\u002F), using 3D spleen segmentation as an example.\n##### [MLFlow](.\u002Fexperiment_management\u002Fspleen_segmentation_mlflow.ipynb)\nAn example of experiment management with [MLFlow](https:\u002F\u002Fwww.mlflow.org\u002Fdocs\u002Flatest\u002Ftracking.html), using 3D spleen segmentation as an example.\n##### [MONAI bundle integrates MLFlow](.\u002Fexperiment_management\u002Fbundle_integrate_mlflow.ipynb)\nAn example shows how to easily enable and customize the MLFlow for experiment management in MONAI bundle.\n##### [ClearML](.\u002Fexperiment_management\u002Funet_segmentation_3d_ignite_clearml.ipynb)\nAn example of experiment management with [ClearML](https:\u002F\u002Fclear.ml\u002Fdocs\u002Flatest\u002Fdocs\u002F), using 3D Segmentation with UNet as an example.\n\n\n#### \u003Cins>**Federated Learning**\u003C\u002Fins>\n##### [NVFlare](.\u002Ffederated_learning\u002Fnvflare)\nThe examples show how to train federated learning models with [NVFlare](https:\u002F\u002Fpypi.org\u002Fproject\u002Fnvflare\u002F) and MONAI-based trainers.\n\n##### [OpenFL](.\u002Ffederated_learning\u002Fopenfl)\nThe examples show how to train federated learning models based on [OpenFL](https:\u002F\u002Fgithub.com\u002Fintel\u002Fopenfl) and MONAI.\n\n##### [Substra](.\u002Ffederated_learning\u002Fsubstra)\nThe example show how to execute the 3d segmentation torch tutorial on a federated learning platform, Substra.\n\n##### [Breast Density FL Challenge](.\u002Ffederated_learning\u002Fbreast_density_challenge)\nReference implementation used in MICCAI 2022 [ACR-NVIDIA-NCI Breast Density FL challenge](http:\u002F\u002Fbreastdensityfl.acr.org).\n\n#### \u003Cins>**Digital Pathology**\u003C\u002Fins>\n##### [Whole Slide Tumor Detection](.\u002Fpathology\u002Ftumor_detection)\nThe example shows how to train and evaluate a tumor detection model (based on patch classification) on whole-slide histopathology images.\n\n##### [Profiling Whole Slide Tumor Detection](.\u002Fpathology\u002Ftumor_detection)\nThe example shows how to use MONAI NVTX transforms to tag and profile pre- and post-processing transforms in the digital pathology whole slide tumor detection pipeline.\n\n##### [Multiple Instance Learning WSI classification](.\u002Fpathology\u002Fmultiple_instance_learning)\nAn example of Multiple Instance Learning (MIL) classification from Whole Slide Images (WSI) of prostate histopathology.\n\n##### [NuClick Annotation](.\u002Fpathology\u002Fnuclick#nuclick-interaction-model)\nThe notebook demonstrates examples of training and inference pipelines with interactive annotation for pathology, NuClick is used for delineating nuclei, cells and a squiggle for outlining glands.\n\n#### [HoVerNet:Nuclear segmentation and classification task](.\u002Fpathology\u002Fhovernet)\nThis tutorial demonstrates how to construct a training workflow of [HoVerNet](https:\u002F\u002Fwww.sciencedirect.com\u002Fscience\u002Farticle\u002Fabs\u002Fpii\u002FS1361841519301045) on nuclear segmentation and classification task using the CoNSep dataset.\n\n##### [Nuclei Classification](.\u002Fpathology\u002Fnuclick#nuclei-classification-model)\nThe notebook demonstrates examples of training and inference pipelines with interactive annotation for pathology, NuClick is used for delineating nuclei, cells and a squiggle for outlining glands.\n\n#### \u003Cins>**Acceleration**\u003C\u002Fins>\n##### [fast_model_training_guide](.\u002Facceleration\u002Ffast_model_training_guide.md)\nThe document introduces details of how to profile the training pipeline, how to analyze the dataset and select suitable algorithms, and how to optimize GPU utilization in single GPU, multi-GPUs or even multi-nodes.\n\n##### [distributed_training](.\u002Facceleration\u002Fdistributed_training)\nThe examples show how to execute distributed training and evaluation based on 3 different frameworks:\n- PyTorch native `DistributedDataParallel` module with `torch.distributed.launch`.\n- Horovod APIs with `horovodrun`.\n- PyTorch ignite and MONAI workflows.\n\nThey can run on several distributed nodes with multiple GPU devices on every node.\n##### [automatic_mixed_precision](.\u002Facceleration\u002Fautomatic_mixed_precision.ipynb)\nAnd compares the training speed and memory usage with\u002Fwithout AMP.\n##### [dataset_type_performance](.\u002Facceleration\u002Fdataset_type_performance.ipynb)\nThis notebook compares the performance of `Dataset`, `CacheDataset` and `PersistentDataset`. These classes differ in how data is stored (in memory or on disk), and at which moment transforms are applied.\n##### [fast_training_tutorial](.\u002Facceleration\u002Ffast_training_tutorial.ipynb)\nThis tutorial compares the training performance of pure PyTorch program and optimized program in MONAI based on NVIDIA GPU device and latest CUDA library.\nThe optimization methods mainly include: `AMP`, `CacheDataset`, `GPU transforms`, `ThreadDataLoader`, `DiceCELoss` and `SGD`.\n##### [threadbuffer_performance](.\u002Facceleration\u002Fthreadbuffer_performance.ipynb)\nDemonstrates the use of the `ThreadBuffer` class used to generate data batches during training in a separate thread.\n##### [transform_speed](.\u002Facceleration\u002Ftransform_speed.ipynb)\nIllustrate reading NIfTI files and test speed of different transforms on different devices.\n##### [TensorRT_inference_acceleration](.\u002Facceleration\u002FTensorRT_inference_acceleration.ipynb)\nThis notebook shows how to use TensorRT to accelerate the model and achieve a better inference latency.\n\n#### \u003Cins>**Model Zoo**\u003C\u002Fins>\n##### [easy_integrate_bundle](.\u002Fmodel_zoo\u002Fapp_integrate_bundle)\nThis tutorial shows a straightforward ensemble application to instruct users on how to integrate existing bundles in their own projects. By simply changing the data path and the path where the bundle is located, training and ensemble inference can be performed.\n\n#### \u003Cins>**Computer Assisted Intervention**\u003C\u002Fins>\n##### [video segmentation](.\u002Fcomputer_assisted_intervention\u002Fvideo_seg.ipynb)\nThis tutorial shows how to train a surgical tool segmentation model to locate tools in a given image. In addition, it also builds an example pipeline of an end-to-end video tool segmentation, with video input and video output.\n##### [endoscopic inbody classification](.\u002Fcomputer_assisted_intervention\u002Fendoscopic_inbody_classification.ipynb)\nTutorial to show the pipeline of fine tuning an endoscopic inbody classification model based on a corresponding pretrained bundle.\n\n#### \u003Cins>**Hugging Face**\u003C\u002Fins>\n##### [MONAI Hugging Face Pipeline](.\u002Fhugging_face\u002Fhugging_face_pipeline_for_monai.ipynb)\nThis tutorial demonstrates how to encapsulate an existing MONAI model workflow into a Hugging Face pipeline, which is widely adopted by the open-source community.\n##### [Fine-tuning for Hugging Face Pipeline](.\u002Fhugging_face\u002Ffinetune_vista3d_for_hugging_face_pipeline.ipynb)\nThis tutorial explains the process of fine-tuning a VISTA3D model and integrating it into a Hugging Face pipeline for inference.\n\n#### \u003Cins>**Modules**\u003C\u002Fins>\n##### [bundle](.\u002Fbundle)\nGet started tutorial and concrete training \u002F inference examples for MONAI bundle features.\n##### [competitions](.\u002Fcompetitions)\nMONAI based solutions of competitions in healthcare imaging.\n##### [engines](.\u002Fmodules\u002Fengines)\nTraining and evaluation examples of 3D segmentation based on UNet3D and synthetic dataset with MONAI workflows, which contains engines, event-handlers, and post-transforms. And GAN training and evaluation example for a medical image generative adversarial network. Easy run training script uses `GanTrainer` to train a 2D CT scan reconstruction network. Evaluation script generates random samples from a trained network.\n\nThe examples are built with MONAI workflows, mainly contain: trainer\u002Fevaluator, handlers, post_transforms, etc.\n##### [3d_image_transforms](.\u002Fmodules\u002F3d_image_transforms.ipynb)\nThis notebook demonstrates the transformations on volumetric images.\n##### [2d_inference_3d_volume](.\u002Fmodules\u002F2d_inference_3d_volume.ipynb)\nTutorial that demonstrates how monai `SlidingWindowInferer` can be used when a 3D volume input needs to be provided slice-by-slice to a 2D model and finally, aggregated into a 3D volume.\n##### [autoencoder_mednist](.\u002Fmodules\u002Fautoencoder_mednist.ipynb)\nThis tutorial uses the MedNIST hand CT scan dataset to demonstrate MONAI's autoencoder class. The autoencoder is used with an identity encode\u002Fdecode (i.e., what you put in is what you should get back), as well as demonstrating its usage for de-blurring and de-noising.\n##### [batch_output_transform](.\u002Fmodules\u002Fbatch_output_transform.ipynb)\nTutorial to explain and show how to set `batch_transform` and `output_transform` of handlers to work with MONAI engines.\n##### [bending_energy_diffusion_loss_notes](.\u002Fmodules\u002Fbending_energy_diffusion_loss_notes.ipynb)\nThis notebook demonstrates when and how to compute normalized bending energy and diffusion loss.\n##### [compute_metric](.\u002Fmodules\u002Fcompute_metric.py)\nExample shows how to compute metrics from saved predictions and labels with PyTorch multi-processing support.\n##### [csv_datasets](.\u002Fmodules\u002Fcsv_datasets.ipynb)\nTutorial shows the usage of `CSVDataset` and `CSVIterableDataset`, load multiple CSV files and execute postprocessing logic.\n##### [decollate_batch](.\u002Fmodules\u002Fdecollate_batch.ipynb)\nTutorial shows how to decollate batch data to simplify post processing transforms and execute more flexible following operations.\n##### [image_dataset](.\u002Fmodules\u002Fimage_dataset.ipynb)\nNotebook introduces basic usages of `monai.data.ImageDataset` module.\n##### [dynunet_tutorial](.\u002Fmodules\u002Fdynunet_pipeline)\nThis tutorial shows how to train 3D segmentation tasks on all the 10 decathlon datasets with the reimplementation of dynUNet in MONAI.\n##### [integrate_3rd_party_transforms](.\u002Fmodules\u002Fintegrate_3rd_party_transforms.ipynb)\nThis tutorial shows how to integrate 3rd party transforms into MONAI program.\nMainly shows transforms from BatchGenerator, TorchIO, Rising and ITK.\n##### [inverse transformations and test-time augmentations](.\u002Fmodules\u002Finverse_transforms_and_test_time_augmentations.ipynb)\nThis notebook demonstrates the use of invertible transforms, and then leveraging inverse transformations to perform test-time augmentations.\n##### [layer wise learning rate](.\u002Fmodules\u002Flayer_wise_learning_rate.ipynb)\nThis notebook demonstrates how to select or filter out expected network layers and set customized learning rate values.\n##### [learning rate finder](.\u002Fmodules\u002Flearning_rate.ipynb)\nThis notebook demonstrates how to use `LearningRateFinder` API to tune the learning rate values for the network.\n##### [load_medical_images](.\u002Fmodules\u002Fload_medical_images.ipynb)\nThis notebook introduces how to easily load different formats of medical images in MONAI and execute many additional operations.\n##### [mednist_GAN_tutorial](.\u002Fmodules\u002Fmednist_GAN_tutorial.ipynb)\nThis notebook illustrates the use of MONAI for training a network to generate images from a random input tensor.\nA simple GAN is employed to do with a separate Generator and Discriminator networks.\n##### [mednist_GAN_workflow_dict](.\u002Fmodules\u002Fmednist_GAN_workflow_dict.ipynb)\nThis notebook shows the `GanTrainer`, a MONAI workflow engine for modularized adversarial learning. Train a medical image reconstruction network using the MedNIST hand CT scan dataset. Dictionary version.\n##### [mednist_GAN_workflow_array](.\u002Fmodules\u002Fmednist_GAN_workflow_array.ipynb)\nThis notebook shows the `GanTrainer`, a MONAI workflow engine for modularized adversarial learning. Train a medical image reconstruction network using the MedNIST hand CT scan dataset. Array version.\n##### [cross_validation_models_ensemble](.\u002Fmodules\u002Fcross_validation_models_ensemble.ipynb)\nThis tutorial shows how to leverage `CrossValidation`, `EnsembleEvaluator`, `MeanEnsemble` and `VoteEnsemble` modules in MONAI to set up cross validation and ensemble program.\n##### [nifti_read_example](.\u002Fmodules\u002Fnifti_read_example.ipynb)\nIllustrate reading NIfTI files and iterating over image patches of the volumes loaded from them.\n##### [network_api](.\u002Fmodules\u002Fnetwork_api.ipynb)\nThis tutorial illustrates the flexible network APIs and utilities.\n##### [postprocessing_transforms](.\u002Fmodules\u002Fpostprocessing_transforms.ipynb)\nThis notebook shows the usage of several postprocessing transforms based on the model output of spleen segmentation task.\n##### [public_datasets](.\u002Fmodules\u002Fpublic_datasets.ipynb)\nThis notebook shows how to quickly set up training workflow based on `MedNISTDataset` and `DecathlonDataset`, and how to create a new dataset.\n##### [tcia_csv_processing](.\u002Fmodules\u002Ftcia_csv_processing.ipynb)\nThis notebook shows how to load the TCIA data with CSVDataset from CSV file and extract information for TCIA data to fetch DICOM images based on REST API.\n##### [transforms_demo_2d](.\u002Fmodules\u002Ftransforms_demo_2d.ipynb)\nThis notebook demonstrates the image transformations on histology images using\n##### [UNet_input_size_constraints](.\u002Fmodules\u002FUNet_input_size_constraints.ipynb)\nThis tutorial shows how to determine a reasonable spatial size of the input data for MONAI UNet, which not only supports residual units, but also can use more hyperparameters (like `strides`, `kernel_size` and `up_kernel_size`) than the basic UNet implementation.\n##### [TorchIO, MONAI, PyTorch Lightning](.\u002Fmodules\u002FTorchIO_MONAI_PyTorch_Lightning.ipynb)\nThis notebook demonstrates how the three libraries from the official PyTorch Ecosystem can be used together to segment the hippocampus on brain MRIs from the Medical Segmentation Decathlon.\n##### [varautoencoder_mednist](.\u002Fmodules\u002Fvarautoencoder_mednist.ipynb)\nThis tutorial uses the MedNIST scan (or alternatively the MNIST) dataset to demonstrate MONAI's variational autoencoder class.\n##### [interpretability](.\u002Fmodules\u002Finterpretability)\nTutorials in this folder demonstrate model visualisation and interpretability features of MONAI. Currently, it consists of class activation mapping and occlusion sensitivity for 3D classification model visualisations and analysis.\n\n##### [Transform visualization](.\u002Fmodules\u002Ftransform_visualization.ipynb)\nThis tutorial shows several visualization approaches for 3D image during transform augmentation.\n\n#### [Auto3DSeg](.\u002Fauto3dseg\u002F)\nThis folder shows how to run the comprehensive Auto3DSeg pipeline with minimal inputs and customize the Auto3Dseg modules to meet different user requirements.\n\n#### \u003Cins>**Self-Supervised Learning**\u003C\u002Fins>\n##### [self_supervised_pretraining](self_supervised_pretraining\u002Fvit_unetr_ssl\u002Fssl_train.ipynb)\nThis tutorial shows how to construct a training workflow of self-supervised learning where unlabeled data is utilized. The tutorial shows how to train a model on TCIA dataset of unlabeled Covid-19 cases.\n\n##### [self_supervised_pretraining_based_finetuning](self_supervised_pretraining\u002Fvit_unetr_ssl\u002Fssl_finetune.ipynb)\nThis tutorial shows how to utilize pre-trained weights from the self-supervised learning framework where unlabeled data is utilized. This tutorial shows how to train a model of multi-class 3D segmentation using pretrained weights.\n\n#### [Generative Model](.\u002Fgeneration)\n##### [3D latent diffusion model](.\u002Fgeneration\u002F3d_ldm)\nThis tutorial shows the use cases of training and validating a 3D Latent Diffusion Model.\n\n##### [2D latent diffusion model](.\u002Fgeneration\u002F2d_ldm)\nThis tutorial shows the use cases of training and validating a 2D Latent Diffusion Model.\n\n##### [Brats 3D latent diffusion model](.\u002Fgeneration\u002F3d_ldm\u002FREADME.md)\nExample shows the use cases of training and validating a 3D Latent Diffusion Model on Brats 2016&2017 data, expanding on the above notebook.\n\n##### [MAISI 3D latent diffusion model](.\u002Fgeneration\u002Fmaisi\u002FREADME.md)\nExample shows the use cases of training and validating Nvidia MAISI (Medical AI for Synthetic Imaging) model, a 3D Latent Diffusion Model that can generate large CT images with paired segmentation masks, variable volume size and voxel size, as well as controllable organ\u002Ftumor size.\n\n##### [SPADE in VAE-GAN for Semantic Image Synthesis on 2D BraTS Data](.\u002Fgeneration\u002Fspade_gan)\nExample shows the use cases of applying SPADE, a VAE-GAN-based neural network for semantic image synthesis, to a subset of BraTS that was registered to MNI space and resampled to 2mm isotropic space, with segmentations obtained using Geodesic Information Flows (GIF).\n\n##### [Applying Latent Diffusion Models to 2D BraTS Data for Semantic Image Synthesis](.\u002Fgeneration\u002Fspade_ldm)\nExample shows the use cases of applying SPADE normalization to a latent diffusion model, following the methodology by Wang et al., for semantic image synthesis on a subset of BraTS registered to MNI space and resampled to 2mm isotropic space, with segmentations obtained using Geodesic Information Flows (GIF).\n\n##### [Diffusion Models for Implicit Image Segmentation Ensembles](.\u002Fgeneration\u002Fimage_to_image_translation)\nExample shows the use cases of how to use MONAI for 2D segmentation of images using DDPMs. The same structure can also be used for conditional image generation, or image-to-image translation.\n\n##### [Evaluate Realism and Diversity of the generated images](.\u002Fgeneration\u002Frealism_diversity_metrics)\nExample shows the use cases of using MONAI to evaluate the performance of a generative model by computing metrics such as Frechet Inception Distance (FID) and Maximum Mean Discrepancy (MMD) for assessing realism, as well as MS-SSIM and SSIM for evaluating image diversity.\n\n#### [VISTA2D](.\u002Fvista_2d)\nThis tutorial demonstrates how to train a cell segmentation model using the [MONAI](https:\u002F\u002Fmonai.io\u002F) framework and the [Segment Anything Model (SAM)](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fsegment-anything) on the [Cellpose dataset](https:\u002F\u002Fwww.cellpose.org\u002F).\nECHO°¡ ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù.\n","# MONAI 教程\n此仓库托管 MONAI 教程。\n\n### 1. 需求\n大多数示例和教程需要\n[matplotlib](https:\u002F\u002Fmatplotlib.org\u002F) 和 [Jupyter Notebook](https:\u002F\u002Fjupyter.org\u002F)。\n\n可以通过以下命令安装：\n\n```bash\npython -m pip install -U pip\npython -m pip install -U matplotlib\npython -m pip install -U notebook\n```\n\n部分示例可能需要可选依赖项。如果出现任何可选导入错误，\n请根据 MONAI 的[安装指南](https:\u002F\u002Fdocs.monai.io\u002Fen\u002Flatest\u002Finstallation.html)安装相关包。\n或者通过以下命令安装所有可选依赖项：\n\n```bash\npip install -r https:\u002F\u002Fraw.githubusercontent.com\u002FProject-MONAI\u002FMONAI\u002Fdev\u002Frequirements-dev.txt\n```\n\n#### 在 Colab 中运行笔记本\n\n大多数 Jupyter 笔记本都有“在 Colab 中打开”按钮。\n请右键单击该按钮，然后选择“在新标签页中打开链接”，即可启动包含相应笔记本内容的 Colab 页面。\n\n要通过 Colab 使用 GPU 资源，请务必将运行时类型更改为 `GPU`：\n\n1. 从 `Runtime` 菜单中选择 `Change runtime type`\n2. 在下拉菜单中选择 `GPU`\n3. 单击 `SAVE`\n这将重置笔记本，并可能会询问您是否是机器人（这些说明假定您不是）。\n\n在单元格中运行以下命令以验证设置是否成功，并查看您可以访问的硬件类型：\n\n```bash\n!nvidia-smi\n```\n\n#### Google Colab 设置（CUDA 12.x、PyTorch 2.6、MONAI 1.5）\n\n在 Google Colab 中，默认环境可能会导致与 MONAI 的版本冲突。\n为确保兼容性，请按以下方式显式安装 PyTorch 和 MONAI：\n\n# 安装带有 CUDA 12.4 的 PyTorch 2.6.0\npip install --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu124 \\\n  torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0\n\n# 安装 MONAI 及常用依赖项\npip install \"monai[all]\" nibabel pydicom ipywidgets==8.1.2\n\n\n### 已知问题及修复方法\n\n- Torchaudio 版本不匹配\n  Colab 默认可能自带 torchaudio 2.8.0，而它与 torch 2.6.0 不兼容。\n  安装上述版本可以解决此问题。\n\n- filelock 与 nni 冲突\n  某些预装软件包（如使用较新 filelock 的 pytensor）可能会产生冲突。\n  可以通过以下命令修复：\n\n  pip uninstall -y pytensor\n  pip install -U filelock\n\n- 工作进程过多警告\n  Colab 的 CPU 资源有限，较高的 num_workers 设置可能导致执行卡死。\n  建议在运行教程时使用 --num_workers=2，并调整笔记本中涉及数据加载器等地方的 `num_workers` 参数。\n\n\n### 快速烟雾测试\n\n安装完成后，可通过以下步骤验证环境是否正常：\n\ngit clone https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002Ftutorials.git\ncd tutorials\u002F3d_segmentation\u002Ftorch\npython -u unet_training_array.py --max_epochs 2 --batch_size 1 --num_workers 2\n\n如果日志显示训练损失逐渐下降且 Dice 分数提升，则说明设置正确。\n\n**注意：** 大多数情况下，用户可以直接在 Colab 笔记本中运行 MONAI 教程，无需额外安装。\n上述步骤主要用于解决安装额外包时可能出现的依赖冲突。\n\n#### 数据\n\n部分笔记本可能需要额外的数据。\n每个用户需自行检查数据集的内容及适用许可，并判断其是否适合预期用途。\n\n### 2. 问题与 bug\n\n- 如有关于 MONAI 使用的问题，请在 MONAI 主仓库的[讨论区](https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002FMONAI\u002Fdiscussions)提问。\n- 如发现 MONAI 功能相关的 bug，请在[主仓库](https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002FMONAI\u002Fissues)提交 issue。\n- 如遇到教程运行相关的 bug，请在[此仓库](https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002FTutorials\u002Fissues)提交 issue。\n\n### 3. 成为贡献者\n\n有关添加教程的详细信息，请参阅我们的[贡献指南](CONTRIBUTING.md)。\n\n### 4. 笔记本与示例列表\n#### \u003Cins>**2D 分类**\u003C\u002Fins>\n##### [mednist_tutorial](.\u002F2d_classification\u002Fmednist_tutorial.ipynb)\n本笔记本展示了如何轻松地将 MONAI 功能集成到现有的 PyTorch 程序中。\n它基于 MedNIST 数据集，非常适合作为初学者的教程。\n本教程还利用了 MONAI 内置的遮挡敏感性功能。\n\n#### \u003Cins>**2D 分割**\u003C\u002Fins>\n##### [torch 示例](.\u002F2d_segmentation\u002Ftorch)\n基于 UNet 和合成数据集的 2D 分割训练与评估示例。\n这些示例是标准的 PyTorch 程序，同时提供了基于字典和基于数组的实现版本。\n\n#### \u003Cins>**3D 分类**\u003C\u002Fins>\n##### [ignite 示例](.\u002F3d_classification\u002Fignite)\n基于 DenseNet3D 和 [IXI 数据集](https:\u002F\u002Fbrain-development.org\u002Fixi-dataset)的 3D 分类训练与评估示例。\n这些示例是 PyTorch Ignite 程序，同时提供了基于字典和基于数组的转换版本。\n##### [torch 示例](.\u002F3d_classification\u002Ftorch)\n基于 DenseNet3D 和 [IXI 数据集](https:\u002F\u002Fbrain-development.org\u002Fixi-dataset)的 3D 分类训练与评估示例。\n这些示例是标准的 PyTorch 程序，同时提供了基于字典和基于数组的转换版本。\n\n#### \u003Cins>**3D 回归**\u003C\u002Fins>\n##### [densenet_training_array.ipynb](.\u002F3d_regression\u002Fdensenet_training_array.ipynb)\n基于 DenseNet3D 和 [IXI 数据集](https:\u002F\u002Fbrain-development.org\u002Fixi-dataset)的 3D 回归训练与评估示例。\n\n#### \u003Cins>**3D分割**\u003C\u002Fins>\n##### [ignite示例](.\u002F3d_segmentation\u002Fignite)\n基于UNet3D和合成数据集的3D分割训练与评估示例。这些示例是PyTorch Ignite程序，同时支持基于字典和基于数组的数据变换。\n##### [torch示例](.\u002F3d_segmentation\u002Ftorch)\n基于UNet3D和合成数据集的3D分割训练、评估和推理示例。这些示例是标准的PyTorch程序，同样提供基于字典和基于数组的版本。\n##### [brats_segmentation_3d](.\u002F3d_segmentation\u002Fbrats_segmentation_3d.ipynb)\n本教程展示了如何基于[MSD脑肿瘤数据集](http:\u002F\u002Fmedicaldecathlon.com)构建多标签分割任务的训练流程，并将PyTorch模型转换为ONNX模型以进行推理和比较。\n##### [spleen_segmentation_3d_aim](.\u002F3d_segmentation\u002Fspleen_segmentation_3d_visualization_basic.ipynb)\n该笔记本说明了如何将MONAI与[`aimhubio\u002Faim`](https:\u002F\u002Fgithub.com\u002Faimhubio\u002Faim)结合使用。\n##### [spleen_segmentation_3d_lightning](.\u002F3d_segmentation\u002Fspleen_segmentation_3d_lightning.ipynb)\n该笔记本展示了如何将MONAI与[PyTorch Lightning](https:\u002F\u002Fgithub.com\u002FPyTorchLightning\u002Fpytorch-lightning)框架结合使用。\n##### [spleen_segmentation_3d](.\u002F3d_segmentation\u002Fspleen_segmentation_3d.ipynb)\n本笔记本是一个基于[MSD脾脏数据集](http:\u002F\u002Fmedicaldecathlon.com)的3D分割端到端训练与评估示例。\n该示例展示了MONAI模块在基于PyTorch的程序中的灵活性：\n- 针对基于字典的训练数据结构的变换。\n- 加载带有元数据的NIfTI图像。\n- 根据预期范围缩放医学图像强度。\n- 基于正负标签比例裁剪出一批平衡的图像块样本。\n- 缓存IO和变换以加速训练和验证。\n- 用于3D分割任务的3D UNet、Dice损失函数和Dice平均指标。\n- 滑动窗口推理。\n- 确定性训练以提高可重复性。\n##### [unet_segmentation_3d_ignite](.\u002F3d_segmentation\u002Funet_segmentation_3d_ignite.ipynb)\n本笔记本是一个基于合成数据集的3D分割端到端训练与评估示例。该示例是PyTorch Ignite程序，展示了MONAI的几个关键特性，特别是针对医疗领域的特定变换以及用于性能分析的事件处理器（日志记录、TensorBoard、MLFlow等）。\n##### [COVID 19-20挑战基线](.\u002F3d_segmentation\u002Fchallenge_baseline)\n此文件夹提供了针对[2020年COVID-19肺部CT病灶分割挑战赛](https:\u002F\u002Fcovid-segmentation.grand-challenge.org\u002FCOVID-19-20\u002F)（一项MICCAI认可的活动）的简单训练、验证和推理基线方法。\n##### [unetr_btcv_segmentation_3d](.\u002F3d_segmentation\u002Funetr_btcv_segmentation_3d.ipynb)\n本笔记本演示了如何使用BTCV挑战数据集，在多器官分割任务上构建UNETR的训练流程。\n##### [unetr_btcv_segmentation_3d_lightning](.\u002F3d_segmentation\u002Funetr_btcv_segmentation_3d_lightning.ipynb)\n本教程演示了如何将MONAI与[PyTorch Lightning](https:\u002F\u002Fwww.pytorchlightning.ai\u002F)框架结合使用，利用BTCV挑战数据集构建多器官分割任务中UNETR的训练流程。\n##### [vista3d](.\u002F3d_segmentation\u002Fvista3d)\n本教程展示了使用MONAI在[MSD脾脏数据集](http:\u002F\u002Fmedicaldecathlon.com)上微调VISTA3D的过程。如需深入了解，请访问[VISTA](https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002FVISTA)仓库。\n\n#### \u003Cins>**2D配准**\u003C\u002Fins>\n##### [使用mednist进行配准](.\u002F2d_registration\u002Fregistration_mednist.ipynb)\n本笔记本展示了一个快速演示，学习基于深度学习的`64 x 64` X光手部图像的仿射配准。\n\n#### \u003Cins>**3D配准**\u003C\u002Fins>\n##### [使用成对肺部CT进行3D配准](.\u002F3d_registration\u002Fpaired_lung_ct.ipynb)\n本教程展示了如何使用MONAI对同一患者在不同时间点采集的肺部CT体积进行配准。\n##### [使用不成对脑部MRI进行3D配准](.\u002F3d_registration\u002Flearn2reg_oasis_unpaired_brain_mr.ipynb)\n本教程介绍了如何开始使用MONAI中提供的通用配准框架`VoxelMorph`来配准不成对的脑部MRI体积。\n##### [DeepAtlas](.\u002Fdeep_atlas\u002Fdeep_atlas_tutorial.ipynb)\n本教程演示了如何使用MONAI同时训练配准和分割模型。DeepAtlas方法通过让两个模型相互作为弱监督学习的来源，特别适用于拥有大量未标注图像但仅有少量带分割标签图像的情况。该笔记本使用OASIS-1脑部MRI数据集中的3D图像。\n  \n#### \u003Cins>**Deepgrow**\u003C\u002Fins>\n##### [Deepgrow](.\u002Fdeepgrow)\n该示例展示了如何训练\u002F验证2D\u002F3D Deepgrow模型，同时也演示了如何对已训练的Deepgrow模型进行推理。\n  \n#### \u003Cins>**DeepEdit**\u003C\u002Fins>\n##### [DeepEdit](.\u002Fdeepedit\u002Fignite)\n该示例展示了如何训练\u002F测试DeepEdit模型。本教程包含一个笔记本，演示如何对预训练的DeepEdit模型进行推理。\n  \n#### \u003Cins>**部署**\u003C\u002Fins>\n##### [BentoML](.\u002Fdeployment\u002Fbentoml)\n这是一个简单的示例，展示了如何使用[BentoML](https:\u002F\u002Fwww.bentoml.ai\u002F)作为Web服务器来训练和部署MONAI网络，既可以本地使用BentoML仓库，也可以作为容器化服务。\n##### [Ray](.\u002Fdeployment\u002Fray)\n本示例利用先前笔记本中训练好的网络，演示如何使用[Ray](https:\u002F\u002Fdocs.ray.io\u002Fen\u002Fmaster\u002Fserve\u002Findex.html#rayserve)进行Web服务器部署。\n##### [Triton](.\u002Fdeployment\u002FTriton\u002F)\n本示例通过在MedNIST分类问题上使用Triton服务器和Python客户端来演示MONAI的应用。演示内容自包含，README文件解释了如何使用Triton“后端”将MONAI代码注入到服务器中。[请参阅Triton推理服务器\u002FPython后端文档](https:\u002F\u002Fgithub.com\u002Ftriton-inference-server\u002Fpython_backend#usage)。\n  \n#### \u003Cins>**实验管理**\u003C\u002Fins>\n##### [Aim](.\u002Fexperiment_management\u002Fspleen_segmentation_aim.ipynb)\n这是一个使用[Aim](https:\u002F\u002Faimstack.io\u002Faim-monai-tutorial\u002F)进行实验管理的示例，以3D脾脏分割为例。\n##### [MLFlow](.\u002Fexperiment_management\u002Fspleen_segmentation_mlflow.ipynb)\n这是一个使用[MLFlow](https:\u002F\u002Fwww.mlflow.org\u002Fdocs\u002Flatest\u002Ftracking.html)进行实验管理的示例，以3D脾脏分割为例。\n##### [MONAI bundle集成MLFlow](.\u002Fexperiment_management\u002Fbundle_integrate_mlflow.ipynb)\n该示例展示了如何轻松启用并自定义MONAI bundle中的MLFlow功能，以实现实验管理。\n##### [ClearML](.\u002Fexperiment_management\u002Funet_segmentation_3d_ignite_clearml.ipynb)\n这是一个使用[ClearML](https:\u002F\u002Fclear.ml\u002Fdocs\u002Flatest\u002Fdocs\u002F)进行实验管理的示例，以UNet的3D分割为例。\n\n#### \u003Cins>**联邦学习**\u003C\u002Fins>\n##### [NVFlare](.\u002Ffederated_learning\u002Fnvflare)\n这些示例展示了如何使用 [NVFlare](https:\u002F\u002Fpypi.org\u002Fproject\u002Fnvflare\u002F) 和基于 MONAI 的训练器来训练联邦学习模型。\n\n##### [OpenFL](.\u002Ffederated_learning\u002Fopenfl)\n这些示例展示了如何基于 [OpenFL](https:\u002F\u002Fgithub.com\u002Fintel\u002Fopenfl) 和 MONAI 来训练联邦学习模型。\n\n##### [Substra](.\u002Ffederated_learning\u002Fsubstra)\n该示例展示了如何在联邦学习平台 Substra 上执行 3D 分割的 PyTorch 教程。\n\n##### [乳腺密度 FL 挑战赛](.\u002Ffederated_learning\u002Fbreast_density_challenge)\n这是 MICCAI 2022 [ACR-NVIDIA-NCI 乳腺密度 FL 挑战赛](http:\u002F\u002Fbreastdensityfl.acr.org) 中使用的参考实现。\n\n#### \u003Cins>**数字病理学**\u003C\u002Fins>\n##### [全切片肿瘤检测](.\u002Fpathology\u002Ftumor_detection)\n该示例展示了如何在全切片组织病理学图像上训练和评估基于补丁分类的肿瘤检测模型。\n\n##### [全切片肿瘤检测性能分析](.\u002Fpathology\u002Ftumor_detection)\n该示例展示了如何使用 MONAI NVTX 转换器标记并分析数字病理学全切片肿瘤检测流程中的预处理和后处理转换。\n\n##### [多实例学习 WSI 分类](.\u002Fpathology\u002Fmultiple_instance_learning)\n这是一个基于前列腺组织病理学全切片图像（WSI）的多实例学习（MIL）分类示例。\n\n##### [NuClick 注释](.\u002Fpathology\u002Fnuclick#nuclick-interaction-model)\n该笔记本演示了带有交互式注释的病理学训练和推理流程示例。NuClick 用于勾勒细胞核、细胞以及描绘腺体轮廓的波浪线。\n\n#### [HoVerNet：核分割与分类任务](.\u002Fpathology\u002Fhovernet)\n本教程演示了如何使用 CoNSep 数据集构建 [HoVerNet](https:\u002F\u002Fwww.sciencedirect.com\u002Fscience\u002Farticle\u002Fabs\u002Fpii\u002FS1361841519301045) 在核分割与分类任务上的训练流程。\n\n##### [细胞核分类](.\u002Fpathology\u002Fnuclick#nuclei-classification-model)\n该笔记本演示了带有交互式注释的病理学训练和推理流程示例。NuClick 用于勾勒细胞核、细胞以及描绘腺体轮廓的波浪线。\n\n#### \u003Cins>**加速**\u003C\u002Fins>\n##### [fast_model_training_guide](.\u002Facceleration\u002Ffast_model_training_guide.md)\n本文档介绍了如何对训练流程进行性能剖析、如何分析数据集并选择合适的算法，以及如何优化单 GPU、多 GPU 甚至多节点环境下的 GPU 利用率。\n\n##### [distributed_training](.\u002Facceleration\u002Fdistributed_training)\n这些示例展示了如何基于三种不同框架执行分布式训练和评估：\n- PyTorch 原生 `DistributedDataParallel` 模块配合 `torch.distributed.launch`。\n- Horovod API 配合 `horovodrun`。\n- PyTorch ignite 和 MONAI 工作流。\n\n这些示例可以在多个分布式节点上运行，每个节点配备多块 GPU 设备。\n\n##### [automatic_mixed_precision](.\u002Facceleration\u002Fautomatic_mixed_precision.ipynb)\n该笔记本比较了启用与禁用 AMP 时的训练速度和内存使用情况。\n\n##### [dataset_type_performance](.\u002Facceleration\u002Fdataset_type_performance.ipynb)\n该笔记本比较了 `Dataset`、`CacheDataset` 和 `PersistentDataset` 的性能。这些类在数据存储方式（内存或磁盘）以及应用转换的时间点上有所不同。\n\n##### [fast_training_tutorial](.\u002Facceleration\u002Ffast_training_tutorial.ipynb)\n本教程比较了基于 NVIDIA GPU 设备和最新 CUDA 库的纯 PyTorch 程序与经过 MONAI 优化后的程序的训练性能。优化方法主要包括：`AMP`、`CacheDataset`、`GPU 转换`、`ThreadDataLoader`、`DiceCELoss` 和 `SGD`。\n\n##### [threadbuffer_performance](.\u002Facceleration\u002Fthreadbuffer_performance.ipynb)\n该笔记本演示了 `ThreadBuffer` 类的使用，它可以在单独的线程中生成训练过程中的数据批次。\n\n##### [transform_speed](.\u002Facceleration\u002Ftransform_speed.ipynb)\n该笔记本说明了读取 NIfTI 文件的过程，并测试了不同转换在不同设备上的速度。\n\n##### [TensorRT 推理加速](.\u002Facceleration\u002FTensorRT_inference_acceleration.ipynb)\n该笔记本展示了如何使用 TensorRT 加速模型，以获得更低的推理延迟。\n\n#### \u003Cins>**模型库**\u003C\u002Fins>\n##### [easy_integrate_bundle](.\u002Fmodel_zoo\u002Fapp_integrate_bundle)\n本教程展示了一种简单的集成应用，指导用户如何将现有包集成到自己的项目中。只需更改数据路径和包所在路径，即可进行训练和集成推理。\n\n#### \u003Cins>**计算机辅助介入**\u003C\u002Fins>\n##### [视频分割](.\u002Fcomputer_assisted_intervention\u002Fvideo_seg.ipynb)\n本教程展示了如何训练一个手术器械分割模型，以在给定图像中定位器械。此外，还构建了一个端到端视频器械分割的示例流程，包含视频输入和输出。\n\n##### [内窥镜体内分类](.\u002Fcomputer_assisted_intervention\u002Fendoscopic_inbody_classification.ipynb)\n本教程展示了基于相应预训练包对内窥镜体内分类模型进行微调的流程。\n\n#### \u003Cins>**Hugging Face**\u003C\u002Fins>\n##### [MONAI Hugging Face 流水线](.\u002Fhugging_face\u002Fhugging_face_pipeline_for_monai.ipynb)\n本教程演示了如何将现有的 MONAI 模型工作流封装成 Hugging Face 流水线，这种流水线在开源社区中被广泛采用。\n\n##### [针对 Hugging Face 流水线的微调](.\u002Fhugging_face\u002Ffinetune_vista3d_for_hugging_face_pipeline.ipynb)\n本教程解释了微调 VISTA3D 模型并将其集成到 Hugging Face 流水线中进行推理的过程。\n\n#### \u003Cins>**模块**\u003C\u002Fins>\n##### [bundle](.\u002Fbundle)\n关于 MONAI 包功能的入门教程及具体的训练\u002F推理示例。\n\n##### [competitions](.\u002Fcompetitions)\n基于 MONAI 的医疗影像竞赛解决方案。\n\n##### [engines](.\u002Fmodules\u002Fengines)\n基于 UNet3D 和合成数据集的 3D 分割训练和评估示例，使用 MONAI 工作流，其中包含引擎、事件处理器和后处理转换。此外，还有一个医学图像生成对抗网络的 GAN 训练和评估示例。简易运行的训练脚本使用 `GanTrainer` 来训练一个 2D CT 扫描重建网络。评估脚本则从已训练好的网络中生成随机样本。\n\n这些示例基于 MONAI 工作流构建，主要包括：训练器\u002F评估器、处理器、后处理转换等。\n##### [3D图像变换](.\u002Fmodules\u002F3d_image_transforms.ipynb)\n本笔记本演示了对体积图像的各类变换操作。\n##### [2D推理3D体积](.\u002Fmodules\u002F2d_inference_3d_volume.ipynb)\n本教程展示了当需要将3D体积输入逐切片地提供给2D模型，并最终聚合为3D体积时，如何使用 MONAI 的 `SlidingWindowInferer`。\n##### [自编码器MedNIST](.\u002Fmodules\u002Fautoencoder_mednist.ipynb)\n本教程使用 MedNIST 手部CT扫描数据集来演示 MONAI 的自编码器类。自编码器既可用于身份编码\u002F解码（即输入什么就应得到什么），也可用于去模糊和去噪。\n##### [批量输出转换](.\u002Fmodules\u002Fbatch_output_transform.ipynb)\n本教程解释并演示如何设置处理器的 `batch_transform` 和 `output_transform`，以配合 MONAI 引擎工作。\n##### [弯曲能量扩散损失说明](.\u002Fmodules\u002Fbending_energy_diffusion_loss_notes.ipynb)\n本笔记本演示了何时以及如何计算归一化的弯曲能量和扩散损失。\n##### [计算指标](.\u002Fmodules\u002Fcompute_metric.py)\n示例展示了如何利用 PyTorch 多进程支持，从已保存的预测结果和标签中计算指标。\n##### [CSV数据集](.\u002Fmodules\u002Fcsv_datasets.ipynb)\n本教程展示了 `CSVDataset` 和 `CSVIterableDataset` 的用法，包括加载多个 CSV 文件并执行后处理逻辑。\n##### [批处理解耦](.\u002Fmodules\u002Fdecollate_batch.ipynb)\n本教程展示了如何将批次数据解耦，以简化后处理转换，并执行更灵活的后续操作。\n##### [图像数据集](.\u002Fmodules\u002Fimage_dataset.ipynb)\n本笔记本介绍了 `monai.data.ImageDataset` 模块的基本用法。\n##### [dynUNet教程](.\u002Fmodules\u002Fdynunet_pipeline)\n本教程展示了如何在 MONAI 中重新实现 dynUNet，并利用它在所有10个Decathlon数据集上训练3D分割任务。\n##### [集成第三方变换](.\u002Fmodules\u002Fintegrate_3rd_party_transforms.ipynb)\n本教程展示了如何将第三方变换集成到 MONAI 程序中。主要演示了来自 BatchGenerator、TorchIO、Rising 和 ITK 的变换。\n##### [逆变换与测试时增强](.\u002Fmodules\u002Finverse_transforms_and_test_time_augmentations.ipynb)\n本笔记本演示了可逆变换的使用，以及如何利用逆变换进行测试时增强。\n##### [分层学习率](.\u002Fmodules\u002Flayer_wise_learning_rate.ipynb)\n本笔记本演示了如何选择或过滤出期望的网络层，并为其设置自定义的学习率值。\n##### [学习率查找器](.\u002Fmodules\u002Flearning_rate.ipynb)\n本笔记本演示了如何使用 `LearningRateFinder` API 来调整网络的学习率。\n##### [加载医学图像](.\u002Fmodules\u002Fload_medical_images.ipynb)\n本笔记本介绍了如何在 MONAI 中轻松加载不同格式的医学图像，并执行多种附加操作。\n##### [MedNIST GAN教程](.\u002Fmodules\u002Fmednist_GAN_tutorial.ipynb)\n本笔记本说明了如何使用 MONAI 训练一个网络，使其能够根据随机输入张量生成图像。这里采用了一个简单的GAN架构，包含独立的生成器和判别器网络。\n##### [MedNIST GAN工作流字典版](.\u002Fmodules\u002Fmednist_GAN_workflow_dict.ipynb)\n本笔记本展示了用于模块化对抗学习的 MONAI 工作流引擎 `GanTrainer`。使用 MedNIST 手部CT扫描数据集训练医学图像重建网络。字典版本。\n##### [MedNIST GAN工作流数组版](.\u002Fmodules\u002Fmednist_GAN_workflow_array.ipynb)\n本笔记本展示了用于模块化对抗学习的 MONAI 工作流引擎 `GanTrainer`。使用 MedNIST 手部CT扫描数据集训练医学图像重建网络。数组版本。\n##### [交叉验证与模型集成](.\u002Fmodules\u002Fcross_validation_models_ensemble.ipynb)\n本教程展示了如何利用 MONAI 中的 `CrossValidation`、`EnsembleEvaluator`、`MeanEnsemble` 和 `VoteEnsemble` 模块，搭建交叉验证和集成程序。\n##### [NIfTI文件读取示例](.\u002Fmodules\u002Fnifti_read_example.ipynb)\n演示如何读取 NIfTI 文件，并遍历从中加载的体积图像切片。\n##### [网络API](.\u002Fmodules\u002Fnetwork_api.ipynb)\n本教程展示了灵活的网络API和实用工具。\n##### [后处理变换](.\u002Fmodules\u002Fpostprocessing_transforms.ipynb)\n本笔记本展示了基于脾脏分割任务模型输出的几种后处理变换的用法。\n##### [公开数据集](.\u002Fmodules\u002Fpublic_datasets.ipynb)\n本笔记本展示了如何基于 `MedNISTDataset` 和 `DecathlonDataset` 快速搭建训练流程，以及如何创建新的数据集。\n##### [TCIA CSV处理](.\u002Fmodules\u002Ftcia_csv_processing.ipynb)\n本笔记本展示了如何使用 CSVDataset 从CSV文件加载TCIA数据，并提取信息以便通过REST API获取DICOM图像。\n##### [2D变换演示](.\u002Fmodules\u002Ftransforms_demo_2d.ipynb)\n本笔记本演示了使用……对组织学图像进行的图像变换。\n##### [UNet输入尺寸约束](.\u002Fmodules\u002FUNet_input_size_constraints.ipynb)\n本教程展示了如何为 MONAI UNet 确定合理的输入数据空间尺寸，该UNet不仅支持残差单元，还可以使用比基础UNet实现更多的超参数（如 `strides`、`kernel_size` 和 `up_kernel_size`）。\n##### [TorchIO、MONAI、PyTorch Lightning](.\u002Fmodules\u002FTorchIO_MONAI_PyTorch_Lightning.ipynb)\n本笔记本演示了如何将来自官方 PyTorch 生态系统的这三款库协同使用，以对来自 Medical Segmentation Decathlon 的脑部MRI图像进行海马体分割。\n##### [变分自编码器MedNIST](.\u002Fmodules\u002Fvarautoencoder_mednist.ipynb)\n本教程使用 MedNIST 扫描数据集（或MNIST数据集）来演示 MONAI 的变分自编码器类。\n##### [可解释性](.\u002Fmodules\u002Finterpretability)\n本文件夹中的教程展示了 MONAI 的模型可视化和可解释性功能。目前包括针对3D分类模型的类激活映射和遮挡敏感性分析。\n\n##### [变换可视化](.\u002Fmodules\u002Ftransform_visualization.ipynb)\n本教程展示了在变换增强过程中对3D图像的几种可视化方法。\n\n#### [Auto3DSeg](.\u002Fauto3dseg\u002F)\n本文件夹展示了如何使用最少的输入运行全面的 Auto3DSeg 流程，并根据不同的用户需求自定义 Auto3Dseg 模块。\n\n#### \u003Cins>**自监督学习**\u003C\u002Fins>\n##### [self_supervised_pretraining](self_supervised_pretraining\u002Fvit_unetr_ssl\u002Fssl_train.ipynb)\n本教程展示了如何构建一个利用无标签数据的自监督学习训练流程。教程演示了如何在TCIA数据集上对无标签的新冠肺炎病例进行模型训练。\n\n##### [self_supervised_pretraining_based_finetuning](self_supervised_pretraining\u002Fvit_unetr_ssl\u002Fssl_finetune.ipynb)\n本教程展示了如何利用基于无标签数据的自监督学习框架中预训练得到的权重。教程演示了使用预训练权重进行多类别三维分割任务的模型训练方法。\n\n#### [生成模型](.\u002Fgeneration)\n##### [3D 潜在扩散模型](.\u002Fgeneration\u002F3d_ldm)\n本教程展示了训练和验证3D潜在扩散模型的应用场景。\n\n##### [2D 潜在扩散模型](.\u002Fgeneration\u002F2d_ldm)\n本教程展示了训练和验证2D潜在扩散模型的应用场景。\n\n##### [Brats 3D 潜在扩散模型](.\u002Fgeneration\u002F3d_ldm\u002FREADME.md)\n示例展示了在Brats 2016和2017数据上训练和验证3D潜在扩散模型的应用场景，是对上述笔记本内容的扩展。\n\n##### [MAISI 3D 潜在扩散模型](.\u002Fgeneration\u002Fmaisi\u002FREADME.md)\n示例展示了训练和验证Nvidia MAISI（用于合成成像的医学人工智能）模型的应用场景，该模型是一种3D潜在扩散模型，能够生成带有配对分割掩码的大尺寸CT图像，支持可变的体积大小和体素分辨率，并且可以控制器官或肿瘤的大小。\n\n##### [SPADE 在VAE-GAN中的应用：用于2D BraTS数据的语义图像合成](.\u002Fgeneration\u002Fspade_gan)\n示例展示了将基于VAE-GAN的语义图像合成神经网络SPADE应用于BraTS数据子集的方法。该子集已注册到MNI空间并重采样为2mm各向同性分辨率，其分割结果是通过测地信息流（GIF）获得的。\n\n##### [将潜在扩散模型应用于2D BraTS数据以实现语义图像合成](.\u002Fgeneration\u002Fspade_ldm)\n示例展示了按照Wang等人的方法，将SPADE归一化技术应用于潜在扩散模型，从而在已注册到MNI空间并重采样为2mm各向同性分辨率的BraTS数据子集上进行语义图像合成，其分割结果同样由测地信息流（GIF）提供。\n\n##### [用于隐式图像分割集成的扩散模型](.\u002Fgeneration\u002Fimage_to_image_translation)\n示例展示了如何使用MONAI结合DDPMs对图像进行2D分割。同样的结构也可以用于条件图像生成或图像到图像的转换任务。\n\n##### [评估生成图像的真实性和多样性](.\u002Fgeneration\u002Frealism_diversity_metrics)\n示例展示了如何使用MONAI通过计算弗雷歇起始距离（FID）、最大均值差异（MMD）等指标来评估生成模型的真实性，以及使用MS-SSIM和SSIM来评估图像的多样性。\n\n#### [VISTA2D](.\u002Fvista_2d)\n本教程演示了如何使用[MONAI](https:\u002F\u002Fmonai.io\u002F)框架和[Segment Anything Model (SAM)](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fsegment-anything)，基于[Cellpose数据集](https:\u002F\u002Fwww.cellpose.org\u002F)训练细胞分割模型。\nECHO°¡ ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù.","# MONAI Tutorials 快速上手指南\n\n本指南帮助中国开发者快速配置并运行 MONAI 官方教程，涵盖环境搭建、安装步骤及基础验证。\n\n## 1. 环境准备\n\n在开始之前，请确保您的开发环境满足以下基本要求：\n\n*   **操作系统**：Linux, macOS 或 Windows (推荐 Linux 以获得最佳兼容性)\n*   **Python 版本**：建议 Python 3.8+\n*   **核心依赖**：\n    *   [Jupyter Notebook](https:\u002F\u002Fjupyter.org\u002F)：用于运行交互式教程。\n    *   [Matplotlib](https:\u002F\u002Fmatplotlib.org\u002F)：用于数据可视化。\n*   **硬件加速（可选但推荐）**：如需运行 3D 分割或训练任务，建议使用支持 CUDA 的 NVIDIA GPU。\n\n## 2. 安装步骤\n\n### 基础依赖安装\n首先升级 `pip` 并安装核心工具：\n\n```bash\npython -m pip install -U pip\npython -m pip install -U matplotlib\npython -m pip install -U notebook\n```\n\n### 安装 MONAI 及可选依赖\n根据您的需求选择以下一种方式安装：\n\n**方式 A：按需安装（推荐）**\n如果遇到导入错误，请参考 [MONAI 安装指南](https:\u002F\u002Fdocs.monai.io\u002Fen\u002Flatest\u002Finstallation.html) 安装特定包。\n\n**方式 B：安装所有可选依赖**\n一次性安装开发所需的所有依赖包（注意：国内网络环境下下载可能较慢，建议配置镜像源）：\n\n```bash\n# 使用清华镜像源加速安装（推荐国内用户）\npip install -r https:\u002F\u002Fraw.githubusercontent.com\u002FProject-MONAI\u002FMONAI\u002Fdev\u002Frequirements-dev.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### Google Colab 用户专属配置\n如果您在 Google Colab 中运行，默认环境可能存在版本冲突。请显式安装兼容的 PyTorch 2.6 和 MONAI 1.5：\n\n```bash\n# Install PyTorch 2.6.0 with CUDA 12.4\npip install --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu124 \\\n  torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0\n\n# Install MONAI and common dependencies\npip install \"monai[all]\" nibabel pydicom ipywidgets==8.1.2\n```\n*注意：在 Colab 中使用时，请务必将运行时类型更改为 `GPU` (Runtime -> Change runtime type -> GPU)。*\n\n## 3. 基本使用\n\n### 获取教程代码\n克隆官方教程仓库到本地：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002Ftutorials.git\ncd tutorials\n```\n\n### 运行快速烟雾测试 (Smoke Test)\n运行一个简单的 3D 分割训练脚本，验证环境是否配置正确。该脚本将运行 2 个 epoch，使用小批量数据以节省时间。\n\n```bash\ncd 3d_segmentation\u002Ftorch\npython -u unet_training_array.py --max_epochs 2 --batch_size 1 --num_workers 2\n```\n\n**验证成功标准：**\n如果日志中显示训练损失（training loss）逐渐下降，并输出了 Dice 分数，则说明环境配置成功。\n\n### 直接使用 Jupyter Notebook\n大多数教程位于各个子目录下的 `.ipynb` 文件中。启动 Jupyter Notebook 即可直接浏览和运行：\n\n```bash\n# 在 tutorials 根目录下执行\njupyter notebook\n```\n*提示：许多 Notebook 文件顶部包含 \"Open in Colab\" 按钮，右键点击选择在新标签页打开，即可直接在云端运行。*\n\n### 数据说明\n部分教程需要额外的数据集（如 MedNIST, IXI, MSD 等）。请根据具体 Notebook 中的说明下载数据，并务必检查数据集的许可协议以确保符合您的使用场景。","某三甲医院影像科算法工程师正尝试构建一个基于深度学习的肺部结节 3D 分割模型，以辅助医生进行早期癌症筛查。\n\n### 没有 tutorials 时\n- **环境配置陷入死循环**：面对 PyTorch、CUDA 版本与 MONAI 库之间复杂的依赖冲突，工程师花费数天调试本地环境，却因 `torchaudio` 不匹配或 `filelock` 冲突反复报错，无法运行第一行代码。\n- **数据预处理从零造轮子**：医疗影像特有的 NIfTI\u002FDICOM 格式解析、三维数据归一化及增强操作缺乏标准参考，需手动编写大量易错代码，导致数据加载效率极低。\n- **模型训练无从下手**：不清楚如何针对 3D 医学图像调整 U-Net 架构参数，对于显存受限时的 `num_workers` 设置毫无头绪，常因进程冻结导致训练中断。\n- **验证指标缺失**：缺乏针对医疗场景的 Dice 系数等专用评估代码，难以量化模型效果，无法判断训练是否收敛。\n\n### 使用 tutorials 后\n- **一键云端启动**：直接通过 Colab 链接打开预置好的 3D 分割示例，利用官方提供的安装脚本自动解决 CUDA 12.x 与 PyTorch 2.6 的兼容问题，分钟级完成环境搭建。\n- **复用标准化流程**：直接调用教程中成熟的 `LoadImage` 和 `RandFlipd` 等变换组件，快速处理肺部 CT 数据，确保预处理符合医学影像规范。\n- **参数调优有据可依**：参考官方针对 Colab 资源限制推荐的 `num_workers=2` 设置及批量大小策略，顺利跑通全流程并观察到训练损失稳步下降。\n- **即时效果反馈**：内置的烟雾测试（smoke test）脚本自动输出 Dice 评分，快速验证了模型架构的正确性与数据流水线的通畅性。\n\ntutorials 将原本需要数周的环境搭建与原型验证工作压缩至几小时，让医疗 AI 开发者能专注于核心算法优化而非底层基建。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FProject-MONAI_tutorials_328d5a3d.png","Project-MONAI","Project MONAI","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FProject-MONAI_0276102d.png","AI Toolkit for Healthcare Imaging",null,"ProjectMONAI","https:\u002F\u002Fproject-monai.github.io\u002F","https:\u002F\u002Fgithub.com\u002FProject-MONAI",[81,85,89,93],{"name":82,"color":83,"percentage":84},"Jupyter Notebook","#DA5B0B",98.5,{"name":86,"color":87,"percentage":88},"Python","#3572A5",1.4,{"name":90,"color":91,"percentage":92},"Shell","#89e051",0.1,{"name":94,"color":95,"percentage":96},"Dockerfile","#384d54",0,2428,781,"2026-04-06T18:23:41","Apache-2.0","未说明","非必需（CPU 可运行），若使用 GPU 推荐在 Colab 中切换为 GPU 运行时；示例配置包含 CUDA 12.4；Colab 资源有限，高 num_workers 可能导致冻结",{"notes":104,"python":101,"dependencies":105},"大多数教程可直接在 Google Colab 中运行，无需本地安装。若在 Colab 使用 GPU，需手动将运行时类型更改为'GPU'。为解决版本冲突，建议显式安装 PyTorch 2.6.0 (CUDA 12.4) 和 MONAI 1.5。已知问题包括 torchaudio 版本不匹配及 filelock 与 nni 冲突，需按文档执行卸载\u002F更新操作。由于 Colab CPU 资源有限，运行教程时建议将 num_workers 参数设置为 2 以避免执行冻结。部分笔记本需要额外数据集，用户需自行确认数据许可。",[106,82,107,108,109,110,111,112,113],"matplotlib","torch==2.6.0","torchvision==0.21.0","torchaudio==2.6.0","monai[all]","nibabel","pydicom","ipywidgets==8.1.2",[13,14],[116,117,118,119,120],"monai","monai-tutorials","pytorch","jupyter-notebook","monai-workflows","2026-03-27T02:49:30.150509","2026-04-07T08:08:50.625973",[124,129,134,139,144,149],{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},21306,"在使用 ViT 进行 3D 脑图像分类时遇到 'cross_entropy_loss' 输入必须是 Tensor 而不是元组的错误，或者准确率停滞在 50% 左右，该如何解决？","首先检查分类输出在计算准确率前是否为 0-1 范围内的有效概率，确认 ViT 骨干网络末端使用的激活函数是否正确。如果损失趋势合理但准确率停滞（如 50%），请尝试调整学习率（例如 1e-5, 1e-6, 1e-7）。此外，确保在数据变换中正确使用了 ResizeWithPadOrCrop 等预处理步骤以匹配模型输入要求。","https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002Ftutorials\u002Fissues\u002F464",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},21307,"在 Colab 或 Jupyter Notebook 中运行 Auto3Dseg 模型训练时报错无法启动，可能是什么原因？","这通常是由于数据路径配置错误导致的。请在代码单元格中尝试验证路径是否正确，例如使用以下命令测试加载图像：\nfrom monai.transforms import LoadImage\ndata_path = \".\u002FimagesTs\u002Fhippocampus_267.nii.gz\"  # 替换为您 JSON 文件中的实际路径\ntest = LoadImage(image_only=True)(data_path)\n如果在命令行正常但在 Jupyter 中报错，可能是环境变量不同，请确保在 Jupyter 环境中执行相同的路径验证命令。","https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002Ftutorials\u002Fissues\u002F1224",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},21308,"训练脑肿瘤分割模型时出现 'ValueError: not enough values to unpack (expected 2, got 1)' 错误怎么办？","该错误通常是因为 MONAI 版本更新导致 API 变化（特别是 0.6 版本及以上）。维护者已更新所有示例和教程以适配新版本。建议拉取最新的教程代码（参考 PR #246 的更新内容），确保使用的 dice_metric 返回值处理方式与当前安装的 MONAI 版本兼容。如果问题依旧，请检查是否混用了旧版教程代码和新版库。","https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002Ftutorials\u002Fissues\u002F78",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},21309,"LUNA16 数据集中的边界框（Box）坐标与图像头文件中的偏移量（offsets）看起来不一致，坐标似乎超出了图像范围，这是为什么？","这是因为提供的边界框坐标已经是图像坐标系（image coordinate），而不是世界坐标系（world coordinate），因此不需要再进行从世界坐标到图像坐标的转换。在构建数据变换管道时，可以直接加载并使用这些坐标。示例代码如下：\ntrain_transforms = Compose([\n    LoadImaged(keys=[image_key], meta_key_postfix=\"meta_dict\"),\n    EnsureChannelFirstd(keys=[image_key]),\n    EnsureTyped(keys=[image_key, box_key], dtype=torch.float32),\n    ConvertBoxToStandardModed(box_keys=[box_key], mode=gt_box_mode),\n    # 其他变换...\n])\n无需额外处理偏移量即可直接使用。","https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002Ftutorials\u002Fissues\u002F1278",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},21310,"向 MONAI 教程仓库贡献新教程时，需要遵循哪些规范和流程？","贡献者需遵循以下主要规范：\n1. 提交 PR 前请先创建 Issue 讨论，并在自己的 Fork 仓库中创建分支。\n2. 代码提交需签名（git commit -s）并包含许可\u002F版权信息（脚本在顶部，Notebook 在第一个 Markdown 块）。\n3. 每个 Notebook 必须包含标准单元格块：\"Setup environment\"（包含 pip install 命令）和 \"Setup imports\"（导入所有库并以 monai.util.print_config() 结尾）。\n4. 限制文本输出行数（建议不超过 50 行），避免提交大文件（如数据集文件或超过 5M 的 Notebook）。\n5. 每个项目文件夹下都应包含 README.md，若使用特定数据集需提供链接及许可说明。","https:\u002F\u002Fgithub.com\u002FProject-MONAI\u002Ftutorials\u002Fissues\u002F1119",{"id":150,"question_zh":151,"answer_zh":152,"source_url":148},21311,"如何在本地环境中测试对教程文件的修改以确保符合 CI\u002FCD 要求？","贡献者应在本地环境中模拟 CI 检查。首先确保安装了 pre-commit 工具并运行检查，验证代码风格。其次，按照教程中的 \"Setup environment\" 步骤安装依赖，运行整个 Notebook 或脚本，确保无报错且输出符合预期（如无过长的文本输出）。最后，检查是否已为每个涉及的文件夹更新了 README.md，并确认没有包含私有信息或未授权的大文件。",[]]