Abstract
Artificial Intelligence (AI) is having a tremendous impact across most areas of science. Applications of AI in healthcare have the potential to improve our ability to detect, diagnose, prognose, and intervene on human disease. For AI models to be used clinically, they need to be made safe, reproducible and robust, and the underlying software framework must be aware of the particularities (e.g. geometry, physiology, physics) of medical data being processed. This work introduces MONAI, a freely available, community-supported, and consortium-led PyTorch-based framework for deep learning in healthcare. MONAI extends PyTorch to support medical data, with a particular focus on imaging, and provide purpose-specific AI model architectures, transformations and utilities that streamline the development and deployment of medical AI models. MONAI follows best practices for software-development, providing an easy-to-use, robust, well-documented, and well-tested software framework. MONAI preserves the simple, additive, and compositional approach of its underlying PyTorch libraries. MONAI is being used by and receiving contributions from research, clinical and industrial teams from around the world, who are pursuing applications spanning nearly every aspect of healthcare.
Introduction: Standardizing the "Wild West" of Medical AI
While general-purpose deep learning frameworks like PyTorch and TensorFlow have revolutionized AI, they often treat medical images like standard photographs. In reality, healthcare data is far more complex, involving high-dimensional volumes (3D/4D), specialized file formats (DICOM, NIfTI), and critical metadata such as voxel spacing, orientation, and physical units (e.g., Hounsfield units).
Before the advent of MONAI (Medical Open Network for AI), the medical AI landscape was fragmented. Research groups frequently built "siloed" tools, leading to code that was difficult to reproduce, hard to integrate into clinical workflows, and prone to errors when handling the subtle physics of medical acquisition. MONAI was created to unify these efforts into a single, high-quality, open-source standard that bridges the gap between general-purpose deep learning and specialized healthcare requirements.
Methods: The MONAI Architecture
MONAI is designed as an "opt-in" extension of PyTorch, maintaining a familiar ecosystem while adding specialized capabilities for medical data. The framework is divided into foundational components and high-level workflow engines.
Key Technical Pillars
- MetaTensor: A specialized tensor that carries metadata (like image orientation) through the entire processing pipeline, ensuring that spatial information is preserved during transforms.
- Flexible Transforms: MONAI offers both Array-based (simple) and Dictionary-based (complex) transforms. The latter allows researchers to apply the exact same random augmentation (e.g., a rotation) to both an image and its corresponding segmentation mask simultaneously.
- Invertible Transforms: This feature allows users to "undo" spatial changes, which is vital for clinical use where an AI might process a resized image, but the final result must be mapped back to the original patient coordinates.
- Optimized Data Handling: To manage massive medical volumes, MONAI includes
CacheDatasetandPersistentDatasetto store intermediate results in RAM or on disk, significantly accelerating training by avoiding redundant preprocessing. - Engines and Handlers: Built on top of PyTorch Ignite, these provide high-level abstractions for training loops, making experiments cleaner and more reproducible.
Datasets and Benchmarking
MONAI facilitates easy interfacing with standard medical benchmarks, reducing the overhead of data ingestion:
- MedNIST: A "Hello World" dataset for medical AI, serving as an analogue to the classic MNIST handwritten digits.
- Medical Segmentation Decathlon (MSD): A collection of 10 different challenges (brain, heart, liver, etc.) used to benchmark the robustness of segmentation models.
- TCIA (The Cancer Imaging Archive): Built-in wrappers like
TciaDatasetallow for the automatic download and extraction of publicly accessible cancer datasets.
Key Insights: Physics-Aware and PyTorch-Native
- Physics-Aware Augmentation: MONAI goes beyond standard image flips. It includes transforms like
RandKSpaceSpikeNoise, which simulates artifacts specific to Magnetic Resonance (MR) imaging by manipulating data in the frequency domain. - The "PyTorch-Native" Philosophy: By mirroring PyTorch’s design, the framework minimizes the learning curve. If a researcher can write a PyTorch model, they can use MONAI.
- Reproducibility as a Feature: By standardizing data loading and transformation, MONAI reduces the "hidden" variations between research labs that often make medical AI results difficult to replicate.
- Decoupling Logic: The use of "Event Handlers" allows researchers to attach logic (like logging or checkpointing) to the training process without cluttering the core algorithmic code.
Results and Community Impact
MONAI provides comprehensive coverage of the medical AI field through:
- Architectural Breadth: It includes state-of-the-art implementations for Segmentation (UNet, SwinUNETR), Classification (DenseNet, ResNet), and Registration.
- Performance: Through GPU-optimized transforms and smart caching, MONAI significantly reduces the time-to-train for large 3D volumes compared to standard implementations.
- Community Growth: With over 120 contributors and thousands of active users, the framework has successfully unified a previously fragmented field.
Future Directions
While MONAI Core is robust for imaging, healthcare is inherently multi-modal. Future development focuses on:
- Non-Imaging Data: Expanding support for digital pathology, EEG signals, and tabular electronic health records (EHR).
- Clinical Deployment: Moving beyond research via MONAI Deploy, which focuses on packaging and integrating models into hospital environments.
- Active Learning: Improving MONAI Label to assist clinicians in annotating data more efficiently, addressing the bottleneck of high-quality labeled data in medicine.
Summary updated