{"id":28440846,"url":"https://github.com/mic-dkfz/nnunet","last_synced_at":"2025-06-29T00:32:10.423Z","repository":{"id":37297714,"uuid":"181846371","full_name":"MIC-DKFZ/nnUNet","owner":"MIC-DKFZ","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-30T12:07:14.000Z","size":8239,"stargazers_count":6780,"open_issues_count":328,"forks_count":1990,"subscribers_count":80,"default_branch":"master","last_synced_at":"2025-05-30T16:06:34.400Z","etag":null,"topics":["segmentation"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MIC-DKFZ.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-04-17T08:10:56.000Z","updated_at":"2025-05-30T13:31:35.000Z","dependencies_parsed_at":"2023-10-21T12:13:25.852Z","dependency_job_id":"202fad3f-2466-42ef-a166-fce48dac9e39","html_url":"https://github.com/MIC-DKFZ/nnUNet","commit_stats":{"total_commits":1392,"total_committers":76,"mean_commits":18.31578947368421,"dds":0.6515804597701149,"last_synced_commit":"8fd3580ab1770f12882a66699b93dee3e6455251"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/MIC-DKFZ/nnUNet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIC-DKFZ%2FnnUNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIC-DKFZ%2FnnUNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIC-DKFZ%2FnnUNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIC-DKFZ%2FnnUNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MIC-DKFZ","download_url":"https://codeload.github.com/MIC-DKFZ/nnUNet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIC-DKFZ%2FnnUNet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262518098,"owners_count":23323301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["segmentation"],"created_at":"2025-06-06T04:08:01.915Z","updated_at":"2025-06-29T00:32:10.415Z","avatar_url":"https://github.com/MIC-DKFZ.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to the new nnU-Net!\n\nClick [here](https://github.com/MIC-DKFZ/nnUNet/tree/nnunetv1) if you were looking for the old one instead.\n\nComing from V1? Check out the [TLDR Migration Guide](documentation/tldr_migration_guide_from_v1.md). Reading the rest of the documentation is still strongly recommended ;-)\n\n## **2024-04-18 UPDATE: New residual encoder UNet presets available!**\nResidual encoder UNet presets substantially improve segmentation performance.\nThey ship for a variety of GPU memory targets. It's all awesome stuff, promised! \nRead more :point_right: [here](documentation/resenc_presets.md) :point_left:\n\nAlso check out our [new paper](https://arxiv.org/pdf/2404.09556.pdf) on systematically benchmarking recent developments in medical image segmentation. You might be surprised!\n\n# What is nnU-Net?\nImage datasets are enormously diverse: image dimensionality (2D, 3D), modalities/input channels (RGB image, CT, MRI, microscopy, ...), \nimage sizes, voxel sizes, class ratio, target structure properties and more change substantially between datasets. \nTraditionally, given a new problem, a tailored solution needs to be manually designed and optimized  - a process that \nis prone to errors, not scalable and where success is overwhelmingly determined by the skill of the experimenter. Even \nfor experts, this process is anything but simple: there are not only many design choices and data properties that need to \nbe considered, but they are also tightly interconnected, rendering reliable manual pipeline optimization all but impossible! \n\n![nnU-Net overview](documentation/assets/nnU-Net_overview.png)\n\n**nnU-Net is a semantic segmentation method that automatically adapts to a given dataset. It will analyze the provided \ntraining cases and automatically configure a matching U-Net-based segmentation pipeline. No expertise required on your \nend! You can simply train the models and use them for your application**.\n\nUpon release, nnU-Net was evaluated on 23 datasets belonging to competitions from the biomedical domain. Despite competing \nwith handcrafted solutions for each respective dataset, nnU-Net's fully automated pipeline scored several first places on \nopen leaderboards! Since then nnU-Net has stood the test of time: it continues to be used as a baseline and method \ndevelopment framework ([9 out of 10 challenge winners at MICCAI 2020](https://arxiv.org/abs/2101.00232) and 5 out of 7 \nin MICCAI 2021 built their methods on top of nnU-Net, \n [we won AMOS2022 with nnU-Net](https://amos22.grand-challenge.org/final-ranking/))!\n\nPlease cite the [following paper](https://www.google.com/url?q=https://www.nature.com/articles/s41592-020-01008-z\u0026sa=D\u0026source=docs\u0026ust=1677235958581755\u0026usg=AOvVaw3dWL0SrITLhCJUBiNIHCQO) when using nnU-Net:\n\n    Isensee, F., Jaeger, P. F., Kohl, S. A., Petersen, J., \u0026 Maier-Hein, K. H. (2021). nnU-Net: a self-configuring \n    method for deep learning-based biomedical image segmentation. Nature methods, 18(2), 203-211.\n\n\n## What can nnU-Net do for you?\nIf you are a **domain scientist** (biologist, radiologist, ...) looking to analyze your own images, nnU-Net provides \nan out-of-the-box solution that is all but guaranteed to provide excellent results on your individual dataset. Simply \nconvert your dataset into the nnU-Net format and enjoy the power of AI - no expertise required!\n\nIf you are an **AI researcher** developing segmentation methods, nnU-Net:\n- offers a fantastic out-of-the-box applicable baseline algorithm to compete against\n- can act as a method development framework to test your contribution on a large number of datasets without having to \ntune individual pipelines (for example evaluating a new loss function)\n- provides a strong starting point for further dataset-specific optimizations. This is particularly used when competing \nin segmentation challenges\n- provides a new perspective on the design of segmentation methods: maybe you can find better connections between \ndataset properties and best-fitting segmentation pipelines?\n\n## What is the scope of nnU-Net?\nnnU-Net is built for semantic segmentation. It can handle 2D and 3D images with arbitrary \ninput modalities/channels. It can understand voxel spacings, anisotropies and is robust even when classes are highly\nimbalanced.\n\nnnU-Net relies on supervised learning, which means that you need to provide training cases for your application. The number of \nrequired training cases varies heavily depending on the complexity of the segmentation problem. No \none-fits-all number can be provided here! nnU-Net does not require more training cases than other solutions - maybe \neven less due to our extensive use of data augmentation. \n\nnnU-Net expects to be able to process entire images at once during preprocessing and postprocessing, so it cannot \nhandle enormous images. As a reference: we tested images from 40x40x40 pixels all the way up to 1500x1500x1500 in 3D \nand 40x40 up to ~30000x30000 in 2D! If your RAM allows it, larger is always possible.\n\n## How does nnU-Net work?\nGiven a new dataset, nnU-Net will systematically analyze the provided training cases and create a 'dataset fingerprint'. \nnnU-Net then creates several U-Net configurations for each dataset: \n- `2d`: a 2D U-Net (for 2D and 3D datasets)\n- `3d_fullres`: a 3D U-Net that operates on a high image resolution (for 3D datasets only)\n- `3d_lowres` → `3d_cascade_fullres`: a 3D U-Net cascade where first a 3D U-Net operates on low resolution images and \nthen a second high-resolution 3D U-Net refined the predictions of the former (for 3D datasets with large image sizes only)\n\n**Note that not all U-Net configurations are created for all datasets. In datasets with small image sizes, the \nU-Net cascade (and with it the 3d_lowres configuration) is omitted because the patch size of the full \nresolution U-Net already covers a large part of the input images.**\n\nnnU-Net configures its segmentation pipelines based on a three-step recipe:\n- **Fixed parameters** are not adapted. During development of nnU-Net we identified a robust configuration (that is, certain architecture and training properties) that can \nsimply be used all the time. This includes, for example, nnU-Net's loss function, (most of the) data augmentation strategy and learning rate.\n- **Rule-based parameters** use the dataset fingerprint to adapt certain segmentation pipeline properties by following \nhard-coded heuristic rules. For example, the network topology (pooling behavior and depth of the network architecture) \nare adapted to the patch size; the patch size, network topology and batch size are optimized jointly given some GPU \nmemory constraint. \n- **Empirical parameters** are essentially trial-and-error. For example the selection of the best U-net configuration \nfor the given dataset (2D, 3D full resolution, 3D low resolution, 3D cascade) and the optimization of the postprocessing strategy.\n\n## How to get started?\nRead these:\n- [Installation instructions](documentation/installation_instructions.md)\n- [Dataset conversion](documentation/dataset_format.md)\n- [Usage instructions](documentation/how_to_use_nnunet.md)\n\nAdditional information:\n- [Learning from sparse annotations (scribbles, slices)](documentation/ignore_label.md)\n- [Region-based training](documentation/region_based_training.md)\n- [Manual data splits](documentation/manual_data_splits.md)\n- [Pretraining and finetuning](documentation/pretraining_and_finetuning.md)\n- [Intensity Normalization in nnU-Net](documentation/explanation_normalization.md)\n- [Manually editing nnU-Net configurations](documentation/explanation_plans_files.md)\n- [Extending nnU-Net](documentation/extending_nnunet.md)\n- [What is different in V2?](documentation/changelog.md)\n\nCompetitions:\n- [AutoPET II](documentation/competitions/AutoPETII.md)\n\n[//]: # (- [Ignore label]\u0026#40;documentation/ignore_label.md\u0026#41;)\n\n## Where does nnU-Net perform well and where does it not perform?\nnnU-Net excels in segmentation problems that need to be solved by training from scratch, \nfor example: research applications that feature non-standard image modalities and input channels,\nchallenge datasets from the biomedical domain, majority of 3D segmentation problems, etc . We have yet to find a \ndataset for which nnU-Net's working principle fails!\n\nNote: On standard segmentation \nproblems, such as 2D RGB images in ADE20k and Cityscapes, fine-tuning a foundation model (that was pretrained on a large corpus of \nsimilar images, e.g. Imagenet 22k, JFT-300M) will provide better performance than nnU-Net! That is simply because these \nmodels allow much better initialization. Foundation models are not supported by nnU-Net as \nthey 1) are not useful for segmentation problems that deviate from the standard setting (see above mentioned \ndatasets), 2) would typically only support 2D architectures and 3) conflict with our core design principle of carefully adapting \nthe network topology for each dataset (if the topology is changed one can no longer transfer pretrained weights!) \n\n## What happened to the old nnU-Net?\nThe core of the old nnU-Net was hacked together in a short time period while participating in the Medical Segmentation \nDecathlon challenge in 2018. Consequently, code structure and quality were not the best. Many features \nwere added later on and didn't quite fit into the nnU-Net design principles. Overall quite messy, really. And annoying to work with.\n\nnnU-Net V2 is a complete overhaul. The \"delete everything and start again\" kind. So everything is better \n(in the author's opinion haha). While the segmentation performance [remains the same](https://docs.google.com/spreadsheets/d/13gqjIKEMPFPyMMMwA1EML57IyoBjfC3-QCTn4zRN_Mg/edit?usp=sharing), a lot of cool stuff has been added. \nIt is now also much easier to use it as a development framework and to manually fine-tune its configuration to new \ndatasets. A big driver for the reimplementation was also the emergence of [Helmholtz Imaging](http://helmholtz-imaging.de), \nprompting us to extend nnU-Net to more image formats and domains. Take a look [here](documentation/changelog.md) for some highlights.\n\n# Acknowledgements\n\u003cimg src=\"documentation/assets/HI_Logo.png\" height=\"100px\" /\u003e\n\n\u003cimg src=\"documentation/assets/dkfz_logo.png\" height=\"100px\" /\u003e\n\nnnU-Net is developed and maintained by the Applied Computer Vision Lab (ACVL) of [Helmholtz Imaging](http://helmholtz-imaging.de) \nand the [Division of Medical Image Computing](https://www.dkfz.de/en/mic/index.php) at the \n[German Cancer Research Center (DKFZ)](https://www.dkfz.de/en/index.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmic-dkfz%2Fnnunet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmic-dkfz%2Fnnunet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmic-dkfz%2Fnnunet/lists"}