<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zack Zhu on Medium]]></title>
        <description><![CDATA[Stories by Zack Zhu on Medium]]></description>
        <link>https://medium.com/@jiawenzhu?source=rss-c661ceb6394c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dhhAMQRP9IKYdsv5.</url>
            <title>Stories by Zack Zhu on Medium</title>
            <link>https://medium.com/@jiawenzhu?source=rss-c661ceb6394c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:19:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jiawenzhu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Behavioral Cloning Project]]></title>
            <link>https://medium.com/@jiawenzhu/behavioral-cloning-project-1427b351537e?source=rss-c661ceb6394c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1427b351537e</guid>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[cnn]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Zack Zhu]]></dc:creator>
            <pubDate>Sun, 18 Aug 2019 22:21:11 GMT</pubDate>
            <atom:updated>2019-08-18T22:22:31.396Z</atom:updated>
            <content:encoded><![CDATA[<p>The objective of this project is to train a deep neural network and convolutional neural network to clone driving behavior.</p><p>The process for developing this project is:<br>1. Data collection<br>2. Build the model<br>3. Use the model to drive the car autonomously</p><p>All of above steps can be done in your local laptop, you don’t need to develop and run your code in workspace if you wanna save time of using GPU in workspace. If you are using Mac, you can check the GPU usage in Activity Monitor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*-qQ_gVrNVzP4CDXeW1Zbtg.png" /></figure><p><strong>Data collection<br></strong>Collecting data as training data is a prerequisite for building any ML/DL model. Udacity provides a simulator where we can steer a car around the track to collect training data. You need to collect <strong>enough</strong> and <strong>good</strong> data so that you can build a good model.</p><p>Q: What is good data?<br>For this project, our goal is letting the car drive autonomously in the center lane as much as possible. When you steer the car in training mode, you’d better drive the car in the center of lane because the vehicle’s driving behavior is only as good as the behavior of the driver who provided the data.<br>However, if your training data is all focused on driving down the center of lane, the model won’t have chance to learn how to recover back to the center of lane if it goes off to the left/right side of the road. So we need to do recovery laps.<br>Another trick you can apply is driving counter-clockwise. If you drive the car along track one several times, you can find that most of the time, you are turning left, so the track has a left turn bias. One way to combat the bias is turn the car around and drive counter-clockwise around the track, this can let the model learn how to avoid left turn bias and generalize better.</p><p>Q: What is enough data?<br>This model outputs a single continuous numeric value, the error metric you can use is mean squared error. If this error metric is low on training set but high on validation set which means the model is overfitting, you need to collect more data to improve the model.<br>When I training the model, the mean squared error is low on both training and validation sets, but the car is continuously falling off on the last two curves. So I collect more data specifically for these two curves.</p><p>In conclusion, Here’s how I collect the data:<br>1. Three laps of center lane driving.<br>2. One to Two lap of recovery driving from both left and right sides.<br>3. Six laps specifically for the last two curves.</p><p><strong>Data Augmentation<br></strong>I mentioned the way how we collect data to avoid left turn bias, Flipping images as data augmentation also helps.</p><p><strong>Data Pre-processing<br></strong>The size of images captured by cameras is 160x320, not all the pixels in the images contain useful information. We can crop the top and bottom portion of the image so that the model can be trained faster.</p><p><strong>Build the model</strong><br>I use the CNN created by Nvidia because this model is better than the other one I’ve experimented which is LeNet.<br>This is the architecture of the model:<br>- A Lambda layer to parallelize image normalization. It normalize all the pixel values within the range [-1, 1]<strong><br>- </strong>A Cropping layer which crops the image size to 70x25<br>-<strong> </strong>A Convolutional layer with 5x5 kernel, stride of 2, depth of 24 followed by RELU activation<br>-<strong> </strong>A Convolutional layer with 5x5 kernel, stride of 2, depth of 36 followed by RELU activation<br>-<strong> </strong>A Convolutional layer with 5x5 kernel, stride of 2, depth of 48 followed by RELU activation<br>-<strong> </strong>A Convolutional layer with 3x3 kernel, depth of 64 followed by RELU activation<br>-<strong> </strong>A Convolutional layer with 3x3 kernel, depth of 64 followed by RELU activation<br>-<strong> </strong>A Fully-connected layer with 100 hidden units<br>-<strong> </strong>A Fully-connected layer with 50 hidden units<br>-<strong> </strong>A Fully-connected layer with 10 hidden units<br>-<strong> </strong>A Fully-connected layer with 1 hidden units (steering angle output)<br>Check out this Blog for more details:</p><p><a href="https://devblogs.nvidia.com/deep-learning-self-driving-cars/">End-to-End Deep Learning for Self-Driving Cars | NVIDIA Developer Blog</a></p><p><strong>Use the model to drive the car autonomously<br></strong>After training the model, enter the autonomous mode and use the model to drive the car. Iterate several times until the car can drive in the center of the lane and turn around smoothly.<br>Here is the video which records the vehicle driving autonomously around the track.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fl2KenQcwfeQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dl2KenQcwfeQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fl2KenQcwfeQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d378859d9f5312fb211fbb9712fe128/href">https://medium.com/media/2d378859d9f5312fb211fbb9712fe128/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1427b351537e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>