https://github.com/dalageo/iddroadsegmentation
Distinguishing Urban Roads from Non-Road Regions in the Indian Driving Dataset(IDD) Using Binary Deep Learning Segmentation 🛣️
https://github.com/dalageo/iddroadsegmentation
cnn computer-vision deep-learning efficientnet fpn image-segmentation python pytorch segmentation-models u-net
Last synced: 5 months ago
JSON representation
Distinguishing Urban Roads from Non-Road Regions in the Indian Driving Dataset(IDD) Using Binary Deep Learning Segmentation 🛣️
- Host: GitHub
- URL: https://github.com/dalageo/iddroadsegmentation
- Owner: Dalageo
- License: gpl-3.0
- Created: 2024-11-21T13:05:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-12T15:24:49.000Z (about 1 year ago)
- Last Synced: 2025-06-08T05:09:26.542Z (8 months ago)
- Topics: cnn, computer-vision, deep-learning, efficientnet, fpn, image-segmentation, python, pytorch, segmentation-models, u-net
- Language: Jupyter Notebook
- Homepage:
- Size: 5.8 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# Distinguishing Urban Roads from Non-Road Regions in the Indian Driving Dataset(IDD) Using Binary Deep Learning Segmentation 🛣️
This project develops a binary segmentation model capable of distinguishing between **Road** and **Non-Road** regions in urban driving images captured in India. Models utilizing pixel-level analysis are provided, including a U-Net model built from scratch, a pretrained U-Net, and a pretrained FPN, with the pretrained U-Net being fine-tuned on the IDD dataset. The outcomes of this project have potential applications in various domains, such as autonomous driving, road maintenance, mapping and infrastructure planning, or traffic management.
More specifically, the segmentation process is based on a [U-Net architecture](https://arxiv.org/pdf/1505.04597v1), imported from the [segmentation_models](https://github.com/qubvel-org/segmentation_models.pytorch) PyTorch library, which uses an EfficientNet backbone pre-trained on ImageNet. To improve its performance and ensure robustness across diverse scenarios, several data augmentation techniques are employed during training. These techniques include horizontal and vertical flips, as well as brightness adjustments, enabling the model to effectively learn from a more varied dataset and generalize better to unseen images, while accounting for the complexity and variability inherent in real-world urban environments.
## Dataset Description
The dataset used in this project is the [Indian Driving Dataset (IDD)](https://www.kaggle.com/datasets/mitanshuchakrawarty/new-idd-dataset/data), which consists of road images and their corresponding segmentation masks. This dataset is specifically designed for binary segmentation tasks, such as distinguishing between **Road** and **Non-Road** areas. All images and masks have been resized to uniform dimensions of **512x512 pixels**. The dataset is organized into two folders:
- `image_archive` contains the images in 3 channels (RGB), including a total of 6993 images. The files are in a `.png` format and are named as `Image_{num}`.
- `mask_archive` contains 6993 single-channel binary masks corresponding to the road images. The masks are also in a `.png` format and are named as `Mask_{num}` to align with the number of the images, making them easy to locate.
The following table represents the summary of the data as well as the number of files, shapes, and their naming conventions:
| Directory | Description | Number of Files | Shape | Example Naming |
|------------------|------------------------------|------------------|-------------|-------------------|
| `image_archive` | Road images | 6993 | 512x512x3 | `Image_{num}.png` |
| `mask_archive` | Binary masks (Road/Non-Road) | 6993 | 512x512 | `Mask_{num}.png` |
Below is an example of a road image and its corresponding mask aligned pixel-wise. An additional overlay visualization (not included in the dataset) is provided to visually demonstrate how the mask highlights specific regions (e.g., Road vs. Non-Road) in the context of the original image.
## Setup Instructions
###
**Local Environment Setup**
1. **Clone the repository**:
```sh
git clone https://github.com/Dalageo/IDDRoadSegmentation.git
2. **Navigate to the cloned directory**:
```sh
cd IDDRoadSegmentation
3. **Open the `IDDRoadSegmentation.ipynb` using your preferred Jupyter-compatible environment (e.g., [Jupyter Notebook](https://jupyter.org/), [VS Code](https://code.visualstudio.com/), or [PyCharm](https://www.jetbrains.com/pycharm/))**
4. **Update the dataset, model and output directory paths to point to the location on your local environment.**
5. **Run the cells sequentially to reproduce the results.**
## Acknowledgments
Firstly, I would like to thank Olaf Ronneberger, Philipp Fischer, and Thomas Brox for introducing U-Net in their 2015 paper, *["U-Net: Convolutional Networks for Biomedical Image Segmentation."](https://arxiv.org/abs/1505.04597)*.
Additionally, special thanks to [Pavel Iakubovskii](https://github.com/qubvel) for developing and maintaining the [segmentation_models](https://github.com/qubvel-org/segmentation_models.pytorch) pytorch library which was essential to the developement of this project.
## License
The segmentation library is primarily licensed under the [MIT License](https://github.com/qubvel-org/segmentation_models.pytorch/blob/main/LICENSE), with some files under other licenses. Refer to the [LICENSES](https://github.com/qubvel-org/segmentation_models.pytorch/blob/main/licenses/LICENSES.md) directory and file statements for details, especially regarding commercial use. Meanwhile, the provided notebook, and accompanying documentation, are licensed under the [AGPL-3.0 license](https://www.gnu.org/licenses/agpl-3.0.en.html). AGPL-3.0 license was chosen to promote open collaboration, ensure transparency, and allow others to freely use, modify, and contribute to the work.
Any modifications or improvements must also be shared under the same license, with appropriate acknowledgment.