In this project, I have labeled the pixels of a road in images using a Fully Convolutional Network (FCN).
To do this, I used VGG16 as an encoder, then 1x1 convolutions which replace the fully connected layers in the original
VGG16 model, followed by a decoder, consisting of series of transposed convolutions and skip connections. The idea is
that after the image goes through the encoder, a vector representing its semantics will be created and then this vector
will be decoded into an image again from the decoder. The architecture for the decoder can be found in the layers
method
in main.py
. L2 regularization has been used in the decoder to avoid overfitting.
- Learning rate: 1e-4
- Dropout with keep probability: 0.5
- Epochs: 20
The training was done on a p2.xlarge
instance in AWS and took ~30 minutes to train. Full logs from the training are
available in the file train.log
. The loss function is 1.01993
in the beginning and it steadily goes down until it
reaches 0.019856
after 20 epochs.
Original | Semantic segmentation |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Make sure you have the following is installed:
Download the Kitti Road dataset from here. Extract the dataset in the data
folder. This will create the folder data_road
with all the training a test images.
Implement the code in the main.py
module indicated by the "TODO" comments.
The comments indicated with "OPTIONAL" tag are not required to complete.
Run the following command to run the project:
python main.py
Note If running this in Jupyter Notebook system messages, such as those regarding test status, may appear in the terminal rather than the notebook.
- Ensure you've passed all the unit tests.
- Ensure you pass all points on the rubric.
- Submit the following in a zip file.
helper.py
main.py
project_tests.py
- Newest inference images from
runs
folder (all images from the most recent run)
A well written README file can enhance your project and portfolio. Develop your abilities to create professional README files by completing this free course.