<?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[CodingJourney - Medium]]></title>
        <description><![CDATA[Life &amp; Learning - Medium]]></description>
        <link>https://medium.com/chiukevin0321?source=rss----3760e55735e2---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>CodingJourney - Medium</title>
            <link>https://medium.com/chiukevin0321?source=rss----3760e55735e2---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 11:05:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/chiukevin0321" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Classic CNN introduction]]></title>
            <link>https://medium.com/chiukevin0321/famous-cnn-introduction-cd6e0939c5db?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/cd6e0939c5db</guid>
            <category><![CDATA[knowledge]]></category>
            <category><![CDATA[convolutional-neural-net]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Sat, 11 Jul 2020 03:32:07 GMT</pubDate>
            <atom:updated>2020-07-11T06:16:55.200Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Briefly introduces classic CNN including LeNet, AlexNet, VGG, GoogLeNet, ResNet</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/0*6yVdxY_8z_xcSpvF.png" /><figcaption>取自網路</figcaption></figure><h3>LeNet:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oF5BxbryIZJdehF_.png" /></figure><p>一切CNN的起源，最基礎的Conv -&gt; Pooling -&gt; FCN</p><blockquote><strong>pooling</strong>: average pooling(會有特徵模糊的問題)</blockquote><blockquote><strong>activation</strong> <strong>func</strong>: tanh/sigmoid(會有梯度消失問題)</blockquote><h3>AlexNet:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-1-AqUkaiekiZWgM.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s289au-xwnKQ5v-N.png" /></figure><p>類似LeNet5的架構，算是其加強版。主要的新技術與應用是把 ReLU, Dropout加到model中，並用GPU（一次訓練兩個model）來加快training效率以及data augmentation增加訓練資料集</p><blockquote><strong>pooling</strong>: max pooling （擷取特徵）</blockquote><blockquote><strong>activation</strong> <strong>func</strong>: ReLU （避免梯度消失，使模型更有效率）</blockquote><blockquote><strong>avoid overfitting</strong>: Dropout （避免過擬合）</blockquote><h3>VGG: 導入3x3 conv</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/0*Lv2E4P0FpPFcPkAN.png" /></figure><p>一樣是Conv + Max pooling+ FC layer，特點是conv kernel皆為3x3奠定了使用3x3 conv kernel的趨勢，缺點是參數量是全部模型裡最大的。</p><blockquote>擷取自：<a href="https://medium.com/@chenchoulo/convolution-neural-network-cnn-175d924bfcc1">Convolution Neural Network 介紹(CNN 介紹)</a></blockquote><blockquote>論文中解釋關於僅使用3x3 conv kernel，因為兩個3x3的conv kernel疊合的reception field等效於一個5x5 conv kernel(亦即每個pixel可以correlate到周圍的5x5個pixel), 而三個3x3則可以等效於一個7x7，但兩層3x3的參數量僅有一層5x5的(3x3x2)/(5x5) = 0.72倍，而三層3x3參數量是一層7x7的(3x3x3)/(7x7)=0.55倍，對應到的範圍等效並且可使得需參數量更少，並且疊越多層Conv+ReLU的特徵學習能力比單一層Conv+ReLU來的更好。</blockquote><h3>GoogLeNet: 導入inception</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*NmVEDXKwqgFg0rXd.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/0*kQJGn5aZ8JfmdZbe.PNG" /></figure><p>Inception network中的inception block直接整合使用了4種layer，分別為1x1, 3x3, 5x5, max pooling，再將每一個layer的結果合併經過activation計算後再送到後面的inception block。</p><p>參數量最少，速度快是特點。</p><h3>ResNet: 導入殘差網路</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/0*qn3L7_iJdkUKXx1d" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/0*qK9GvEiF9pi-VN9U.png" /></figure><blockquote>擷取自：<a href="https://medium.com/@chenchoulo/convolution-neural-network-cnn-175d924bfcc1">Convolution Neural Network 介紹(CNN 介紹)</a></blockquote><blockquote>ResNet的概念來自於Highway Network。</blockquote><blockquote>Highway Network提出除了非線性轉換外，會保留一定比例的原始輸入直接輸出到下一layer中。而在ResNet中的residual unit則也是透用此概念，每兩層conv會有一個shortcut將輸入直接連結到後面的網路，因為傳統的conv layer在傳遞資料的時候，不可避免地都會有資料損耗的問題，而此residual unit則某種程度上可以保存資料的完整性，整個網路只要學習輸入與輸出差別的部分，可簡化訓練難度。</blockquote><p>更詳細ResNet介紹可參考：<a href="https://medium.com/@hupinwei/%E6%B7%B1%E5%BA%A6%E5%AD%B8%E7%BF%92-resnet%E4%B9%8B%E6%AE%98%E5%B7%AE%E5%AD%B8%E7%BF%92-f3ac36701b2f">(深度學習)ResNet之殘差學習</a></p><h3>CNN綜合比較：</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*F3BSGxsBbCeklqYh.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/0*Xdd5M5Ry-IVmtiXJ" /></figure><p>參考資料：<a href="https://medium.com/@chenchoulo/convolution-neural-network-cnn-175d924bfcc1">Convolution Neural Network 介紹(CNN 介紹)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd6e0939c5db" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/famous-cnn-introduction-cd6e0939c5db">Classic CNN introduction</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Udemy —  Face Detection/Recognition]]></title>
            <link>https://medium.com/chiukevin0321/udemy-face-recognition-4fc83e1c2726?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/4fc83e1c2726</guid>
            <category><![CDATA[course5]]></category>
            <category><![CDATA[facedetection]]></category>
            <category><![CDATA[face-recognition]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Sun, 05 Jul 2020 07:25:27 GMT</pubDate>
            <atom:updated>2020-07-06T08:29:21.859Z</atom:updated>
            <content:encoded><![CDATA[<h3>Udemy — Face Detection/Recognition</h3><p>針對針對臉部偵測/辨識實作以下主題</p><blockquote>Course link: <a href="https://www.udemy.com/course/computer-vision-face-recognition-quick-starter-in-python/">https://www.udemy.com/course/computer-vision-face-recognition-quick-starter-in-python/</a></blockquote><p>均使用python face-recognition library</p><pre><strong>1. Face Detection</strong> from Images, <br>   Face Detection from Real time Videos, <br>   Emotion Detection, <br>   Age-Gender Prediction, <br><strong>2. Face Recognition</strong> from Images, <br>   Face Recognition from Real time Videos, <br>   Face Distance, <br>   Face Landmarks Manipulation, <br>   Face Makeup</pre><h3>Face Detection 臉部偵測</h3><ul><li><strong>Face Detection</strong></li></ul><p>使用HOG及openCV的library來偵測臉部並畫框</p><ul><li><strong>Emotion Detection:</strong></li></ul><p>做完1.找到臉部框，再導入kaggle的臉部表情data weight預測出表情，最後輸出預測結果</p><ul><li><strong>Age-Gender Prediction</strong></li></ul><p>當然也可以用跟2.同樣的方式預測出年紀和性別</p><h3>Face Recognition 臉部辨識</h3><ul><li><strong>Face Recognition</strong></li></ul><ol><li>一樣先找到臉部框</li></ol><p>2. 將已知臉部相片導入face_recognition的 encoding function，得到每張圖的encoding(如下圖)，並集合成一個known_face_encodings和known_face_index</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-2rRC7JBXHlrxoWi.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8XyDv6TTtWLt4d6tbfPf8Q.png" /></figure><p>3. 將欲預測的相片(轉成current_face_encoding之後)導入</p><pre>face_recognition.compare_faces(known_face_encodings, current_face_encoding)</pre><p>4. Get the respective index of the matching face</p><p>5. 畫出相對框和列出預測，完成臉部辨識</p><ul><li><strong>Face Distance：更進階的臉部辨識應用</strong></li></ul><ol><li>使用 <strong>face_recognition.face_distance</strong> function</li></ol><pre>face_recognition.face_distance(known_face_encodings, image_to_recognize_encoding)</pre><p>2. For loop in face_distance可以看出image_to_recognize跟每張已知圖的face distance（distance越小符合機率越高）</p><ul><li><strong>Face Landmarks</strong></li></ul><p>Visualizing Face Landmarks from Pillow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pCFEW-I57xsAQ6SgNivQ-Q.png" /></figure><p>導入Face Landmark之後再將各個特徵點連結起來如下圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O0fWgqYgQ93OprOxGZeupA.png" /></figure><ul><li><strong>Face Makeup Using Face Landmarks</strong></li></ul><p>從上一個主題(<strong>Face Landmarks</strong>)針對已知的各個Face features(眼睛,眉毛...等)做make up，最後輸出入下右圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*gUmgBVOEJ2I7BehQCorKPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*YsEI8Vdn_NcwXI5sS89Qbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*vhevXb4fIDsX71kmD9kzqg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fc83e1c2726" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/udemy-face-recognition-4fc83e1c2726">Udemy —  Face Detection/Recognition</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Udacity 電腦視覺 project 1: Face detection/Face recognition]]></title>
            <link>https://medium.com/chiukevin0321/%E4%BA%BA%E8%87%89%E8%BE%A8%E8%AD%98-face-detection-face-recognition-7ba98aaf1a02?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/7ba98aaf1a02</guid>
            <category><![CDATA[facedetection]]></category>
            <category><![CDATA[course5]]></category>
            <category><![CDATA[face-recognition]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Wed, 01 Jul 2020 09:51:59 GMT</pubDate>
            <atom:updated>2020-07-04T07:33:28.956Z</atom:updated>
            <content:encoded><![CDATA[<p>針對人臉辨識 Face detection/Face recognition做深度的研究和探討</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uRzipvQz2Qejr5u7.png" /><figcaption>General computer vision processing pipeline</figcaption></figure><h4>1. Computer Vision knowledge</h4><p>這邊重新講了一遍computer vision的一些知識和應用</p><p>包含 sobel, canny edge, grayscale, high-pass filter(e.g. canny edge: 用來找邊緣), low pass filter(e.g. Gaussian blur: 用來濾雜訊), Hough Line detection: 透過圖片的近乎同斜率的點可轉成hough space的交點，進而畫出線段。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z49JgGWaHSJUwsQSwQGnbg.png" /></figure><p>2. 介紹臉部辨識會用到的<strong>Haar cascade classifier</strong></p><blockquote><strong>Haar cascade classifier </strong>is a machine learning based approach where a cascade function is trained to solve a binary classification problem: face or not-face; it trains on a lot of positive (face) and negative (not-face) images</blockquote><p><strong>Haar cascade classifier</strong>能夠快速捨棄不相關的資料使這個演算法速度非常快，可直接應用在電腦或是行動裝置上</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DfBuw-49zmHgOeUi1ImJwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ayxjz0HopjT5sDKpbeL4w.png" /><figcaption>所謂的階層式分類器 cascade classifier</figcaption></figure><p>以下內容取自：<a href="https://chtseng.wordpress.com/2018/06/15/opencv-cascade-object-detection/">Opencv Cascade Object Detection</a></p><blockquote>Cascade Classifier翻成中文是階層式分類器（亦有人翻為級聯分類器），它是由好幾個Classifier所組成以進行多層的分類。</blockquote><blockquote>用在人臉偵測上的作法是一開始先將feature分成好幾個classifier，最先進行的classier辨識率最低，但是可以先篩選掉很大一部份不是人臉的圖片，接下來的Classier處理困難度較高的部份因此篩選掉的圖片會逐次減少，直到所有classier處理完為止，最後留下來的就會是我們想要的人臉的照片。</blockquote><p>但是在訓練這種人臉辨識時很大一部分取決於data，例如如果我們用很多白人女性作為訓練集，則系統很大機會對於其他膚色的女性判斷錯誤。</p><p>為了解決bias問題，可以使用<strong>GAN(Generative Adversarial Network)</strong>來解決這個問題：<a href="https://blog.godatadriven.com/fairness-in-pytorch">Implementing a fair classifier in PyTorch.</a></p><h4>2. Image Contouring</h4><p>常見應用：Hand recognition, gesture recognition, body recognition…</p><p>從OpenCV的網站可以看到<a href="https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_contours/py_table_of_contents_contours/py_table_of_contents_contours.html">更多關於image contour的資訊</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrsfzAr_cjgJFs9oMKkiDA.png" /></figure><h4>3. 介紹 ORB -Oriented FAST and Rotated BRIEF (特徵提取演算法)</h4><p>使用FAST演算法做特徵點提取 + BRIEF 演算法做特徵點的比對</p><blockquote><strong>關鍵點</strong> — 圖像中的小區域特別獨特。e.g.：像素值從亮到暗急劇變化的角。</blockquote><blockquote><strong>描述符</strong> — 特徵描述符是一種提取圖像並輸出特徵描述符/特徵向量的算法。特徵描述符將信息編碼成一系列數字，並充當某種數字「指紋」，可用於區分一個特徵與另一個特徵。理想情況下，這些信息在圖像變換下是不變的，所以即使圖像以某種方式變換，我們也可以再次找到特徵。&lt;如下圖&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*urTMxbcXI_62DekWNt1Lfw.jpeg" /></figure><p>詳細關於ORB介紹可參考：<a href="https://kknews.cc/code/x8jpmyo.html">ORB簡介及Python實現</a></p><h4><strong>ORB重要用途：作為real time face detection/recognition 的工具</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*28hOBdLlRGmCsWuXWXa-Gw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ba98aaf1a02" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/%E4%BA%BA%E8%87%89%E8%BE%A8%E8%AD%98-face-detection-face-recognition-7ba98aaf1a02">Udacity 電腦視覺 project 1: Face detection/Face recognition</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Udacity 自駕車 project 5]]></title>
            <link>https://medium.com/chiukevin0321/udacity-%E8%87%AA%E9%A7%95%E8%BB%8A-project-5-d7a1242413de?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/d7a1242413de</guid>
            <category><![CDATA[kalman-filter]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[course-4]]></category>
            <category><![CDATA[udacity]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Wed, 01 Jul 2020 09:10:03 GMT</pubDate>
            <atom:updated>2020-07-01T09:10:03.016Z</atom:updated>
            <content:encoded><![CDATA[<p>Project 5: Extended Kalman Filter</p><blockquote><a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project5_Extended-Kalman-Filter-Project"><strong>Project5_Extended-Kalman-Filter-Project</strong></a></blockquote><p>這次是關於Kalman Filter的應用</p><p>結合Lidar和Radar的資料，</p><p>The Kalman Filter represents our distributions by Gaussians and iterates on two main cycles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7a1242413de" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/udacity-%E8%87%AA%E9%A7%95%E8%BB%8A-project-5-d7a1242413de">Udacity 自駕車 project 5</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Udacity 自駕車 project 4]]></title>
            <link>https://medium.com/chiukevin0321/udacity-%E8%87%AA%E9%A7%95%E8%BB%8A-project-4-9889f52c58c3?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/9889f52c58c3</guid>
            <category><![CDATA[course-4]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[udacity]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Wed, 01 Jul 2020 03:31:23 GMT</pubDate>
            <atom:updated>2020-07-01T08:09:05.433Z</atom:updated>
            <content:encoded><![CDATA[<p>Project 4: Behavior Cloning</p><blockquote><strong>Github: </strong><a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project4_Behavioral-Cloning"><strong>Project 4_Behavioral-Cloning</strong></a></blockquote><p>大致介紹了：</p><h4>1. Keras應用</h4><h4>2. Transfer Learning</h4><h4>3. CNNs History and introduction</h4><h4>4. Behavior Cloning project</h4><p>— — — — — — — — — — — — — — — — — —</p><h4>1. Keras應用</h4><p>在上一個project 3用了tensorflow來刻出CNN，這次介紹了使用keras來更有效率的刻出CNN。</p><p>簡單比較之前用tensorflow 和 這次用keras，可以發現keras方便很多:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*09brNXxjhoMYUmwmCQksuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcB0m92llTKJH_bRqTTihw.png" /></figure><h4>2. Transfer Learning</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u8VkfyNboSxmyl_s.png" /></figure><h3>Case 1: Small Data Set, Similar Data</h3><p>If the new data set is small and similar to the original training data:</p><p>簡單來說，保留前面CNN的weight，修改後面FCN的輸出數量並重新計算weight</p><ul><li>slice off the end of the neural network</li><li>add a new fully connected layer that matches the number of classes in the new data set</li><li>randomize the weights of the new fully connected layer; freeze all the weights from the pre-trained network</li><li>train the network to update the weights of the new fully connected layer</li></ul><h3>Case 2: Small Data Set, Different Data</h3><p>If the new data set is small and different from the original training data:</p><ul><li>slice off most of the pre-trained layers near the beginning of the network</li><li>add to the remaining pre-trained layers a new fully connected layer that matches the number of classes in the new data set</li><li>randomize the weights of the new fully connected layer; freeze all the weights from the pre-trained network</li><li>train the network to update the weights of the new fully connected layer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4g3b5WPJl--MuLQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RNpfu4EyKvhTVhvj.png" /></figure><h3>Case 3: Large Data Set, Similar Data</h3><p>If the new data set is large and similar to the original training data:</p><ul><li>remove the last fully connected layer and replace with a layer matching the number of classes in the new data set</li><li>randomly initialize the weights in the new fully connected layer</li><li>initialize the rest of the weights using the pre-trained weights</li><li>re-train the entire neural network</li></ul><h3>Case 4: Large Data Set, Different Data</h3><p>If the new data set is large and different from the original training data:</p><ul><li>remove the last fully connected layer and replace with a layer matching the number of classes in the new data set</li><li>retrain the network from scratch with randomly initialized weights</li><li>alternatively, you could just use the same strategy as the “large and similar” data case</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2_cLUqtIYzTX8gHc.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TaqiGruJ4IU5jWRF.png" /></figure><h4>3. CNN introduction</h4><p>先介紹了imagenet的功用（一個巨大的dataset）</p><blockquote>甚至可以透過<a href="https://keras.io/applications/">Keras Applications</a>直接導入已經pre-trained的知名object detection models, 例如 ResNet50, VGG16, InceptionV3…</blockquote><h4>AlexNet：類似LeNet的架構</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*etFL4gqOata5dCgr.png" /></figure><h4>VGG16/19 (數字代表層數)：使用多個3*3 convolution &amp; pooling 作為架構</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B9MplGfxZxCuTAoh.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y0XMu8mi8XALAUmF.png" /></figure><p>可以簡單透過keras import VGG16</p><pre><strong>from</strong> keras.applications.vgg16 <strong>import</strong> VGG16<br><br>model = VGG16(weights=&#39;imagenet&#39;, include_top=<strong>False</strong>)</pre><h4>GoogLeNet/Inception：導入inception module的概念</h4><p>GoogLeNet 特點是速度很快，因此可應用在自駕車上</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/0*TjxipBYeCLhAnf4B.PNG" /></figure><pre><strong>from</strong> keras.applications.inception_v3 <strong>import</strong> InceptionV3<br><br>model = InceptionV3(weights=&#39;imagenet&#39;, include_top=<strong>False</strong>)</pre><h4>ResNet: 透過增加層數(152 layers)來達到更好的低錯誤率的表現</h4><p>但一般來說增加層數反而會使網路退化(Degradation problem)，深度增加時，網絡準確度出現飽和，甚至出現下降。</p><p>那ResNet怎麼解決這個問題的呢？ Ans: <strong>殘差學習 Residual learning</strong></p><pre>ResNet網絡是參考了VGG19網絡，在其基礎上進行了修改，並通過短路機制加入了殘差單元</pre><p>詳情請見：<a href="https://zhuanlan.zhihu.com/p/31852747">ResNet intro</a></p><pre><strong>from</strong> keras.applications.resnet50 <strong>import</strong> ResNet50<br><br>model = ResNet50(weights=&#39;imagenet&#39;, include_top=<strong>False</strong>)</pre><h4>4. Behavior Cloning project</h4><p>最後就進入我們的專案了！</p><p>這次目標是要讓車子自己學習在路上跑，不要超過車道邊緣</p><p>這主要就是要累積一堆讓車子盡量維持在中間的影像data，udacity的project引導都有提到，但實作起來還是花了一些時間</p><p>在做這個專案，建構CNN反而不難，麻煩的是需要自己累積data，並不斷在模擬器上測試。在訓練&amp;測試的過程中，車子常常在影片第46秒那個轉彎開出跑道，因此又特別針對那個地方做了許多的圖片和方向盤的資料擷取，最後終於訓練出完整跑完整條道路的模型。</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FP3EdtfgAtAo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DP3EdtfgAtAo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FP3EdtfgAtAo%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/0b75c09a9f7f3eb5d6fe2e8e9f929605/href">https://medium.com/media/0b75c09a9f7f3eb5d6fe2e8e9f929605/href</a></iframe><h4>— — Additional Resources on Deep Learning — —</h4><h3>Behavioral Cloning</h3><p>The below paper shows one of the techniques Waymo has researched using imitation learning (aka behavioral cloning) to drive a car.</p><p><a href="https://arxiv.org/abs/1812.03079">ChauffeurNet: Learning to Drive by Imitating the Best and Synthesizing the Worst</a></p><h3>Object Detection and Tracking</h3><p>The below papers include various deep learning-based approaches to 2D and 3D object detection and tracking.</p><p><a href="https://arxiv.org/abs/1512.02325">SSD: Single Shot MultiBox Detector</a></p><pre>1. SSD結合了YOLO中的回歸思想和Faster-RCNN中的Anchor機制，使用全圖各個位置的多尺度區域特徵進行回歸，既保持了YOLO速度快的特性，也保證了窗口預測的跟Faster-RCNN一樣比較精準。<br><br>2. SSD的核心是在特徵圖上採用卷積核來預測一系列Default Bounding Boxes的類別、坐標偏移。為了提高檢測準確率，SSD在不同尺度的特徵圖上進行預測。</pre><p><a href="https://arxiv.org/abs/1711.06396">VoxelNet: End-to-End Learning for Point Cloud Based 3D Object Detection</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*nAtiAUJu4a4Na7jjS8tvAw.png" /><figcaption>VoxelNet 透過LiDAR 的 point cloud, 能夠畫出立體框 (3D Object Detection)</figcaption></figure><p><a href="http://openaccess.thecvf.com/content_cvpr_2018/papers/Luo_Fast_and_Furious_CVPR_2018_paper.pdf">Fast and Furious: Real Time End-to-End 3D Detection, Tracking and Motion Forecasting with a Single Convolutional Net</a></p><h3>Semantic Segmentation</h3><p>The below paper concerns a technique called semantic segmentation, where each pixel of an image gets classified individually!</p><p><a href="https://arxiv.org/abs/1511.00561">SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9889f52c58c3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/udacity-%E8%87%AA%E9%A7%95%E8%BB%8A-project-4-9889f52c58c3">Udacity 自駕車 project 4</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Udacity 自駕車 project 3]]></title>
            <link>https://medium.com/chiukevin0321/udacity-%E8%87%AA%E9%A7%95%E8%BB%8A-project-3-f48ca31dc578?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/f48ca31dc578</guid>
            <category><![CDATA[course-4]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[traffic-sign-classifier]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Mon, 29 Jun 2020 14:49:38 GMT</pubDate>
            <atom:updated>2020-07-01T03:24:28.736Z</atom:updated>
            <content:encoded><![CDATA[<p>Project 3: Traffic Light Classifier</p><blockquote><strong>Github: </strong><a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project3_Traffic-Sign-Classifier"><strong>Project3_Traffic-Sign-Classifier</strong></a></blockquote><p>首先課程介紹了一些關於tensorflow的一般應用</p><p>再來是講解neural network裡的一些流程，包含activation function(softmax), lost function(cross-entropy)…等等</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*deQjXGZ5teN5XqXSibMoCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*LjdjHMPcQsHyY8nq_Czh3w.png" /></figure><p>整個Classifier的邏輯如下圖:</p><p>先將data圖片normalize, initialize weight with Gaissian(W), 使用softmax as activation function(S), 使用cross-entropy loss(D),最後將整個函數平均得到平均損失。不斷重複整個步驟得到最佳weight。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W4RPDR2s6Q-fklbDLMptPQ.png" /></figure><p>接著是介紹Deep neural network:</p><blockquote>activation functions: 增加非線性 ,</blockquote><blockquote>forward &amp; <a href="https://medium.com/chiukevin0321/backpropogation-%E7%B4%80%E9%8C%84-dd986b60583b">backward propagation</a> : 更新weight</blockquote><blockquote>regularization(L1, L2): 維持現有的features，但是降低部分不重要feature的影響力</blockquote><blockquote>dropout: 和regularization都是為了防止over-fitting</blockquote><pre><strong>避免over-fitting的方法：</strong>early stopping、資料集擴增（Data augmentation）、正規化（Regularization，包括L1、L2），dropout。</pre><p>大致概念如下圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AA9vDCgg0ylVdME0hRHR9Q.png" /></figure><p>再來是介紹CNN (Convolutional Neural Network)</p><p>這邊就不贅述了，用開山CNN的LeNet來解釋:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ui02bnaMHOcip5Pj.png" /></figure><p>包含一些 filter, padding, stride, parameter sharing, convolution, pooling, fully connected, 1*1 convolution, inception, … 等CNN的概念</p><h4>Parameter count:</h4><blockquote>an input of shape 32x32x3 (HxWxD)</blockquote><blockquote>20 filters of shape 8x8x3 (HxWxD)</blockquote><blockquote>Output Layer</blockquote><blockquote>14x14x20 (HxWxD)</blockquote><blockquote>1. Deep neural network: (8*8*3+1)*(14*14*20) = 756560</blockquote><blockquote>2. Convolutional neural network: (8*8*3+1)*(20) = 3860</blockquote><p>— — — — — — — — — — — — — —</p><p>介紹完課程內容，終於進入project了。</p><p>Project 3是做一個路標辨識器，以德國的路標作為dataset</p><p>大概分成幾個步驟：</p><ol><li>data augmented: Resize 50% / 2. Rotate -30~30 degree / 3. Warp</li><li>build CNN, hyperparameter setting:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zwCmhfnq9roxZoiXpNkF5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*7bkUViyt7iQwMfU0f81s7A.png" /></figure><p>3. result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*HsoAXOJPCqiFj8eD7AlIKw.png" /></figure><blockquote><strong>Github: </strong><a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project3_Traffic-Sign-Classifier"><strong>Project3_Traffic-Sign-Classifier</strong></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f48ca31dc578" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/udacity-%E8%87%AA%E9%A7%95%E8%BB%8A-project-3-f48ca31dc578">Udacity 自駕車 project 3</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Udacity 自駕車 project 1, 2]]></title>
            <link>https://medium.com/chiukevin0321/%E8%87%AA%E9%A7%95%E8%BB%8A-project-1-2-e1a8291b72b1?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/e1a8291b72b1</guid>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[course-4]]></category>
            <category><![CDATA[lane-line-detection]]></category>
            <category><![CDATA[udacity]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Fri, 26 Jun 2020 09:47:27 GMT</pubDate>
            <atom:updated>2020-07-11T07:54:13.933Z</atom:updated>
            <content:encoded><![CDATA[<p>Project 1: Lance Lines Detection &amp; Project 2: Advanced Lane Lines Detection</p><p><strong>Project 1: Finding-Lane-Lines</strong></p><blockquote><strong>Github: </strong><a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project1_Finding-Lane-Lines"><strong>Project1_Finding-Lane-Lines</strong></a></blockquote><p>在第一個專案，我們使用了python+OpenCV來做道路線的偵測</p><p>這邊主要會用到OpenCV裡的兩個function: Canny + Hough Transform</p><ol><li>Canny edge detector: Canny的輸入為灰階圖像(grayscale之後)，輸出將是稱為edges圖像。兩個threshold, low_threshold和high_threshold則是邊緣檢測的門檻值。</li></ol><pre>edges = cv2.Canny(gray, low_threshold, high_threshold)</pre><blockquote>As far as a ratio of low_threshold to high_threshold, <a href="http://docs.opencv.org/2.4/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.html#steps">John Canny himself recommended</a> a low to high ratio of 1:2 or 1:3.</blockquote><p>透過Canny edge圖從左圖轉變成右圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*mrnnmJ-E2XmdjK3S.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*h3p7AtuiLFhs6V3N.jpg" /><figcaption>圖一</figcaption></figure><p>2. Hough Transform</p><p>再來是用Hough Transform來畫出圖裡的道路線段</p><p>透過Canny形成許多圖中的點，再以Hough Transform將照片中的各個直線上的pixels轉換成相交於同一個點的許多直線</p><pre><em># Define the Hough transform parameters</em><br><em># Make a blank the same size as our image to draw on</em><br>rho = 1<br>theta = np.pi/180<br>threshold = 1<br>min_line_length = 10<br>max_line_gap = 1<br>line_image = np.copy(image)*0 <em>#creating a blank to draw lines on</em></pre><pre>lines = cv2.HoughLinesP(masked_edges, rho, theta, threshold, <br>                        np.array([]),min_line_length, max_line_gap)</pre><p>左圖經過parameters optimized and region masked形成右圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aeOtYc58GFmK93Pd.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ehugp7fCeRjutjbf.jpg" /></figure><p>Pipeline五步驟程式碼:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HZ0gHgMGWWBrUzyYwos1Qg.png" /></figure><p>最後結果以影片呈現：</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FklNyNWypBY8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DklNyNWypBY8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FklNyNWypBY8%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/faed58f3d495e679d547da9ae0cfc056/href">https://medium.com/media/faed58f3d495e679d547da9ae0cfc056/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FT0VKkD5Ebrw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DT0VKkD5Ebrw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FT0VKkD5Ebrw%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/2165a0dbf075e28ac70e8176c7a7dfcf/href">https://medium.com/media/2165a0dbf075e28ac70e8176c7a7dfcf/href</a></iframe><p><strong>Project 2: Advanced-Lane-Finding</strong></p><blockquote><strong>Github: </strong><a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project2_Advanced-Lane-Finding"><strong>Project2_Advanced-Lane-Finding</strong></a></blockquote><p>第二個專案是更進階的OpenCV的應用：包含</p><ol><li>Camera Calibration, Image Distortion correction</li><li>更進階道路偵測(sobel), Color and Gradient threshold設定</li><li>Perspective Transform(透視變換)</li></ol><p>------------------------------------------------------------------------------</p><ol><li><strong>Camera Calibration, Image Distortion correction: 攝影機校正</strong></li></ol><p>使用攝影機會帶來一些魚眼效果的問題(image distortion)，於是我們就用下列方法來解決這些問題:</p><p>(1) Camera Calibration, Image Distortion correction:</p><p>解決畫面扭曲失真的問題，會造成我們這專案要偵測的道路扭曲，因此透過OpenCV的<strong>calibrateCamera, undistort</strong>來解決。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tNbOVfXJP3zuJx8gt2yUYQ.png" /></figure><pre><strong>#Finding chessboard corners (for an 8x6 board):</strong></pre><pre>ret, corners = cv2.findChessboardCorners(gray, (8,6), <strong>None</strong>)</pre><pre><strong>#Drawing detected corners on an image:</strong></pre><pre>img = cv2.drawChessboardCorners(img, (8,6), corners, ret)</pre><pre><strong>#Camera calibration, given object points, image points, and the shape of the grayscale image:</strong></pre><pre>ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1], <strong>None</strong>, <strong>None</strong>)</pre><pre><strong>#Undistorting a test image:</strong></pre><pre>dst = cv2.undistort(img, mtx, dist, <strong>None</strong>, mtx)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JhYAJ-f6jxzkq9WG3stw1Q.png" /></figure><p>&lt;解決了相機畫面失真扭曲問題&gt;</p><p><strong>2. 更進階道路偵測(sobel), Color and Gradient threshold設定</strong></p><p>上個專案直接使用Canny edge detection來偵測，但會像圖一一樣偵測到很多非道路相關的線，因此我們需要用其他的技巧來找到車道線邊緣。</p><p>(1) 使用Sobel operator得到如下的結果:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*NkOFoPHO2DPJUTsx.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/0*7qN2C0sxS1_BN7tf.png" /></figure><p>針對gradient 的 magnitude &amp; direction 做參數調整，得到更好的道路偵測結果並將兩者合併得到下圖(大):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MGTQKnywNU-dkCpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZW5RlL30Pp_Cce7u.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9kfXPLXrgsWmHMZ-.jpg" /></figure><p>(2) Color (HLS) and Gradient 門檻值設定:</p><blockquote><strong>(1) &amp; (2) 結合: 順利找到明顯的車道線</strong></blockquote><blockquote><strong>Combined color and gradient thresholds for lane detection</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ByQQZAENv_hlvNsb.png" /></figure><p><strong>3. Perspective Transform (透視變換):</strong></p><p>再來是從下左圖來看，道路會有點彎曲甚至交集，但其實兩條路線是平行的，因此我們要用Perspective Transform來解決這個問題。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UbXza_4Gh912cy2M-sOpyA.png" /></figure><p>簡單來說就是將原本有點彎曲的道路轉成bird’s-eye view的形式，得到下兩張圖，可以看出不管是直線還是轉彎線，均能從Perspective Transform之後看出左右的道路線依然是平行的。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FntLVwd8aQdiBTqo.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zx85E4EJ_B7btHiW.jpg" /></figure><p>在操作完前面全部的步驟之後，可濾出清晰的道路線如下圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yH8Z42tWd6so-7UVNuad4w.png" /></figure><p>最後用Sliding window來找出左右兩條線的pixel 再分別去Fit一個二次多項式後(丟進np.polyfit)，我們可以找到一個圓弧，也就偵測出左右兩條曲線了</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q1HAU5KlLZmBc0mCFwRL9w.png" /></figure><p>當我們找到道路線之後，在下一個Frame就不用再使用Sliding window來找左右兩條線了，直接在如下圖的line margin內尋找道路線能使pipeline運作更快</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/0*N4Dg3-w4T97djhb6.png" /></figure><p>最後結果如下:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPf26RycEgqg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPf26RycEgqg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPf26RycEgqg%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/14e588b894b2712610d9e420bd16ac06/href">https://medium.com/media/14e588b894b2712610d9e420bd16ac06/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1a8291b72b1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/%E8%87%AA%E9%A7%95%E8%BB%8A-project-1-2-e1a8291b72b1">Udacity 自駕車 project 1, 2</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Backpropagation 紀錄]]></title>
            <link>https://medium.com/chiukevin0321/backpropogation-%E7%B4%80%E9%8C%84-dd986b60583b?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/dd986b60583b</guid>
            <category><![CDATA[backpropagation]]></category>
            <category><![CDATA[knowledge]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Mon, 22 Jun 2020 09:06:05 GMT</pubDate>
            <atom:updated>2020-06-22T10:03:05.572Z</atom:updated>
            <content:encoded><![CDATA[<p>針對Backpropagation做學習紀錄</p><p>之前在學習machine learning都會經過backpropagation這塊，一直以來大概都知道是經過 chain rule + gradient decent的原理來做實作，但常常要複習時就會忘記，特此紀錄。</p><p>下兩張圖（圖來源：<a href="https://medium.com/ai-academy-taiwan/back-propagation-3946e8ed8c55">Back-propagation</a>）以用w¹₁₁的梯度下降為例，很明白的解釋了chain rule + gradient decent的原理，透過forward propagation有些值可以得出，最末端的1.則是可以根據不同Lost function公式來得到。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XmdU3DMZO0o1iEOJbVERgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a0QvtvKGMan28nt7EvasFQ.png" /><figcaption>圖來源：<a href="https://medium.com/ai-academy-taiwan/back-propagation-3946e8ed8c55">Back-propagation</a></figcaption></figure><p>下圖來源：<a href="https://www.youtube.com/watch?v=ibJpTrp5mcE">李宏毅老師的機器學習影片</a>截圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ku5FMyjCwlh01QcTOATJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0J92rXd8-62kmKS5N6aWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mzii2oVIH_d8Dv-0jED9yQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bsljjFiqOzciBMWTe4FyOw.png" /></figure><blockquote>得到了backpropagation所求出來的各個weight的梯度下降</blockquote><blockquote>再根據Gradient decent的公式做後續的計算更新gradient</blockquote><blockquote>透過重複訓練（forward propagation + backpropagation）來更新weight的值</blockquote><p>主要參考來源：<a href="https://www.youtube.com/watch?v=ibJpTrp5mcE">李宏毅老師的機器學習影片</a> &amp; <a href="https://medium.com/ai-academy-taiwan/back-propagation-3946e8ed8c55">Back-propagation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd986b60583b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/backpropogation-%E7%B4%80%E9%8C%84-dd986b60583b">Backpropagation 紀錄</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Udacity Self-Driving Car Nanodegree]]></title>
            <link>https://medium.com/chiukevin0321/udacity-self-driving-car-nanodegree-427d41b3551?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/427d41b3551</guid>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[udacity-nanodegree]]></category>
            <category><![CDATA[course-4]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Mon, 22 Jun 2020 06:14:27 GMT</pubDate>
            <atom:updated>2020-06-26T09:41:45.737Z</atom:updated>
            <content:encoded><![CDATA[<p>Udacity自駕車微學位課程紀錄. 10/16, 2019 ~ 04/25/2020</p><p>Project 1: Github: <a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project1_Finding-Lane-Lines">Project1_Finding-Lane-Lines</a></p><p>Project 2: Github: <a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project2_Advanced-Lane-Finding">Project2_Advanced-Lane-Finding</a></p><p>Project 3: Github: <a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project3_Traffic-Sign-Classifier">Project3_Traffic-Sign-Classifier</a></p><p>Project 4: Github: <a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project4_Behavioral-Cloning">Project4_Behavioral-Cloning</a></p><p>Project 5: Github: <a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project5_Extended-Kalman-Filter-Project">Project5_Extended-Kalman-Filter-Project</a></p><p>Project 6: Github: <a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project6_Kidnapped-Vehicle-Project">Project6_Kidnapped-Vehicle-Project</a></p><p>Project 7: Github :<a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project7_Path-Planning-Project">Project7_Path-Planning-Project</a><a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/commit/9a6019ff019a07e40863e4f6a26998dcefd820b0">Update</a></p><p>Project 8: Github: <a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/Project8_PID-Control-Project">Project8_PID-Control-Project</a></p><p>Project Final: Github: <a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/ProjectFinal_Capstone-Project">ProjectFinal_Capstone-Project</a></p><p>Project Final: Github: <a href="https://github.com/kevinkkk08/Udacity_self-driving-car-nanodegree/tree/master/ProjectFinal_Traffic-Light-Classification-Project">ProjectFinal_Traffic-Light-Classification-Project</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=427d41b3551" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/udacity-self-driving-car-nanodegree-427d41b3551">Udacity Self-Driving Car Nanodegree</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[YOLO v1, v2, v3]]></title>
            <link>https://medium.com/chiukevin0321/yolo-v1-v2-v3-35af83a8b29b?source=rss----3760e55735e2---4</link>
            <guid isPermaLink="false">https://medium.com/p/35af83a8b29b</guid>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[yolo]]></category>
            <category><![CDATA[knowledge]]></category>
            <dc:creator><![CDATA[Kevin Chiu]]></dc:creator>
            <pubDate>Sun, 21 Jun 2020 08:10:17 GMT</pubDate>
            <atom:updated>2020-11-05T01:03:43.129Z</atom:updated>
            <content:encoded><![CDATA[<p>Object detection algorithm: YOLO introduction</p><p>簡單針對YOLO做介紹並複習</p><blockquote>YOLO v1 paper: <a href="https://arxiv.org/pdf/1506.02640.pdf">https://arxiv.org/pdf/1506.02640.pdf</a></blockquote><blockquote>YOLO v2 paper: <a href="https://arxiv.org/pdf/1612.08242.pdf">https://arxiv.org/pdf/1612.08242.pdf</a></blockquote><blockquote>YOLO v3 paper: <a href="https://pjreddie.com/media/files/papers/YOLOv3.pdf">https://pjreddie.com/media/files/papers/YOLOv3.pdf</a></blockquote><p>下圖為三種YOLO的相關結構</p><p><strong>YOLO v1:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*v6S-PSD3VdYIvau2" /></figure><p>基本想法就是將圖片經過CNN訓練之後，分成7*7的grid cell, 每個grid cell會預測1~2種的object，並生成對該object的信心機率和該object的bounding box 大小。</p><blockquote>結構：把整張圖（448*448*3）餵進CNN模型裡，輸出(7*7*(b*5+c))的預測結果資料和7*7*b個bounding boxes。（b為bounding box數量, c為categories數量）</blockquote><p>假設b=2 &amp; c=20，則會輸出7*7*2個bounding box，之後會再經過threshold 設定和NMS(Non-Maximum Suppression)來減少bounding box達到最後物件偵測。</p><p><em>詳細的Loss function可參考：</em><a href="https://blog.csdn.net/litt1e/article/details/88814417"><em>連結</em></a><em> ; 詳細關於NMS介紹可參考：</em><a href="https://medium.com/@chih.sheng.huang821/%E6%A9%9F%E5%99%A8-%E6%B7%B1%E5%BA%A6%E5%AD%B8%E7%BF%92-%E7%89%A9%E4%BB%B6%E5%81%B5%E6%B8%AC-non-maximum-suppression-nms-aa70c45adffa"><em>連結</em></a></p><p><strong>YOLO v2:</strong></p><blockquote><a href="https://medium.com/%E7%A8%8B%E5%BC%8F%E5%B7%A5%E4%BD%9C%E7%B4%A1/yolo-v2-%E7%89%A9%E4%BB%B6%E5%81%B5%E6%B8%AC-%E8%AB%96%E6%96%87%E6%95%B4%E7%90%86-a8e11d8b4409"><strong>YOLO更詳細介紹: link</strong></a></blockquote><p>基本上相對於YOLO v1針對了幾個地方做了加強和修改：</p><ol><li><strong>Batch normalization:</strong> 捨棄dropout改用batch normalization。提升2% mAP。</li><li><strong>High resolution classifier: </strong>在YOLOv2，作者一開始在協調分類網絡(指DarkNet-19)用的448X448全分辨率在ImageNet上跑了10個epoch。使模型提升了4% mAP。</li><li><strong>使用Anchor box: </strong>捨棄YOLO v1最後用FCN直接預測bounding box的方法而改用faster-RCNN的anchor box概念。這中間也做了一些修正，包含:</li></ol><blockquote>3.1 輸入圖片大小448*448改成416*416：使特徵圖恰好只有一個中心位置</blockquote><blockquote>3.2 針對網路最後輸出13*13的feature map分成13×13個grid cell，每個cell用5個anchor box預測得到5個bounding box，一共有13×13×5=845個box</blockquote><blockquote>詳細請參考：<a href="https://arxiv.org/pdf/1612.08242.pdf">論文</a></blockquote><p>4. <strong>Fine-Grained Features:</strong> 增加26*26*512的特徵圖，使對小圖型的尺度檢視效果更好（原本只有13*13的feature map檢測小圖形不夠精確）</p><pre>26*26*512的特徵圖經passthrough層處理之後就變成了13×13×2048的新特徵圖（特徵圖大小降低4倍，而channles增加4倍），這樣就可以與原本的13×13×1024特徵圖連接在一起形成13×13×3072的特徵圖</pre><p><strong>YOLO v3:</strong></p><p>YOLO v3本相較於v2，著重的部分並非速度，主要是針對bounding box數量及對小尺寸物件的偵測能力做增強。</p><ol><li><strong>關於YOLO v3的anchor box修正可以參考</strong>：<a href="https://zhuanlan.zhihu.com/p/49995236">連結</a></li></ol><pre>v3對b-box進行預測的時候，採用了logistic regression。</pre><pre>有了平移（tx,ty）和尺度縮放（tw,th）才能讓anchor box經過微調與grand truth重合。如圖3，紅色框為anchor box，綠色框為Ground Truth，平移+尺度縮放可實線紅色框先平移到虛線紅色框，然後再縮放到綠色框。邊框回歸最簡單的想法就是通過平移加尺度縮放進行微調。</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/0*REsj0q81dNdQ229N.jpg" /></figure><p>2. <strong>Predictions Across Scales：</strong></p><p>YOLO v3使用了三種尺度的網路，13*13, 26*26, 52*52，每個grid搭配3個bounding box來做預測，使整個神經網路可以針對圖片中小尺寸的物件有更好的偵測成果。</p><p>結構圖：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bMbRCYQZLdiWcwoq" /><figcaption>圖來源：<a href="https://blog.csdn.net/leviopku/article/details/82660381">https://blog.csdn.net/leviopku/article/details/82660381</a></figcaption></figure><p>三代YOLO的結構圖：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iDA2-68E0tgixLPK.png" /><figcaption>圖片來源：<a href="https://medium.com/@chih.sheng.huang821/%E6%B7%B1%E5%BA%A6%E5%AD%B8%E7%BF%92-%E7%89%A9%E4%BB%B6%E5%81%B5%E6%B8%ACyolov1-yolov2%E5%92%8Cyolov3-cfg-%E6%AA%94%E8%A7%A3%E8%AE%80-75793cd61a01">https://medium.com/@chih.sheng.huang821/%E6%B7%B1%E5%BA%A6%E5%AD%B8%E7%BF%92-%E7%89%A9%E4%BB%B6%E5%81%B5%E6%B8%ACyolov1-yolov2%E5%92%8Cyolov3-cfg-%E6%AA%94%E8%A7%A3%E8%AE%80-75793cd61a01</a></figcaption></figure><p>YOLO各版本比較：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*MARv_jnoxk_GE7UKQ1gacg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*kRdr9w-yUTNebJTLQ_GQbg.png" /><figcaption>圖來源：<a href="https://chtseng.wordpress.com/2018/09/01/%E5%BB%BA%E7%AB%8B%E8%87%AA%E5%B7%B1%E7%9A%84yolo%E8%BE%A8%E8%AD%98%E6%A8%A1%E5%9E%8B-%E4%BB%A5%E6%9F%91%E6%A9%98%E8%BE%A8%E8%AD%98%E7%82%BA%E4%BE%8B/">https://chtseng.wordpress.com/2018/09/01/%E5%BB%BA%E7%AB%8B%E8%87%AA%E5%B7%B1%E7%9A%84yolo%E8%BE%A8%E8%AD%98%E6%A8%A1%E5%9E%8B-%E4%BB%A5%E6%9F%91%E6%A9%98%E8%BE%A8%E8%AD%98%E7%82%BA%E4%BE%8B/</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35af83a8b29b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chiukevin0321/yolo-v1-v2-v3-35af83a8b29b">YOLO v1, v2, v3</a> was originally published in <a href="https://medium.com/chiukevin0321">CodingJourney</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>