https://github.com/deepmancer/unet-semantic-segmentation
PyTorch UNet model for semantic segmentation of urban scenes using the Cityscapes dataset
https://github.com/deepmancer/unet-semantic-segmentation
cityscapes from-scratch image-segmentation semantic-segmentation unet unet-image-segmentation unet-pytorch
Last synced: 4 months ago
JSON representation
PyTorch UNet model for semantic segmentation of urban scenes using the Cityscapes dataset
- Host: GitHub
- URL: https://github.com/deepmancer/unet-semantic-segmentation
- Owner: deepmancer
- Created: 2023-05-10T19:30:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-16T13:05:10.000Z (11 months ago)
- Last Synced: 2024-10-11T20:04:30.104Z (9 months ago)
- Topics: cityscapes, from-scratch, image-segmentation, semantic-segmentation, unet, unet-image-segmentation, unet-pytorch
- Language: Jupyter Notebook
- Homepage:
- Size: 2.51 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🏙️ UNet for Semantic Segmentation of Urban Scenes
![]()
![]()
![]()
### About
This project implements a UNet model for performing high-precision semantic segmentation on urban road scenes captured by self-driving car cameras.
---
## 📝 Project Description
Semantic segmentation is a critical task in computer vision, particularly in the context of autonomous driving. This project focuses on developing a UNet-based model capable of accurately identifying and classifying each pixel in a road scene image. The goal is to segment various elements such as roads, cars, pedestrians, and buildings, contributing to a machine's understanding of its environment.
### 🎯 Objectives
- **Model**: Implement a UNet architecture for semantic segmentation.
- **Task**: Classify each pixel in high-resolution images into one of 19 object classes.
- **Application**: Enhance the safety and navigation of self-driving cars through precise environmental perception.---
## 🛠️ Prerequisites
Ensure that you have the following dependencies installed before running the project:
- **Python 3.6+**: The programming language used for the project.
- **PyTorch**: The deep learning framework employed for building and training the UNet model.
- **Pandas**: For data manipulation and analysis.
- **NumPy**: For numerical operations, particularly with arrays and matrices.You can install the required libraries via pip:
```bash
pip install torch pandas numpy
```---
## 🌆 Dataset: Cityscapes
The **Cityscapes Dataset** is a large-scale benchmark dataset used for training and evaluating models for semantic urban scene understanding.
### Dataset Overview
- **Total Images**: 5,000 high-resolution images
- **Resolution**: 2048x1024 pixels per image
- **Classes**: 19 object classes, including roads, cars, pedestrians, buildings, and more
- **Annotations**: High-quality pixel-level annotations
![]()
---
## ⚙️ Model Architecture: UNet
UNet is a powerful convolutional network designed for semantic segmentation tasks. It excels at accurately segmenting images, even when the training data is limited. The architecture is characterized by its encoder-decoder structure:
- **Encoder**: Captures the context of the input image through a series of convolutional and max-pooling layers.
- **Decoder**: Reconstructs the spatial resolution using up-convolutional layers, allowing the model to predict the segmentation mask for each pixel.### Training
- **Optimization**: The model is trained using the Cityscapes dataset, focusing on learning the complex urban scene structures.
- **Loss Function**: A combination of cross-entropy loss and dice loss is used to optimize pixel-wise predictions.
- **Evaluation**: The model's performance is evaluated using metrics such as Intersection over Union (IoU) and pixel accuracy.---
## 🖼️ Results
The UNet model delivers high-quality segmentation outputs, distinguishing between various elements of urban scenes with remarkable precision.
![]()