This project focuses on image segmentation using the U-Net architecture. The goal of the project is to train a U-Net model to perform pixel-level classification on a dataset, specifically for segmentation tasks. The project is divided into several stages including data preprocessing, model training, and evaluation.
The repository contains the following key files and scripts:
- A Jupyter notebook that demonstrates the process of image segmentation using the U-Net model. This includes loading the dataset, preprocessing, loading custom model weights and evaluating the results.
- A Jupyter notebook dedicated to training the U-Net model on the processed dataset. It covers the training loop, loss functions, optimizers and evaluation metrics used to measure the performance of the model.
- A Python script that defines the U-Net model architecture. This script includes the U-Net implementation with customizable layers and configurations for image segmentation tasks.
- A Python script that handles data preprocessing. This script processes raw data, including image resizing, normalization of mask and splitting dataset, to prepare it for model training.
- U-Net Architecture: Implements a robust U-Net model, which is widely used for biomedical image segmentation.
- Data Preprocessing: Ensures that the data is appropriately prepared for training with resizing and normalization.
- Model Training: Supports training with different hyperparameters such as batch size, learning rate, and early stopping.
- Evaluation Metrics: Uses metrics like Intersection over Union (IoU) and Dice coefficient to evaluate the performance of the model.
To run the project, you'll need the following Python packages:
pip install tensorflow keras numpy pandas matplotlib seaborn scikit-learn opencv-python- Model Training: Use
model_training.ipynbto train the U-Net model on the prepared dataset. - Segmentation: Perform image segmentation using
image_segmentation.ipynb, which includes evaluation on test data. - Custom Scripts: You can modify
UNet.pyfor model architecture adjustments and usedata_prep.pyfor any additional data processing needs.
The model is evaluated using two primary metrics:
- Intersection over Union (IoU): Measures the overlap between predicted and actual masks.
- Dice Coefficient: Provides a score for similarity between predicted and actual masks, especially useful in segmentation tasks.
This project demonstrates how U-Net can be used for image segmentation tasks, providing scripts for preprocessing, training, and evaluating the model.