Back

Binary segmentation model with U-Net architecture

Computer vision model for detecting nerves of the brachial plexus in ultrasound images

Overview

This project implements a complete deep learning pipeline for the binary segmentation of Brachial Plexus nerve structures in biomedical ultrasound images. Leveraging the classic U-Net architecture within PyTorch, the model is designed to identify specific anatomical features with high precision. The project features a production-ready workflow including Docker containerization for reproducibility and Weights & Biases for real-time experiment tracking.

The Challenge

The main challenge involved processing high-noise ultrasound data where nerve structures are often indistinct from surrounding tissue. Additionally, training segmentation models on high-resolution medical images requires significant computational resources. Managing GPU memory usage while maintaining a sufficiently large batch size and handling class imbalance between nerve pixels and background pixels were critical technical hurdles.

The Solution

I implemented a standard U-Net architecture known for its efficacy in biomedical segmentation. To address memory constraints and accelerate training, I utilized PyTorch's automatic mixed precision (AMP). To improve model generalization, I built a robust data augmentation pipeline using Albumentations. Finally, I optimized the training process using a hybrid Loss function (Binary Cross Entropy + Dice Loss) to better handle the segmentation overlap and pixel classification simultaneously.

Key Takeaways

  • Implementation of U-Net architecture for semantic segmentation from scratch.
  • Optimization of GPU resources using automatic mixed precision (AMP).
  • Setting up a reproducible MLOps environment with Docker and WandB.
  • Handling biomedical image data with advanced augmentations and hybrid loss functions.