U-Net Breast MRI: Low validation score, decreasing train loss #7556
Replies: 1 comment 4 replies
-
Hi @Marinos736,
A dataset of 99 images is quite small for training a deep learning model from scratch, such as U-Net. However, it might still work. The U-Net architecture is specifically designed for semantic segmentation tasks and it's often capable of producing good results even with small datasets, especially in medical imaging.
Data augmentation can be very useful in preventing overfitting, especially with small datasets. For your medical imaging task, you can consider geometric transformations like rotation, scaling, and flipping. Elastic deformations can also simulate anatomical variations and are commonly used in medical image analysis. Additionally, you can try intensity transformations like random Gaussian noise, random bias field, or gamma adjustments to account for variations in illumination, contrast, and shading.
The low Dice score could be due to several reasons including small dataset size, model overfitting, insufficient training, improper data preprocessing or augmentation, imbalance between classes, etc.
You can use mixed precision training, which halves the memory footprint of your floating-point tensors, and hence allows you to train larger models or use larger batch sizes. Lastly, you could consider using multiple GPUs if you have access to more. Hope it helps, thanks. |
Beta Was this translation helpful? Give feedback.
-
I have a tumour segmentation problem and im using the MONAI framework to load and transform my data as well as create a model. The dataset consists of 99 images (512x512x116) with their corresponding binary masks showing benign and malignant tumours. The images are shuffled and split into train and validation sets at 80% split.
Following the Spleen 3D tutorial the code is pretty standard monai-code with the following differences:
Im using minimal transformations for sanity check plus some augmentation
2.ThreadDataLoader instead of Dataloader:
train_loader = ThreadDataLoader(train_ds, batch_size=1, num_workers=0)
optimizer = torch.optim.AdamW(model.parameters(), lr=1e-4, weight_decay=1e-5)
loss_function = GeneralizedDiceLoss(include_background=False, to_onehot_y=True, softmax=True)
post_pred = Compose([Activations(softmax=True), AsDiscrete(argmax=True, to_onehot=2)])
While train loss is decreasing steadily, the validation score never surpasses a dice score of ~0.2-0.3 max at over 100 epochs (with training loss under 0.2 at that point).
QUESTIONS
Firstly, is the dataset big enough to train a U-Net from scratch?
Which augmentations would be enough in order to overcome overfitting issues?
The big question is what could be the reason for the low dice score and what can I do?
Also, when im trying to increase batch size i get CUDA error: out of memory so increasing batch size might not be possible for this problem.
I will appreciate any advice on these issues and please do not hesitate to tell me if any additional information is needed.
Beta Was this translation helpful? Give feedback.
All reactions