{"id":1058,"date":"2026-05-14T19:27:02","date_gmt":"2026-05-14T11:27:02","guid":{"rendered":"https:\/\/www.eutaboo.com\/index.php\/2026\/05\/14\/%e3%80%8annu-net-0%e5%9f%ba%e7%a1%80%e5%85%a5%e9%97%a8%ef%bc%8810%ef%bc%89%ef%bc%9a%e4%bf%ae%e6%94%b9-loss-%e4%b8%8e-deep-supervision%ef%bc%8c%e4%bb%8e-dicece-%e5%88%b0%e8%87%aa%e5%ae%9a%e4%b9%89\/"},"modified":"2026-05-14T19:27:02","modified_gmt":"2026-05-14T11:27:02","slug":"%e3%80%8annu-net-0%e5%9f%ba%e7%a1%80%e5%85%a5%e9%97%a8%ef%bc%8810%ef%bc%89%ef%bc%9a%e4%bf%ae%e6%94%b9-loss-%e4%b8%8e-deep-supervision%ef%bc%8c%e4%bb%8e-dicece-%e5%88%b0%e8%87%aa%e5%ae%9a%e4%b9%89","status":"publish","type":"post","link":"https:\/\/www.eutaboo.com\/index.php\/2026\/05\/14\/%e3%80%8annu-net-0%e5%9f%ba%e7%a1%80%e5%85%a5%e9%97%a8%ef%bc%8810%ef%bc%89%ef%bc%9a%e4%bf%ae%e6%94%b9-loss-%e4%b8%8e-deep-supervision%ef%bc%8c%e4%bb%8e-dicece-%e5%88%b0%e8%87%aa%e5%ae%9a%e4%b9%89\/","title":{"rendered":"\u300annU-Net 0\u57fa\u7840\u5165\u95e8\uff0810\uff09\uff1a\u4fee\u6539 loss \u4e0e deep supervision\uff0c\u4ece Dice+CE \u5230\u81ea\u5b9a\u4e49\u635f\u5931\u300b"},"content":{"rendered":"<h2>\u672c\u7bc7\u5b66\u4e60\u76ee\u6807<\/h2>\n<p>\u8fd9\u662f\u300annU-Net 0\u57fa\u7840\u5165\u95e8\u300b\u7cfb\u5217\u7684\u7b2c 10 \u7bc7\u3002\u4e0a\u4e00\u7bc7\u6211\u4eec\u5b66\u4f1a\u4e86\u7ee7\u627f <code>nnUNetTrainer<\/code> \u5199\u81ea\u5b9a\u4e49 Trainer\u3002\u672c\u6587\u7ee7\u7eed\u5f80\u91cc\u8d70\uff1a\u4fee\u6539 loss\uff0c\u5e76\u7406\u89e3 deep supervision\u3002<\/p>\n<p>\u8bfb\u5b8c\u672c\u6587\uff0c\u4f60\u5e94\u8be5\u80fd\u591f\uff1a<\/p>\n<ol>\n<li>\u7406\u89e3 nnU-Net v2 \u9ed8\u8ba4 loss \u7684\u5927\u81f4\u7ec4\u6210\u3002<\/li>\n<li>\u77e5\u9053\u666e\u901a\u7c7b\u522b\u5206\u5272\u548c region-based training \u4e3a\u4ec0\u4e48\u4f1a\u7528\u4e0d\u540c loss \u7ec4\u5408\u3002<\/li>\n<li>\u7406\u89e3 deep supervision \u4e3a\u4ec0\u4e48\u4f1a\u8ba9 loss \u63a5\u6536\u591a\u5c3a\u5ea6\u8f93\u51fa\u3002<\/li>\n<li>\u5728\u81ea\u5b9a\u4e49 Trainer \u4e2d\u8986\u76d6 <code>_build_loss<\/code>\uff0c\u5b9e\u73b0\u4e00\u4e2a\u53ef\u7ef4\u62a4\u7684 loss \u53d8\u4f53\u3002<\/li>\n<\/ol>\n<h2>1. \u5148\u7406\u89e3 loss \u5728\u8bad\u7ec3\u6d41\u7a0b\u4e2d\u7684\u4f4d\u7f6e<\/h2>\n<p><strong>loss<\/strong> \u662f\u8bad\u7ec3\u65f6\u4f18\u5316\u7684\u76ee\u6807\u51fd\u6570\u3002\u6a21\u578b\u8f93\u51fa\u9884\u6d4b\uff0closs \u6bd4\u8f83\u9884\u6d4b\u548c\u6807\u7b7e\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c\u518d\u901a\u8fc7\u53cd\u5411\u4f20\u64ad\u66f4\u65b0\u7f51\u7edc\u53c2\u6570\u3002<\/p>\n<p>\u5728 nnU-Net v2 \u4e2d\uff0closs \u4e0d\u662f\u5b64\u7acb\u5b58\u5728\u7684\u3002\u5b83\u548c\u6807\u7b7e\u683c\u5f0f\u3001ignore label\u3001region-based training\u3001deep supervision\u3001DDP \u90fd\u6709\u5173\u3002<\/p>\n<pre><code class=\"language-mermaid\">flowchart TD\n    A[network output] --> D[loss]\n    B[segmentation target] --> D\n    C[deep supervision outputs] --> D\n    E\r\n        <span class=\"badge badge-info \">  <\/span>\r\n         --> D\n    D --> F[backpropagation]\n    F --> G[optimizer step]\n<\/code><\/pre>\n<p>\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u6211\u4eec\u4e0d\u5efa\u8bae\u968f\u4fbf\u628a\u7f51\u4e0a\u67d0\u4e2a loss \u51fd\u6570\u590d\u5236\u8fdb\u6765\u5c31\u7528\u3002\u4f60\u5fc5\u987b\u786e\u8ba4\u5b83\u80fd\u5904\u7406 nnU-Net \u5f53\u524d\u8bad\u7ec3\u8f93\u51fa\u548c\u6807\u7b7e\u683c\u5f0f\u3002<\/p>\n<h2>2. nnU-Net v2 \u9ed8\u8ba4 loss \u505a\u4e86\u4ec0\u4e48<\/h2>\n<p>\u6839\u636e\u5f53\u524d\u5b98\u65b9 <code>nnUNetTrainer.py<\/code> \u7684 <code>_build_loss<\/code> \u5b9e\u73b0\uff0c\u9ed8\u8ba4\u903b\u8f91\u53ef\u4ee5\u6982\u62ec\u4e3a\uff1a<\/p>\n<ul>\n<li>\u5982\u679c\u5f53\u524d\u4efb\u52a1\u662f region-based training\uff0c\u4f7f\u7528 <code>DC_and_BCE_loss<\/code>\u3002<\/li>\n<li>\u5426\u5219\u4f7f\u7528 <code>DC_and_CE_loss<\/code>\u3002<\/li>\n<li>Dice \u90e8\u5206\u9ed8\u8ba4\u4f7f\u7528 <code>MemoryEfficientSoftDiceLoss<\/code>\u3002<\/li>\n<li>\u5982\u679c\u542f\u7528 deep supervision\uff0c\u5219\u7528 <code>DeepSupervisionWrapper<\/code> \u5305\u88c5 loss\u3002<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th>\u573a\u666f<\/th>\n<th>\u9ed8\u8ba4\u7ec4\u5408<\/th>\n<th>\u76f4\u89c2\u7406\u89e3<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u666e\u901a\u591a\u7c7b\u522b\u5206\u5272<\/td>\n<td><code>DC_and_CE_loss<\/code><\/td>\n<td>Dice \u5173\u6ce8\u533a\u57df\u91cd\u53e0\uff0cCE \u5173\u6ce8\u9010\u50cf\u7d20\/\u4f53\u7d20\u5206\u7c7b<\/td>\n<\/tr>\n<tr>\n<td>region-based training<\/td>\n<td><code>DC_and_BCE_loss<\/code><\/td>\n<td>region \u53ef\u80fd\u4e0d\u662f\u4e92\u65a5\u7c7b\u522b\uff0c\u66f4\u9002\u5408 BCE \u5f62\u5f0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>CE<\/strong> \u662f cross entropy\uff0c\u4ea4\u53c9\u71b5\uff0c\u7528\u4e8e\u5206\u7c7b\u4efb\u52a1\u3002<strong>BCE<\/strong> \u662f binary cross entropy\uff0c\u4e8c\u5143\u4ea4\u53c9\u71b5\u3002<strong>Dice loss<\/strong> \u6765\u81ea Dice \u6307\u6807\uff0c\u5f3a\u8c03\u9884\u6d4b\u533a\u57df\u548c\u6807\u7b7e\u533a\u57df\u7684\u91cd\u53e0\u7a0b\u5ea6\u3002<\/p>\n<h2>3. deep supervision \u662f\u4ec0\u4e48<\/h2>\n<p><strong>deep supervision<\/strong> \u53ef\u4ee5\u7406\u89e3\u4e3a\uff1a\u7f51\u7edc\u4e0d\u53ea\u5728\u6700\u7ec8\u6700\u9ad8\u5206\u8fa8\u7387\u8f93\u51fa\u4e0a\u8ba1\u7b97 loss\uff0c\u4e5f\u5728\u4e2d\u95f4\u591a\u4e2a\u4f4e\u5206\u8fa8\u7387\u8f93\u51fa\u4e0a\u8ba1\u7b97 loss\u3002\u8fd9\u6837\u53ef\u4ee5\u7ed9\u7f51\u7edc\u66f4\u6df1\u5c42\u7684\u7279\u5f81\u63d0\u4f9b\u8bad\u7ec3\u4fe1\u53f7\u3002<\/p>\n<p>\u5728 nnU-Net v2 \u4e2d\uff0c\u5982\u679c\u542f\u7528 deep supervision\uff0c\u7f51\u7edc\u8f93\u51fa\u901a\u5e38\u4e0d\u662f\u4e00\u4e2a tensor\uff0c\u800c\u662f\u4e00\u7ec4\u591a\u5c3a\u5ea6\u8f93\u51fa\u3002\u5b98\u65b9 <code>DeepSupervisionWrapper<\/code> \u4f1a\u628a\u540c\u4e00\u4e2a\u57fa\u7840 loss \u5e94\u7528\u5230\u591a\u4e2a\u8f93\u51fa\u4e0a\uff0c\u5e76\u6309\u6743\u91cd\u6c42\u548c\u3002<\/p>\n<pre><code class=\"language-text\">total_loss =\n  w0 * loss(output_0, target_0)\n+ w1 * loss(output_1, target_1)\n+ w2 * loss(output_2, target_2)\n+ ...<\/code><\/pre>\n<p>\u5b98\u65b9 Trainer \u4e2d\uff0c\u6743\u91cd\u6309\u5206\u8fa8\u7387\u964d\u4f4e\u800c\u9010\u6b65\u51cf\u5c0f\uff0c\u6700\u540e\u4e00\u4e2a\u6700\u4f4e\u5206\u8fa8\u7387\u8f93\u51fa\u901a\u5e38\u6743\u91cd\u4e3a 0 \u6216\u975e\u5e38\u5c0f\u3002\u8fd9\u6837\u505a\u7684\u76f4\u89c9\u662f\uff1a\u6700\u9ad8\u5206\u8fa8\u7387\u8f93\u51fa\u6700\u91cd\u8981\uff0c\u4f4e\u5206\u8fa8\u7387\u8f93\u51fa\u4e3b\u8981\u63d0\u4f9b\u8f85\u52a9\u76d1\u7763\u3002<\/p>\n<h2>4. \u4e00\u4e2a\u6700\u5c0f loss \u4fee\u6539\uff1a\u8c03\u6574 Dice \u548c CE \u6743\u91cd<\/h2>\n<p>\u4e0b\u9762\u793a\u4f8b\u6f14\u793a\u5982\u4f55\u5728\u81ea\u5b9a\u4e49 Trainer \u4e2d\u8986\u76d6 <code>_build_loss<\/code>\uff0c\u628a\u666e\u901a\u591a\u7c7b\u522b\u5206\u5272\u4e2d\u7684 Dice \u548c CE \u6743\u91cd\u6539\u6210 1.5 \u548c 0.5\u3002\u8fd9\u4e2a\u4f8b\u5b50\u53ea\u7528\u4e8e\u8bf4\u660e\u7ed3\u6784\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u63d0\u9ad8\u7cbe\u5ea6\u3002<\/p>\n<pre><code class=\"language-python\">import numpy as np\nimport torch\n\nfrom nnunetv2.training.loss.compound_losses import DC_and_BCE_loss, DC_and_CE_loss\nfrom nnunetv2.training.loss.deep_supervision import DeepSupervisionWrapper\nfrom nnunetv2.training.loss.dice import MemoryEfficientSoftDiceLoss\nfrom nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer\n\n\nclass nnUNetTrainerDiceHeavy(nnUNetTrainer):\n    def _build_loss(self):\n        if self.label_manager.has_regions:\n            loss = DC_and_BCE_loss(\n                {},\n                {\n                    \"batch_dice\": self.configuration_manager.batch_dice,\n                    \"do_bg\": True,\n                    \"smooth\": 1e-5,\n                    \"ddp\": self.is_ddp,\n                },\n                weight_ce=0.5,\n                weight_dice=1.5,\n                use_ignore_label=self.label_manager.ignore_label is not None,\n                dice_class=MemoryEfficientSoftDiceLoss,\n            )\n        else:\n            loss = DC_and_CE_loss(\n                {\n                    \"batch_dice\": self.configuration_manager.batch_dice,\n                    \"smooth\": 1e-5,\n                    \"do_bg\": False,\n                    \"ddp\": self.is_ddp,\n                },\n                {},\n                weight_ce=0.5,\n                weight_dice=1.5,\n                ignore_label=self.label_manager.ignore_label,\n                dice_class=MemoryEfficientSoftDiceLoss,\n            )\n\n        if self.enable_deep_supervision:\n            deep_supervision_scales = self._get_deep_supervision_scales()\n            weights = np.array([1 \/ (2 ** i) for i in range(len(deep_supervision_scales))])\n            if self.is_ddp and not self._do_i_compile():\n                weights[-1] = 1e-6\n            else:\n                weights[-1] = 0\n            weights = weights \/ weights.sum()\n            loss = DeepSupervisionWrapper(loss, weights)\n\n        return loss<\/code><\/pre>\n<p>\u8bad\u7ec3\u65f6\u4f7f\u7528\uff1a<\/p>\n<pre><code class=\"language-bash\">nnUNetv2_train 1 3d_fullres 0 -tr nnUNetTrainerDiceHeavy --npz<\/code><\/pre>\n<p>\u6ce8\u610f\uff0c\u8fd9\u4e2a\u793a\u4f8b\u4fdd\u7559\u4e86\u5b98\u65b9\u5904\u7406 ignore label\u3001region training\u3001DDP \u548c deep supervision \u7684\u57fa\u672c\u903b\u8f91\uff0c\u53ea\u6539 Dice \u4e0e CE\/BCE \u7684\u6743\u91cd\u3002\u8fd9\u662f\u6bd4\u8f83\u7a33\u59a5\u7684\u4fee\u6539\u65b9\u5f0f\u3002<\/p>\n<h2>5. \u4e3a\u4ec0\u4e48\u4e0d\u8981\u5ffd\u7565 ignore label \u548c region<\/h2>\n<p><strong>ignore label<\/strong> \u6307\u67d0\u4e9b\u50cf\u7d20\u6216\u4f53\u7d20\u5728\u8bad\u7ec3\u4e2d\u4e0d\u53c2\u4e0e loss \u8ba1\u7b97\u3002\u4f8b\u5982\u6807\u6ce8\u4e0d\u786e\u5b9a\u533a\u57df\u3001\u88c1\u526a\u8fb9\u754c\u6216\u65e0\u6548\u533a\u57df\u3002\u5b98\u65b9 loss \u5b9e\u73b0\u4f1a\u628a ignore label \u5bf9\u5e94\u533a\u57df\u4ece\u68af\u5ea6\u4e2d\u6392\u9664\u3002<\/p>\n<p><strong>region-based training<\/strong> \u6307\u6807\u7b7e\u4e0d\u662f\u7b80\u5355\u7684\u4e92\u65a5\u7c7b\u522b\uff0c\u800c\u662f\u7531\u591a\u4e2a\u7c7b\u522b\u7ec4\u5408\u6210 region\u3002\u6bd4\u5982\u4e00\u4e2a region \u53ef\u4ee5\u8868\u793a\u201c\u80bf\u7624\u6574\u4f53\u201d\uff0c\u53e6\u4e00\u4e2a region \u8868\u793a\u201c\u589e\u5f3a\u80bf\u7624\u201d\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\u8f93\u51fa\u5934\u548c\u6807\u7b7e\u7ec4\u7ec7\u65b9\u5f0f\u4f1a\u4e0d\u540c\u3002<\/p>\n<p>\u5982\u679c\u4f60\u7684\u81ea\u5b9a\u4e49 loss \u6ca1\u6709\u5904\u7406 ignore label \u6216 region\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\uff1a<\/p>\n<ul>\n<li>\u65e0\u6548\u533a\u57df\u53c2\u4e0e\u8bad\u7ec3\uff0c\u5bfc\u81f4\u6a21\u578b\u5b66\u5230\u9519\u8bef\u4fe1\u53f7\u3002<\/li>\n<li>region \u6807\u7b7e\u548c\u7f51\u7edc\u8f93\u51fa shape \u5bf9\u4e0d\u4e0a\u3002<\/li>\n<li>\u8bad\u7ec3\u80fd\u8dd1\u4f46\u6307\u6807\u5f02\u5e38\u3002<\/li>\n<\/ul>\n<h2>6. \u81ea\u5b9a\u4e49 loss \u7684\u68c0\u67e5\u8868<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u68c0\u67e5\u9879<\/th>\n<th>\u4e3a\u4ec0\u4e48\u91cd\u8981<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u8f93\u5165\u662f\u5426\u662f logits<\/td>\n<td>nnU-Net \u7f51\u7edc\u901a\u5e38\u4e0d\u5728\u6700\u540e\u624b\u52a8\u52a0 softmax\/sigmoid\uff0closs \u5185\u90e8\u5904\u7406\u975e\u7ebf\u6027<\/td>\n<\/tr>\n<tr>\n<td>target shape \u662f\u5426\u7b26\u5408\u9884\u671f<\/td>\n<td>\u666e\u901a CE target \u548c one-hot\/region target \u8981\u6c42\u4e0d\u540c<\/td>\n<\/tr>\n<tr>\n<td>\u662f\u5426\u652f\u6301 deep supervision<\/td>\n<td>\u542f\u7528 deep supervision \u65f6\u8f93\u51fa\u548c target \u662f\u591a\u5c3a\u5ea6\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td>\u662f\u5426\u5904\u7406 ignore label<\/td>\n<td>\u907f\u514d\u4e0d\u786e\u5b9a\u533a\u57df\u5f71\u54cd\u8bad\u7ec3<\/td>\n<\/tr>\n<tr>\n<td>\u662f\u5426\u517c\u5bb9 DDP<\/td>\n<td>\u591a GPU \u8bad\u7ec3\u4e2d\u67d0\u4e9b\u53c2\u6570\u672a\u88ab\u4f7f\u7528\u4f1a\u5bfc\u81f4\u9519\u8bef<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>7. \u5b9e\u9a8c\u8bbe\u8ba1\u5efa\u8bae<\/h2>\n<p>\u4fee\u6539 loss \u540e\uff0c\u4e0d\u8981\u53ea\u770b\u8bad\u7ec3 loss \u4e0b\u964d\u3002\u4f60\u81f3\u5c11\u5e94\u8be5\u6bd4\u8f83\uff1a<\/p>\n<ul>\n<li>\u9ed8\u8ba4 Trainer \u4e0e\u81ea\u5b9a\u4e49 Trainer \u7684\u540c\u4e00 fold \u9a8c\u8bc1 Dice\u3002<\/li>\n<li>\u591a\u4e2a fold \u4e0a\u662f\u5426\u4e00\u81f4\u6539\u5584\u3002<\/li>\n<li>\u5c0f\u76ee\u6807\u7c7b\u522b\u662f\u5426\u771f\u7684\u53d8\u597d\uff0c\u8fd8\u662f\u53ea\u63d0\u5347\u4e86\u5927\u5668\u5b98\u7c7b\u522b\u3002<\/li>\n<li>loss \u66f2\u7ebf\u662f\u5426\u7a33\u5b9a\uff0c\u662f\u5426\u51fa\u73b0 NaN\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4e00\u4e2a loss \u53ea\u5728 fold 0 \u63d0\u5347\uff0c\u5176\u4ed6 fold \u6ca1\u6709\u63d0\u5347\uff0c\u4e0d\u80fd\u8f7b\u6613\u8bf4\u5b83\u4f18\u4e8e\u9ed8\u8ba4 loss\u3002\u533b\u5b66\u56fe\u50cf\u6570\u636e\u96c6\u901a\u5e38\u6837\u672c\u5c11\uff0c\u5355\u6b21\u5212\u5206\u7ed3\u679c\u6ce2\u52a8\u5f88\u5e38\u89c1\u3002<\/p>\n<h2>8. \u5e38\u89c1\u9519\u8bef<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u73b0\u8c61<\/th>\n<th>\u53ef\u80fd\u539f\u56e0<\/th>\n<th>\u5efa\u8bae<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>loss \u76f4\u63a5 NaN<\/td>\n<td>\u9664\u96f6\u3001log \u8f93\u5165\u4e0d\u5408\u6cd5\u3001\u5b66\u4e60\u7387\u8fc7\u9ad8<\/td>\n<td>\u5148\u7528\u9ed8\u8ba4 loss \u5bf9\u7167\uff0c\u68c0\u67e5\u81ea\u5b9a\u4e49 loss \u6570\u503c\u7a33\u5b9a\u6027<\/td>\n<\/tr>\n<tr>\n<td>shape mismatch<\/td>\n<td>\u6ca1\u6709\u5904\u7406 deep supervision \u6216 target \u7ef4\u5ea6<\/td>\n<td>\u6253\u5370 output \u548c target \u7684\u7c7b\u578b\u4e0e shape<\/td>\n<\/tr>\n<tr>\n<td>DDP \u62a5 unused parameters<\/td>\n<td>deep supervision \u67d0\u4e9b\u8f93\u51fa\u6743\u91cd\u5904\u7406\u4e0d\u5f53<\/td>\n<td>\u53c2\u8003\u5b98\u65b9\u6700\u4f4e\u5206\u8fa8\u7387\u6743\u91cd\u5904\u7406\u65b9\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>\u8bad\u7ec3 loss \u4e0b\u964d\u4f46 Dice \u4e0d\u5347<\/td>\n<td>loss \u4f18\u5316\u76ee\u6807\u548c\u8bc4\u4ef7\u6307\u6807\u4e0d\u4e00\u81f4\uff0c\u6216\u6570\u636e\/\u6807\u7b7e\u95ee\u9898<\/td>\n<td>\u68c0\u67e5\u9a8c\u8bc1\u6307\u6807\u548c\u53ef\u89c6\u5316\u7ed3\u679c\uff0c\u4e0d\u53ea\u770b loss<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>9. \u5b98\u65b9\u8d44\u6599\u5165\u53e3<\/h2>\n<p>\u672c\u6587\u4e3b\u8981\u53c2\u8003\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/MIC-DKFZ\/nnUNet\/blob\/master\/nnunetv2\/training\/nnUNetTrainer\/nnUNetTrainer.py\" target=\"_blank\"  rel=\"nofollow\" >nnUNetTrainer.py \u5b98\u65b9\u6e90\u7801<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/MIC-DKFZ\/nnUNet\/blob\/master\/nnunetv2\/training\/loss\/compound_losses.py\" target=\"_blank\"  rel=\"nofollow\" >compound_losses.py \u5b98\u65b9\u6e90\u7801<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/MIC-DKFZ\/nnUNet\/blob\/master\/nnunetv2\/training\/loss\/deep_supervision.py\" target=\"_blank\"  rel=\"nofollow\" >deep_supervision.py \u5b98\u65b9\u6e90\u7801<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/MIC-DKFZ\/nnUNet\/blob\/master\/documentation\/extending_nnunet.md\" target=\"_blank\"  rel=\"nofollow\" >Extending nnU-Net<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/MIC-DKFZ\/nnUNet\/blob\/master\/documentation\/region_based_training.md\" target=\"_blank\"  rel=\"nofollow\" >Region-based Training<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/MIC-DKFZ\/nnUNet\/blob\/master\/documentation\/explanation\/ignore-label.md\" target=\"_blank\"  rel=\"nofollow\" >Ignore Label<\/a><\/li>\n<\/ul>\n<h2>\u672c\u7bc7\u603b\u7ed3<\/h2>\n<p>nnU-Net v2 \u9ed8\u8ba4 loss \u4e0d\u662f\u5355\u4e00 Dice\uff0c\u800c\u662f\u6839\u636e\u4efb\u52a1\u7c7b\u578b\u7ec4\u5408 Dice\u3001CE \u6216 BCE\uff0c\u5e76\u5728\u542f\u7528 deep supervision \u65f6\u7528 <code>DeepSupervisionWrapper<\/code> \u5305\u88c5\u3002\u4fee\u6539 loss \u65f6\uff0c\u63a8\u8350\u7ee7\u627f <code>nnUNetTrainer<\/code> \u5e76\u8986\u76d6 <code>_build_loss<\/code>\uff0c\u5c3d\u91cf\u4fdd\u7559\u5b98\u65b9\u5bf9 ignore label\u3001region\u3001DDP \u548c deep supervision \u7684\u5904\u7406\uff0c\u53ea\u4fee\u6539\u4f60\u771f\u6b63\u8981\u5b9e\u9a8c\u7684\u90e8\u5206\u3002<\/p>\n<h2>\u4e0b\u4e00\u7bc7\u9884\u544a<\/h2>\n<p>\u4e0b\u4e00\u7bc7\u6211\u4eec\u4f1a\u4fee\u6539 data augmentation\uff1a\u7406\u89e3 nnU-Net v2 \u9ed8\u8ba4\u8bad\u7ec3\u589e\u5f3a\u6d41\u7a0b\uff0c\u54ea\u4e9b\u589e\u5f3a\u5bf9\u533b\u5b66\u56fe\u50cf\u6709\u98ce\u9669\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u81ea\u5b9a\u4e49 Trainer \u4e2d\u8c03\u6574 transform\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7bc7\u8bb2\u89e3 nnU-Net v2 \u9ed8\u8ba4 Dice+CE \/ Dice+BCE loss\u3001deep supervision\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u81ea\u5b9a\u4e49 Trainer \u4e2d\u8986\u76d6 _build_loss\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[83],"tags":[],"class_list":["post-1058","post","type-post","status-publish","format-standard","hentry","category-83"],"views":6,"_links":{"self":[{"href":"https:\/\/www.eutaboo.com\/index.php\/wp-json\/wp\/v2\/posts\/1058","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.eutaboo.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.eutaboo.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.eutaboo.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.eutaboo.com\/index.php\/wp-json\/wp\/v2\/comments?post=1058"}],"version-history":[{"count":0,"href":"https:\/\/www.eutaboo.com\/index.php\/wp-json\/wp\/v2\/posts\/1058\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.eutaboo.com\/index.php\/wp-json\/wp\/v2\/media?parent=1058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.eutaboo.com\/index.php\/wp-json\/wp\/v2\/categories?post=1058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.eutaboo.com\/index.php\/wp-json\/wp\/v2\/tags?post=1058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}