Git Product home page Git Product logo

carnd-term3-p2-semantic-segmentation's Introduction

CarND-Term3-P2-Model-Semantic-Segmentation

Overview

In this project, you'll label the pixels of a road in images using a Fully Convolutional Network (FCN). You will need to extract the layers from the existing VGG-16 model and restructure the layers with several techniques like changing fully connected layer to fully convolutional layer, adding skip connections. And you will start to learn how to enhance your classifier's performance with using Intersection Over Union Metric (IOU) and inference optimization.
Here is the link to the orginal repository provided by Udaciy. This repository contains all the code needed to complete the project for the Model Semantic Segmentation course in Udacity's Self-Driving Car Nanodegree.


Example: um series with training epoch = 60
um

Prerequisites/Dependencies

Setup Instructions (abbreviated)

  1. Meet the Prerequisites/Dependencies
  2. Clone the repo from https://github.com/udacity/CarND-Semantic-Segmentation
  3. 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.
  4. Build and run your code.
  5. main.py will check to make sure you are using GPU - if you don't have a GPU on your system, you can use AWS or another cloud computing platform.

Project Description

  • CarND-Term3-P2-Semantic-Segmentation.ipynb: Jupyter notebook for visualize coding and debugging.
  • helper.py: Helper functions for use in main.py.
  • main.py: Main function to extract and restructure layers, training and validating the new classifier, then labelling the pixel of road in test images.
  • project_tests.py: Unit test functions for validating each function in main.py.
  • README.md: Writeup for this project, including setup, running instructions and project rubric addressing.
  • images: Newest inference images from runs folder (all images from the most recent run).

Run the project

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.

Tips

  • The link for the frozen VGG16 model is hardcoded into helper.py. The model can be found here.
  • The model is not vanilla VGG16, but a fully convolutional version, which already contains the 1x1 convolutions to replace the fully connected layers. Please see this post for more information. A summary of additional points, follow.
  • The original FCN-8s was trained in stages. The authors later uploaded a version that was trained all at once to their GitHub repo. The version in the GitHub repo has one important difference: The outputs of pooling layers 3 and 4 are scaled before they are fed into the 1x1 convolutions. As a result, some students have found that the model learns much better with the scaling layers included. The model may not converge substantially faster, but may reach a higher IoU and accuracy.
  • When adding l2-regularization, setting a regularizer in the arguments of the tf.layers is not enough. Regularization loss terms must be manually added to your loss function. otherwise regularization is not implemented.

Project Rubric

1. Build the Neural Network

1.1 Does the project load the pretrained vgg model?

Yes, it does.

1.2 Does the project learn the correct features from the images?

Yes, it does.

1.3 Does the project optimize the neural network?

Yes, it does.

1.4 Does the project train the neural network?

Yes, it does.

2. Neural Network Training

2.1 Does the project train the model correctly?

Yes, it does.

2.2 Does the project use reasonable hyperparameters?

Yes, it does.

2.3 Does the project correctly label the road?

Yes, it does.

Result Comparison

Test Results (Learning rate is 0.000001)

Iteration Epochs Batch_size Loss Time/Epoch (Sec) Comments
1 10 5 0.897 54.565 No restart Jupyter Notebook
2 20 5 0.558 57.618 No restart Jupyter Notebook
3 30 5 0.520 59.902 No restart Jupyter Notebook
4 40 5 0.559 54.364 No restart Jupyter Notebook
5 50 5 0.237 54.467 Restart Jupyter Notebook
6 60 5 0.211 54.412 Restart Jupyter Notebook

Test Results (Learning rate is 0.00001)

Iteration Epochs Batch_size Loss Time/Epoch (Sec) Comments
1 10 5 0.146 54.313 Restart Jupyter Notebook
2 20 5 0.071 54.182 Restart Jupyter Notebook
3 30 5 0.042 54.102 Restart Jupyter Notebook
4 40 5 0.064 54.039 Restart Jupyter Notebook
5 50 5 0.027 54.017 Restart Jupyter Notebook
6 60 5 0.029 53.818 Restart Jupyter Notebook

Conclusion:
Using learning rate 0.00001 has a faster converge speed than 0.000001.

Videos

Compare um series with training epoch = 10, 30, 60.
um series with training epoch = 10
um
um series with training epoch = 30
um
um series with training epoch = 60
um


Compare umm series with training epoch = 10, 30, 60.
umm series with training epoch = 10
umm
umm series with training epoch = 30
umm
umm series with training epoch = 60
umm


Compare uu series with training epoch = 10, 30, 60.
uu series with training epoch = 10
uu
uu series with training epoch = 30
uu
uu series with training epoch = 60
uu

Conclusion:
Higher training epochs can provide better image classification result, epoch = 50 is good enough for this project according to the test result.

carnd-term3-p2-semantic-segmentation's People

Contributors

astromme avatar baumanab avatar brok-bucholtz avatar jinchaolu avatar johnflux avatar mvirgo avatar

Watchers

 avatar

Forkers

guoquheweilai

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.