DenseNet overfitting on 3D MRI volume classification

username: Ian_Ben
cooked: <p>I was trying to do pCR classification on the I-SPY 1 dataset(<a href="https://wiki.cancerimagingarchive.net/pages/viewpage.action?pageId=20643859" class="inline-onebox" rel="noopener nofollow ugc">Multi-center breast DCE-MRI data and segmentations from patients in the I-SPY 1/ACRIN 6657 trials (ISPY1) - The Cancer Imaging Archive (TCIA) Public Access - Cancer Imaging Archive Wiki</a>) (about 200 3D MRI volumes). But the 3D densenet from monai package overfits quickly, since the model output all 0 for validation dataset. Anyone do 3D data classification and encounter similar issues before?</p>

username: Xinyuan_Wang
cooked: <p>longtail distribution?</p>

username: Ian_Ben
cooked: <p>It is a binary classification, about150 samples with minority class accounting for 27%, so I tried to add weights at the crossentropy loss and used WeightedRandomSampler, but still no luck.</p>

username: Xinyuan_Wang
cooked: <p>Any dataset transform mistake? Or Any post-processing mistake?</p>

username: Ian_Ben
cooked: <p>For data transform, I used</p>
<p>train_transforms = Compose([ScaleIntensity(), AddChannel(), RandRotate90(), EnsureType()])</p>
<p>val_transforms = Compose([ScaleIntensity(), AddChannel(), EnsureType()])</p>
<p>It is a image level classification, so I didn’t use post-processing. Just a 3D DenseNet from monai, and weighted CrossEntropy loss.</p>

username: Xinyuan_Wang
cooked: <aside class="onebox githubblob" data-onebox-src="https://github.com/Project-MONAI/tutorials/blob/main/3d_classification/densenet_training_array.ipynb">
  <header class="source">

      <a href="https://github.com/Project-MONAI/tutorials/blob/main/3d_classification/densenet_training_array.ipynb" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/Project-MONAI/tutorials/blob/main/3d_classification/densenet_training_array.ipynb" target="_blank" rel="noopener nofollow ugc">Project-MONAI/tutorials/blob/main/3d_classification/densenet_training_array.ipynb</a></h4>


      <pre><code class="lang-ipynb">{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Copyright (c) MONAI Consortium  \n",
    "Licensed under the Apache License, Version 2.0 (the \"License\");  \n",
    "you may not use this file except in compliance with the License.  \n",
    "You may obtain a copy of the License at  \n",
    "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;http://www.apache.org/licenses/LICENSE-2.0  \n",
    "Unless required by applicable law or agreed to in writing, software  \n",
    "distributed under the License is distributed on an \"AS IS\" BASIS,  \n",
    "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  \n",
    "See the License for the specific language governing permissions and  \n",
    "limitations under the License.\n",
    "\n",
    "# 3D classification example based on DenseNet\n",
    "\n",
    "This tutorial shows an example of 3D classification task based on DenseNet and array format transforms.\n",
</code></pre>



  This file has been truncated. <a href="https://github.com/Project-MONAI/tutorials/blob/main/3d_classification/densenet_training_array.ipynb" target="_blank" rel="noopener nofollow ugc">show original</a>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>


username: Ian_Ben
cooked: <p>Yes, I also tried that demo code. I defined the dataset, transforms, a network, and trained it. On the IXI data, it achieved an accuracy of over 0.85. However, on the breast MRI dataset, the performance is much worse (mostly the negative samples are incorrectly predicted). I am not sure where I went wrong.</p>

username: Xinyuan_Wang
cooked: <p>Using Data Augmentation: For image classification problems, you can increase the number of samples for minority classes by using data augmentation. Data augmentation includes various transformations on images, such as rotation, scaling, and flipping, which can generate new samples.</p>