Result of binary segmentation is blurred images

I am working on a binary segmentation problem for which I have to segment the lesions using an automated breast ultrasound system (ABUS) data set. I am using binary cross entropy as loss function with U-Net CNN model. The resultant images got blurry effects. The more number of epochs I run the experiment, the more blurriness occurs. What leads to result such blurry effect and what change should I make to my model to get rid of that?

@dknurfaizah Welcome to Tensorflow Forum!

The blurry effect in your binary segmentation results using the U-Net CNN model is likely due to overfitting. Overfitting occurs when the model learns the training data too well and fails to generalize to new data. This can lead to overly smooth and inaccurate predictions, especially at object boundaries.

To mitigate overfitting and improve the sharpness of your segmentation results, you can consider the following strategies:

  1. Data Augmentation: Expand your training dataset by applying data augmentation techniques, such as random cropping, flipping, and rotating the images. This will provide the model with more diverse training examples and help it learn more generalizable features.
  2. L2 Regularization: Add L2 regularization to the loss function to penalize large weights in the model. This will discourage the model from overfitting to the training data and encourage it to learn more robust features.
  3. Early Stopping: Implement early stopping to halt training when the validation loss stops improving. This will prevent the model from overfitting on the training data and improve its generalization performance.
  4. Dropout: Apply dropout regularization to the network architecture. Dropout randomly drops neurons during training, forcing the model to learn redundant features and reducing overfitting.
  5. Sharpen Predictions: Post-process the segmentation results to sharpen the boundaries. Techniques like morphological operations, edge detection, and conditional random fields can help refine the segmentation masks.
  6. Optimize Hyperparameters: Carefully tune the hyperparameters, such as learning rate, batch size, and optimizer settings, to find the optimal combination that balances training accuracy with generalization performance.

By implementing these strategies, you can effectively address the blurry effect in your binary segmentation results and obtain sharper, more accurate predictions from your U-Net CNN model.

Let us know if this helps!