除 NumPy 和 PyTorch 外还有大量可选依赖,需按需自行安装;PyTorch 仅支持当前版本及前三个小版本,版本不匹配可能出问题;Docker 镜像需带 --gpus all 才能用 GPU。
MONAI
Project-MONAIApache-2.0活跃维护基于 PyTorch 的医学影像深度学习工具包,提供数据加载、预处理、网络结构和评估等组件,帮研究者快速搭建医疗影像 AI 流程。
AI Toolkit for Healthcare Imaging
pip install monaiREADME 未说明具体显存或 GPU 型号要求;依赖 PyTorch,官方 Docker 镜像运行示例使用 --gpus all,说明可走 GPU 加速路线。
基于 PyTorch 的医疗影像深度学习开源框架,提供端到端训练流程
基于 PyTorch 的医学影像深度学习工具包,提供数据加载、预处理、网络结构和评估等组件,帮研究者快速搭建医疗影像 AI 流程。
核心能力
- 灵活预处理多维医学影像数据
- 提供可组合、可移植的 API 便于集成
- 内置医疗影像专用网络、损失与评估指标
- 支持多 GPU 多节点数据并行训练
- 提供 MONAI Bundle 格式与 Model Zoo 共享模型
容易踩的坑
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
- 1.6.1MONAI 1.6.1最新正式版2026-09-27 · 2026-09-27 19:34 UTC
What's Changed
- Update Weekly Preview Version by @ericspod in https://github.com/Project-MONAI/MONAI/pull/8917
- Add docstring note that Transpose/Transposed do not update the affine matrix by @Akarsh-Doki in https://github.com/Project-MONAI/MONAI/pull/8888
- Fix nnUNet test directory leakage into current working directory by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8887
- ci: mute dynamic warningregistry logs noise in pytest suite by @Priyanshu31102003 in https://github.com/Project-MONAI/MONAI/pull/8893
- tests: remove duplicate and dead test cases by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8896
- Add explicit spatial_ndim tracking to MetaTensor by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8765
- Improve Affine transform documentation and add compute_w_affine tests by @engmohamedsalah in https://github.com/Project-MONAI/MONAI/pull/8727
- fix: update Dockerfile and requirements-dev.txt for MONAI 1.6 tutorial compatibility by @garciadias in https://github.com/Project-MONAI/MONAI/pull/8912
- Fix division by zero in clDice loss harmonic mean by @Mr-Neutr0n in https://github.com/Project-MONAI/MONAI/pull/8739
- fix(losses): register buffers in GlobalMutualInformationLoss by @AlexanderSanin in https://github.com/Project-MONAI/MONAI/pull/8872
- tests: remove more duplicate test cases by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8943
- Fix batched_nms for ndarray inputs by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8901
- fix: add missing stacklevel=2 to warnings.warn() in metrics/ (Fixes #8931) by @rtmalikian in https://github.com/Project-MONAI/MONAI/pull/8932
- fix: add missing stacklevel=2 to warnings.warn() in losses/ (Fixes #8929) by @rtmalikian in https://github.com/Project-MONAI/MONAI/pull/8930
- fix: adaptor map_names calls dict as function when inputs is a name-mapping dict by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8907
- Enabling MetaTensor Persistent Caching by @ericspod in https://github.com/Project-MONAI/MONAI/pull/8940
- Use compact [1,-2,1] kernel for BendingEnergyLoss second derivatives by @vishnukannaujia in https://github.com/Project-MONAI/MONAI/pull/8918
- Force GC in WSIReader tests to suppress ResourceWarning for unclosed files by @vishnukannaujia in https://github.com/Project-MONAI/MONAI/pull/8919
- fix: guard division by zero in DICOMReader._get_affine for single-slice volumes (Fixes #8925) by @rtmalikian in https://github.com/Project-MONAI/MONAI/pull/8926
- fix: replace
raise UserWarningwithwarnings.warn()in verify_report_format (Fixes #8927) by @rtmalikian in https://github.com/Project-MONAI/MONAI/pull/8928 - Fix FROC num_targets miscount when labels_to_exclude is set by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8951
- Remove dead and redundant code across monai/ by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8952
- docs: add Windows BUILD_MONAI install instructions by @Shizoqua in https://github.com/Project-MONAI/MONAI/pull/8906
- Perf: Use a KDTree on CPU instead of full EDT for 1.5x to 16x faster metric computation by @jberg5 in https://github.com/Project-MONAI/MONAI/pull/8910
- Fix nnUNet runner store_true flag command construction (#8941) by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8944
- fix: emit nnUNet store_true flags as bare CLI args in nnUNetV2Runner by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8968
- Support configurable rotation order in create_rotate by @aymuos15 in https://github.com/Project-MONAI/MONAI/pull/8963
- Bump actions/checkout from 4 to 7 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8965
- Bump codecov/codecov-action from 6 to 7 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8966
- Bump actions/cache from 5 to 6 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8964
- docs: clarify RandWeightedCrop(d) does not crop the weight map (
- 1.6.02026-06-11 · 2026-06-11 01:51 UTC
查看更新说明
What's Changed
- Update citation for 1.5.1 by @KumoLiu in https://github.com/Project-MONAI/MONAI/pull/8582
- Bump actions/download-artifact from 4 to 5 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8590
- Bump actions/checkout from 4 to 5 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8588
- Bump actions/setup-python from 5 to 6 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8589
- 8564 fourier positional encoding by @NabJa in https://github.com/Project-MONAI/MONAI/pull/8570
- Include more-itertools in build env by @KumoLiu in https://github.com/Project-MONAI/MONAI/pull/8611
- Bump peter-evans/create-or-update-comment from 4 to 5 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8612
- Bump actions/download-artifact from 5 to 6 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8614
- Bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8615
- Bump github/codeql-action from 3 to 4 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8616
- added ReduceTrait and FlattenSequence by @lukas-folle-snkeos in https://github.com/Project-MONAI/MONAI/pull/8531
- Fix box_iou returning 0 for floating-point results less than 1. #8369 by @reworld223 in https://github.com/Project-MONAI/MONAI/pull/8553
- 8620 ModuleNotFoundError: No module named 'onnxscript' in test-py3x (3.11) pipeline by @garciadias in https://github.com/Project-MONAI/MONAI/pull/8621
- timestep scheduling with np.linspace by @ytl0623 in https://github.com/Project-MONAI/MONAI/pull/8623
- Correct H&E stain ordering heuristic in ExtractHEStains by @iyassou in https://github.com/Project-MONAI/MONAI/pull/8551
- feat: add activation checkpointing to unet by @ferreirafabio80 in https://github.com/Project-MONAI/MONAI/pull/8554
- Fix index using tuple for image cropping operation by @johnzielke in https://github.com/Project-MONAI/MONAI/pull/8633
- Fix #8599: Add track_meta and weights_only arguments to PersistentDataset for MetaTensor support. by @mccle in https://github.com/Project-MONAI/MONAI/pull/8628
- Update documentation links by @KumoLiu in https://github.com/Project-MONAI/MONAI/pull/8637
- Fix #8350: Clarify LocalNormalizedCrossCorrelationLoss docstring by @engmohamedsalah in https://github.com/Project-MONAI/MONAI/pull/8639
- 8620 modulenotfounderror no module named onnxscript in test py3x 311 pipeline by @garciadias in https://github.com/Project-MONAI/MONAI/pull/8638
- Generate heatmap transforms by @eclipse0922 in https://github.com/Project-MONAI/MONAI/pull/8579
- Added an optional_import check for onnxruntime and applied the @unitt… by @ytl0623 in https://github.com/Project-MONAI/MONAI/pull/8641
- Bump peter-evans/slash-command-dispatch from 4.0.0 to 5.0.0 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8650
- Bump al-cheb/configure-pagefile-action from 1.4 to 1.5 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8648
- Bump actions/checkout from 4 to 6 by @dependabot[bot] in https://github.com/Project-MONAI/MONAI/pull/8649
- resolves CI's drive-out-of-space by prune caching and use torch fro CPU by @Borda in https://github.com/Project-MONAI/MONAI/pull/8673
- Consolidating Version Bumps by @ericspod in https://github.com/Project-MONAI/MONAI/pull/8681
- Fix Zip Slip vulnerability in NGC private bundle download by @yueyueL in https://github.com/Project-MONAI/MONAI/pull/8682
- Fix channel-first indices buffer for distance_transform_edt (return_indices=True) #8656 by @alexanderjaus in https://github.com/Project-MONAI/MONAI/pull/8657
- Fix missing closing parenthesis in SSIM formula documentation by @Marshall-mk in https://github.com/Project-MONAI/MONAI/pull/8661
- Replace
pyupgradewith builtin Ruff's UP rule by @Borda in https://github.com/Project-MONAI/MONAI/pull/8606 - Rename NormalizeLabelsInDatasetd to RemapLabelsToSequentiald and fi
- 1.5.22026-01-29 · 2026-01-29 02:55 UTC
查看更新说明
What's Changed
Fixed
- Fix Zip Slip vulnerability in NGC private bundle download by @yueyueL in https://github.com/Project-MONAI/MONAI/pull/8682
Full Changelog: https://github.com/Project-MONAI/MONAI/compare/1.5.1...1.5.2
- 1.5.12025-09-22 · 2025-09-22 18:00 UTC
查看更新说明
Added
- PyTorch 2.7 and 2.8 support (#8429, #8530)
- Create SECURITY.md (#8546)
- Add kwargs in array and functional file (#8508)
- Add .coderabbit.yaml File (#8513)
- Add input validation to ImageStats class (#8501)
- Add support for optional conditioning in PatchInferer, SliceInferer, and SlidingWindowInferer (#8400)
- Add classifier free guidance unconditioned value (#8562)
- Improved
DiffusionModelEncoderto support output linear layers of different dimensions (#8578, #8580)
Fixed
- Fix for insecure zip file extraction to address GHSA-x6ww-pf9m-m73m (#8568)
- Fix for insecure use of
torch.loadandpickleto address GHSA-6vm5-6jv9-rjpj and GHSA-p8cm-mm2v-gwjm (#8566) - Torchvision fix for loading pretrained weights using current syntax (#8563)
- Fix bug in MAISI vae (#8517)
- Throw exception on invalid images in retinanet detector (#8515)
- Fix: HistogramNormalized doc (#8543)
- Fix build failure by pinning pyamg to versions below 5.3.0 (#8548)
- Fix hardcoded input dim in DiffusionModelEncoder (#8514)
- Fix for gdown downloading fails (#8576)
Changed
- Update README badges to add research paper citations number (#8494)
- CI: Add custom timeout to ci job in order to save resources (#8504)
- Improve documentation on the datalist format (#8539)
- Tests Cleanup and refactor (#8405, #8535)
- Improve Orientation transform to use the "space" (LPS vs RAS) of a metatensor by default (#8473)
- Updated supported version of Huggingface Transformers (#8574)
New Contributors
- @kitsiosk made their first contribution in https://github.com/Project-MONAI/MONAI/pull/8504
- @IamTingTing made their first contribution in https://github.com/Project-MONAI/MONAI/pull/8508
- @mauigna06 made their first contribution in https://github.com/Project-MONAI/MONAI/pull/8494
- @Emdya made their first contribution in https://github.com/Project-MONAI/MONAI/pull/8501
- @FinnBehrendt made their first contribution in https://github.com/Project-MONAI/MONAI/pull/8400
- @gauthamk02 made their first contribution in https://github.com/Project-MONAI/MONAI/pull/8543
- @DanielNobbe made their first contribution in https://github.com/Project-MONAI/MONAI/pull/8539
- @CPBridge made their first contribution in https://github.com/Project-MONAI/MONAI/pull/8473
- @h3rrr made their first contribution in https://github.com/Project-MONAI/MONAI/pull/8546
Full Changelog: https://github.com/Project-MONAI/MONAI/compare/1.5.0...1.5.1
- 1.5.02025-06-14 · 2025-06-14 05:34 UTC
查看更新说明
Added
- Add platform-specific constraints to setup.cfg (#8260)
- Add PythonicWorkflow (#8151)
- Add SM architecture version check (#8199)
- Add MedNext implementation (#8004)
- Added a top button to CONSTRIBUTING.md (#8163)
- Adding CODEOWNERS (#8457)
- Restormer Implementation (#8312)
- Add rectified flow noise scheduler for accelerated diffusion model (#8374)
- Add prediction type for rflow scheduler (#8386)
- Add Average Precision to metrics (#8089)
- Implementation of a Masked Autoencoder for representation learning (#8152)
- Implement TorchIO transforms wrapper analogous to TorchVision transfo… (#7579)
- 8328 nnunet bundle integration (#8329)
- Adding Support Policy + Doc Updates (#8458)
- Classifier free guidance (#8460)
Fixed
- Fix Ruff Numpy2 deprecation rules (#8179)
- Fix
torch.load()frequently warning in PersistentDataset and GDSDataset (#8177) - Fix the logging of a nested dictionary metric in MLflow (#8169)
- Fix ImageFilter to allow Gaussian filter without filter_size (#8189)
- Fix fold_constants, test_handler switched to onnx (#8211)
- Fix TypeError in meshgrid (#8252)
- Fix PatchMerging duplicate merging (#8285)
- Fix test load image issue (#8297)
- Fix bundle download error from ngc source (#8307)
- Fix deprecated usage in zarr (#8313, #8477)
- Fix DataFrame subsets indexing in CSVDataset() (#8351)
- Fix
packagingimports in version comparison logic (#8347) - Fix CommonKeys docstring (#8342)
- Fix: correctly apply fftshift to real-valued data inputs (#8407)
- Fix OptionalImportError: required package
openslideis not installed (#8419) - Fix cosine noise scheduler (#8427)
- Fix AutoencoderKL docstrings. (#8445)
- Inverse Threading Fix (#8418)
- Fix normalize intensity (#8286)
- Fix path at test onnx trt export (#8361)
- Fix broken urls (#8481, #8483)
Changed
- [DOC] Update README.md (#8157)
- Streamlined Rearrange in SpatialAttentionBlock (#8130)
- Optimize VISTA3D (#8123)
- Skip torch trt convert test with torch newer than or equal to 2.5.0 (#8165)
- Enable redirection of all loggers by configuring a FileHandler within the bundle (#8142)
- Apply pyupgrade fixes for Python 3.9+ syntax (#8150)
- Update base image to 2410 (#8164)
- TRT support for MAISI (#8153)
- 8134 Add unit test for responsive inference (#8146)
- SwinUNETR refactor to accept additional parameters (#8212)
- Allow an arbitrary mask to be used in the self attention (#8235)
- Bump codecov/codecov-action from 4 to 5 (#8245)
- Docs: update brats classes description (#8246)
- Change default value of
patch_normto False inSwinUNETR(#8249) - Modify Dice, Jaccard and Tversky losses (#8138)
- Modify Workflow to Allow IterableDataset Inputs (#8263)
- Enhance download_and_extract (#8216)
- Relax gpu load check (#8282, #8275)
- Using LocalStore in Zarr v3 (#8299)
- Enable gpu load nifti (#8188)
- update pydicom reader to enable gpu load (#8283)
- Zarr compression tests only with versions before 3.0 (#8319)
- Changing utils.py to test_utils.py (#8335)
- Refactor testd (#8231)
- Recursive Item Mapping for Nested Lists in Compose (#8187)
- Bump min torch to 1.13.1 to mitigate CVE-2022-45907 unsafe usage of eval (#8296)
- Inferer modification - save_intermediates clashes with latent shape adjustment in latent diffusion inferers (#8343)
- Solves path problem in test_bundle_trt_export.py (#8357)
- Modify ControlNet inferer so that it takes in context when the diffus… (#8360)
- Update monaihosting download method (#8364)
- Bump torch minimum to mitigate CVE-2024-31580 & CVE-2024-31583 and enable numpy 2 compatibility (#8368)
- Auto3DSeg algo_template hash update (#8378)
- Enable Pytorch 2.6 (#8309)
- Auto3DSeg algo_template hash update (#8393, #8397)
- Update Dice Metric Docs (#8388)
- Auto3DSeg algo_template hash update (#8406)
- Update bundle download API (#8403)
- Add Skip test in TestTranschex (#8416)
- Update get latest bundle version function (#8420)
Medical Open Network for AI
MONAI is a PyTorch-based, open-source framework for deep learning in healthcare imaging, part of the PyTorch Ecosystem. Its ambitions are as follows:
- Developing a community of academic, industrial and clinical researchers collaborating on a common foundation;
- Creating state-of-the-art, end-to-end training workflows for healthcare imaging;
- Providing researchers with the optimized and standardized way to create and evaluate deep learning models.
Features
Please see the technical highlights and What's New of the milestone releases.
- flexible pre-processing for multi-dimensional medical imaging data;
- compositional & portable APIs for ease of integration in existing workflows;
- domain-specific implementations for networks, losses, evaluation metrics and more;
- customizable design for varying user expertise;
- multi-GPU multi-node data parallelism support.
Requirements
MONAI works with the currently supported versions of Python, and depends directly on NumPy and PyTorch with many optional dependencies.
- Major releases of MONAI will have dependency versions stated for them. The current state of the
devbranch in this repository is the unreleased development version of MONAI which typically will support current versions of dependencies and include updates and bug fixes to do so. - PyTorch support covers the current version plus three previous minor versions. If compatibility issues with a PyTorch version and other dependencies arise, support for a version may be delayed until a major release.
- Our support policy for other dependencies adheres for the most part to SPEC0, where dependency versions are supported where possible for up to two years. Discovered vulnerabilities or defects may require certain versions to be explicitly not supported.
- See the
pyproject.tomlfile for dependency version information.
Installation
To install the current release, you can simply run:
pip install monai
Please refer to the installation guide for other installation options.
Getting Started
MedNIST demo and MONAI for PyTorch Users are available on Colab.
Examples and notebook tutorials are located at Project-MONAI/tutorials.
Technical documentation is available at monai.readthedocs.io.
Docker
The MONAI Docker image is available from Dockerhub,
tagged as latest for the latest state of dev or with a release version. A slimmed down image can also be built
locally using Dockerfile.slim, see that file for instructions.
To get started with the latest MONAI, use docker run -ti --rm --gpus all projectmonai/monai:latest /bin/bash.
Citation
If you have used MONAI in your research, please cite us! The citation can be exported from: https://arxiv.org/abs/2211.02701.
Model Zoo
The MONAI Model Zoo is a place for researchers and data scientists to share the latest and great models from the community. Utilizing the MONAI Bundle format makes it easy to get started building workflows with MONAI.
Contributing
For guidance on making a contribution to MONAI, see the contributing guidelines.
Community
Join the conversation on Twitter/X @ProjectMONAI, LinkedIn, or join our Slack channel.
Ask and answer questions over on MONAI's GitHub Discussions tab.
Links
- Website: https://project-monai.github.io/
- API documentation (milestone): https://monai.readthedocs.io/
- API documentation (latest dev): https://monai.readthedocs.io/en/latest/
- Code: https://github.com/Project-MONAI/MONAI
- Project tracker: https://github.com/Project-MONAI/MONAI/projects
- Issue tracker: https://github.com/Project-MONAI/MONAI/issues
- Wiki: https://github.com/Project-MONAI/MONAI/wiki
- Test status: https://github.com/Project-MONAI/MONAI/actions
- PyPI package: https://pypi.org/project/monai/
- conda-forge: https://anaconda.org/conda-forge/monai
- Weekly previews: https://pypi.org/project/monai-weekly/
- Docker Hub: https://hub.docker.com/r/projectmonai/monai