build a fully convolutional neural network (FCN) based on the VGG-16 image classifier architecture to segment drivable road area from car front-camera image. (experiments done on the KITTTI dataset)
A pre-trained vgg-16 is adapted in architecture to be a FCN network, by transform fully-connected layer to be convolutional and adding deconvulutional layers and skip connections. In detail,
- the convolved vgg layer 7 is upsampled and added to convolved vgg layer 4, resulting into layer A;
- layer A is added to convolved vgg layer 3, resulting into layer B;
- layer B is upsampled to be the final output -- layer C.
Inspired by the filter number of the original vgg, in our net, we don't need huge amount of filters to save semantic information, but only small amount of filters to refer a pixel is drivable road or not. In our net,
- layer A has 2*16 feature maps (due to 2 *16 filters in convolution);
- layers B 2*8 feature maps;
- layer C 2*4 feature maps;
- layer C 2 feature maps (which is segmentation map).
- keep_prob: 0.5
- learning_rate: 1e-3
- epochs: 30
- batch_size: 16
- loss function: cross-entropy
- error optimizer: Adam
Steadily, the model loss (averaged over a batch) shrinks over time. Epoch 1, batch 1, 0.696 Epoch 2, batch 1, 0.266 Epoch 3, batch 1, 0.248 Epoch 4, batch 1, 0.152 Epoch 5, batch 1, 0.153 ... Epoch 10, batch 1, 0.096 ... Epoch 20, batch 1,0.035 ... Epoch 30, batch 1, 0.023
Segmentation results is acceptable. See the below working cases, where predicted drivable road pixels are marked in transparent green.
In a few of pixels, due to the heavy shallow, the net fails to predict road in shallow as positive area.
In this project, you'll label the pixels of a road in images using a Fully Convolutional Network (FCN).
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.