<<<<<<< HEAD
This project is centered on the segmentation of roads in satellite images using Convolutional Neural Networks (CNNs), particularly the U-Net architecture. The objective is to classify each pixel in the images as either road or background, leveraging deep learning techniques for accurate segmentation.
Before starting, ensure the following libraries are installed:
- TensorFlow
- Keras
- NumPy
- Pandas
- Matplotlib
- OpenCV
- SciPy
- scikit-learn
- scikit-image
The data preparation phase involves loading satellite images and their corresponding ground truth labels. Functions are provided for loading images, converting image formats, concatenating images with their labels, and cropping images into patches.
Several functions are included for displaying images and overlays, such as overlaying predictions on the original images for visual comparison.
The project includes comprehensive data augmentation and preprocessing capabilities:
- Elastic deformation of images
- Random cropping and padding
- Resizing and padding images and masks
- Color augmentation
- Generating augmented datasets
A U-Net model is built for the task. The build_unet function allows for customizable parameters, including depth, dropout rates, and activation functions. The model's architecture is designed to effectively capture the spatial hierarchies in satellite images.
The project includes functionalities for training the U-Net model with the augmented dataset. It covers normalizing the training and test sets, converting ground truth to binary format, and defining class weights for balancing. The training process is monitored using callbacks like EarlyStopping and TensorBoard.
Evaluate the model's performance on a validation set using metrics like the F1 score. Functions are provided for applying different thresholds to the model's predictions to optimize the F1 score.
The project includes functions for making predictions on test images, converting these predictions into segmented outputs, and displaying them.
origin/main