- CS144 Fall 2013 Video 1-0 - The Internet and IP Introduction
- CS144 Fall 2013 Video 1-1 - A day in the life of an application
- CS144 Fall 2013 Video 1-2 - The four layer Internet model
- CS144 Fall 2013 Video 1-3 - The IP service model
- CS 144 Video 1-4 - A Day in the Life of a Packet
- CS144 Fall 2013 Video 1-5 - Packet switching principle
- CS144 Fall 2013 Video 1-6 - Layering principle
- CS144 Fall 2013 Video 1-7 - Encapslation principle
- CS144 Fall 2013 Video 1-8a - byte order
- CS144 Fall 2013 Video 1-8b - byte order
- 011-CS144 Fall 2013 Video 1-8c - byte order
- 012-CS144 Fall 2013 Video 1-8d - byte order
- 013-CS144 Fall 2013 Video 1-9a - IPv4 addresses
- 014-CS144 Fall 2013 Video 1-9b - IPv4 addresses
- 015-CS144 1-9c - IPv4 addresses
- 016-CS144 Fall 2013 Video 1-9d - IPv4 addresses
- 017-CS144 Fall 2013 Video 1-10a - Longest prefix match (LPM)
- 018-CS144 Fall 2013 Video 1-10b - Longest prefix match (LPM)
- 019-CS144 Fall 2013 Video 1-10c - Longest prefix match (LPM)
- 020-CS144 Fall 2013 Video 1-11 - Address Resolution Protocol (ARP)
- 021-CS144 Fall 2013 Video 1-12 - The Internet and IP Recap
- 022-CS144 Fall 2013 Video 9-1 - Jon Peterson Interview -- SIP and Security
- 023-CS144 Fall 2013 Video 2-0 - Transport (intro)
- 024-CS144 Fall 2013 Video 2-1 - TCP service model
- 025-CS144 Fall 2013 Video 2-2 - UDP service model
- 026-CS144 Fall 2013 Video 2-3 - ICMP service model
- 027-CS144 Fall 2013 Video 2-4 - End to End Principle
- 028-CS144 Fall 2013 Video 2-5 - Error detection
- 029-CS144 Fall 2013 Video 2-6a - Finite state machines 1
- 030-CS144 Fall 2013 Video 2-6b - Finite state machines 2
- 031-CS144 Fall 2013 Video 2-6c - Finite state machines 3
- 032-CS144 Fall 2013 Video 2-6d - Finite state machines 4
- 033-Stop and wait
- 034-Sliding window
- 035-Reliable comm. --- Retransmission strategies
- 036-Reliable comm --- TCP header
- 037-Reliable comm --- Connection setup and teardown
- 038-CS144 Fall 2013 Video 2-12 - Transport (recap)
- 039-CS144 Fall 2013 Video 9-2 - Kevin Fall
- 040-CS144 Fall 2013 Video 3-0 - Packet Switching
- 041-CS144 Fall 2013 Video - 3-1 The History of Networks; The History of the Inte
- 042-Packet Switching - Principles - What is packet switching
- 043-Packet Switching - Principles - Terminology End to End Delay and Queueing d
- 044-Packet Switching - Principles - Playback buffers
- 045-Packet Switching - Principles - Simple Deterministic Queue Model (revised)
- 046-CS144 Fall 2013 Video 3-5a - Simple Queueing Model Example
- 047-Packet Switching - Principles - Queueing Model Properties
- 048-Packet Switching - Practice - Switching and Forwarding (1)
- 049-Packet Switching - Practice - Switching and Forwarding (2)
- 050-Packet Switching - Principles - Rate guarantees
- 051-Packet Switching - Principles - Delay Guarantees (revised)
- 052-CS144 Fall 2013 Video 3-10a - Delay Guarantees Example
- 053-CS144 Fall 2013 Video 3-11 - Packet Switching (recap)
- 054-CS144 Fall 2013 Video 9-3 - Tom Edsall Interview -- DC Switches
- 055-CS144 Fall 2013 Video 4-0 - Congestion Control
- 056-Congestion Control - Basics
- 057-Congestion Control - Basics 2
- 058-Congestion Control - Dynamics of a single AIMD flow
- 059-CS144 Fall 2013 Video 4-3a - Single AIMD flow worked example
- 060-4-4 AIMD Multiple Flows
- 061-TCP Tahoe
- 062-TCP RTT Estimation
- 063-TCP Reno
- 064-Congestion Control - AIMD
- 065-Skills --- Reading and RFC
- 066-CS144 Fall 2013 Video 4-11 - Congestion Control
- 067-4 Nandita Interview
- 068-CS144 Fall 2013 Video 5-0 - Applications and NATs
- 069-NATs - Introduction
- 070-NATs - Types
- 071-NATs - Implications
- 072-Nats - Operation
- 073-CS144 Fall 2013 Video 5-5a - HTTP
- 074-CS144 Fall 2013 Video 5-5b - HTTP Quiz 1 Intro
- 075-CS144 Fall 2013 Video 5-5c - HTTP Quiz 1 Explanation
- 076-CS144 Fall 2013 Video 5-5d - HTTP Quiz 2 Intro
- 077-CS144 Fall 2013 Video 5-5e - HTTP Quiz 2 Explanation
- 078-CS144 Fall 2013 Video 5-6 - HTTP_1.1 Keep-alive
- 079-CS144 Fall 2013 Video 5-7 - BitTorrent
- 080-DNS 1
- 081-DNS 2
- 082-DNS 3
- 083-DHCP
- 084-CS144 Fall 2013 Video 5-12 - Applications and NATs (recap)
- 085-CS144 Fall 2013 Video 6-0 - Routing
- 086-Routing - Flooding source routing and spanning trees
- 087-Routing - Bellman Ford
- 088-Routing - Dijkstra
- 089-Routing - Internet (RIP OSPF) ASs
- 090-Routing - BGP
- 091-Routing - Multicast
- 092-Routing - Spanning Tree
- 093-IPv6
- 094-CS144 Fall 2013 Video 6-9 - Routing
- 095-CS144 Fall 2013 Video 9-5 - David Ward
- 096-BGP - Putting the Inter in Internet. Professor Jennifer Rexford Princeton
- 097-CS144 Fall 2013 Video 7 0 - Lower Layers
- 098-Physical and Link Principles - Shannon Capacity and Modulation
- 099-Physical and Link Principles - Bit Errors
- 100-Physical and Link - Principles - clocks
本章主要介紹信息技術(shù)的發(fā)展背景,以及信息技術(shù)在社會(huì)發(fā)展中的重要地位,并介紹信息技術(shù)具體的典型應(yīng)用和信息技術(shù)發(fā)展的新方向。
圖像分類
驅(qū)動(dòng):本節(jié)介紹在將輸入圖像劃分至預(yù)設(shè)的分類集合中某項(xiàng)類別中,所遇到的一些問(wèn)題。盡管它在計(jì)算機(jī)視覺(jué)中很簡(jiǎn)單,但仍然是其中的核心問(wèn)題之一,具有各式各樣的應(yīng)用。此外,在往后的課程中,很多看似不同的計(jì)算機(jī)視覺(jué)任務(wù)(如物體識(shí)別,分割)都可以被列為圖像分類。
案例:假如,將下圖通過(guò)圖像分類模型,匹配將其劃分至四類標(biāo)簽{cat,dog,hat,mug},并計(jì)算出各類的相似概率。計(jì)算機(jī)認(rèn)為下圖是一個(gè)大型的三維數(shù)據(jù)。例如,圖片大小為248 x400,包含RGB三個(gè)波段,那其相當(dāng)于包含248 x 400 x 3 個(gè)像素點(diǎn),共計(jì)297,600個(gè)。每個(gè)像素點(diǎn)值域?yàn)?~255,0代表黑色,255代表白色。我們的任務(wù)是將這個(gè)百萬(wàn)個(gè)像素點(diǎn)劃分為統(tǒng)一的一個(gè)標(biāo)簽,例如“cat”。
這里寫(xiě)圖片描述
The task in Image Classification is to predict a single label (or a distribution over labels as shown here to indicate our confidence) for a given image. Images are 3-dimensional arrays of integers from 0 to 255, of size Width x Height x 3. The 3 represents the three color channels Red, Green, Blue.
挑戰(zhàn):由于圖片識(shí)別是與人相關(guān)的行為操作,但他需要從計(jì)算機(jī)視覺(jué)算法的角度思考問(wèn)題。大體羅列下遇到的問(wèn)題:
視角變量。同個(gè)物體可在不同的角度下拍攝,圖片結(jié)果截然不同。
尺度變量。物體具有大小的物理含義。
變形。物體拍攝的變形因素。
吸收變量。物體的興趣區(qū)域可能被隱藏。一些時(shí)候只有少量的興趣區(qū)域被展示出來(lái)(少至幾個(gè)像素)
照明變量。拍攝的光照條件影像像素結(jié)果的亮度值。
背景干擾。物體被相似的背景信息干擾,影響判別。
內(nèi)部差異。物體內(nèi)部可包含更細(xì)的子物體,各子物體不盡相同。
一個(gè)好的圖像分類模型必須對(duì)上述的變量具有不變性,同時(shí)能靈敏區(qū)分物體內(nèi)部的差異因素。
這里寫(xiě)圖片描述
數(shù)據(jù)驅(qū)動(dòng)方法:編寫(xiě)一個(gè)怎樣的算才能將圖像分類至特定的類別呢?顯然,諸如對(duì)像素?cái)?shù)據(jù)的排序這些方式,并不能做到。因此,在嘗試通過(guò)編碼的方式對(duì)每種特定類型進(jìn)行特殊定義之外,本文采用的方法是與一個(gè)你會(huì)帶一個(gè)孩子:我們將向計(jì)算機(jī)輸入樣例類別的圖片數(shù)據(jù),開(kāi)發(fā)出一種計(jì)算機(jī)學(xué)習(xí)的算法使計(jì)算機(jī)學(xué)習(xí)各類類別的數(shù)據(jù)特征。這種方法即稱為數(shù)據(jù)驅(qū)動(dòng)的方式,因?yàn)樗蕾囉趯?duì)分類圖像數(shù)據(jù)的學(xué)習(xí)。如下是一個(gè)分類集合的例子:
這里寫(xiě)圖片描述
An example training set for four visual categories. In practice we may have thousands of categories and hundreds of thousands of images for each category.
圖像分類管線:我們了解到圖像分類在將一堆代表圖像信息的像素值數(shù)組識(shí)別一個(gè)特定的類別。其整個(gè)任務(wù)的流程如下所示:
- 輸入。數(shù)據(jù)輸入包括N幅已經(jīng)分類好的影像,分類類別達(dá)K種。我們稱之為訓(xùn)練樣本。
- 學(xué)習(xí)。我們的任務(wù)是通過(guò)訓(xùn)練樣本學(xué)習(xí)各類圖像的特征信息。這部我們稱之為樣本訓(xùn)練,或者模型學(xué)習(xí)。
- 預(yù)測(cè)。最后,我們通過(guò)對(duì)新數(shù)據(jù)的分類識(shí)別來(lái)評(píng)估分類模型的質(zhì)量。比較圖像真實(shí)的分類信息和預(yù)測(cè)的分類信息。當(dāng)然,我們希望預(yù)測(cè)結(jié)果與真實(shí)情況(我們稱之為the ground truth)相符。
最鄰近分類器
我們第一個(gè)方法,采用最鄰近分類器。這個(gè)分類器與卷積神經(jīng)網(wǎng)絡(luò)無(wú)關(guān)且不常用,但它能給我們一個(gè)對(duì)圖像分類問(wèn)題基本方法的一些靈感。
樣例的分類數(shù)據(jù)集:CIFAR-10。一個(gè)著名的圖像分類數(shù)據(jù)集便是CIFAR-10。它有 60,000個(gè)32x32的小圖像組成,每個(gè)圖像被標(biāo)記為10個(gè)固定類別(如”airplane, automobile, bird,等”)中的一個(gè)。這60,000個(gè)圖像其中50,000 被劃分為訓(xùn)練集,另外10,000 被劃分為測(cè)試集。下圖隨機(jī)從10類中挑選樣本圖片。
這里寫(xiě)圖片描述
Left: Example images from the CIFAR-10 dataset. Right: first column shows a few test images and next to each we show the top 10 nearest neighbors in the training set according to pixel-wise difference.
假設(shè)當(dāng)前我們有50,000 個(gè)已經(jīng)分類的CIFAR-10訓(xùn)練集數(shù)據(jù),需要利用他們對(duì)剩余的10,000個(gè)數(shù)據(jù)進(jìn)行分類。最鄰近分類器針對(duì)每一幅測(cè)試圖片,會(huì)去訓(xùn)練集數(shù)據(jù)中一一比對(duì),從而預(yù)報(bào)處最接近的一張訓(xùn)練圖片。在上圖右側(cè)中,我們可以看到10張測(cè)試圖分別找到幾張最鄰近圖片。結(jié)果發(fā)現(xiàn),10個(gè)測(cè)試圖片中僅3幅比對(duì)到了正確的類別。例如,第八行中最鄰近的訓(xùn)練圖片是一幅紅色的轎車,與真實(shí)的馬類別不符,這種情況可能是強(qiáng)背景導(dǎo)致的結(jié)果。因此,馬的圖像在本例中被錯(cuò)認(rèn)為一輛轎車。
大家可能思考我們?nèi)绾伪葘?duì)兩張圖的方式,實(shí)際上它們只是 32 x 32 x 3的矩陣而已。其中一種最簡(jiǎn)單的方式,就是一一對(duì)比每個(gè)像素值的差異,最后將其結(jié)果相加得到。換而言之,給予兩幅圖像,其矢量表示為 I1,I2,一個(gè)可行的比較方法可以是L1 distance:
d1(I1,I2)=∑p|Ip1−Ip2|
其中數(shù)據(jù)集合就是如此,以下是該公式的圖形化表示:
這里寫(xiě)圖片描述
An example of using pixel-wise differences to compare two images with L1 distance (for one color channel in this example). Two images are subtracted elementwise and then all differences are added up to a single number. If two images are identical the result will be zero. But if the images are very different the result will be large.
后面引申出了最鄰近的K個(gè)值的算法,從最鄰近的一個(gè)分類擴(kuò)展為K個(gè)分類。
與此同時(shí),對(duì)K這個(gè)參數(shù)的選擇成為一個(gè)問(wèn)題(K值為多少時(shí),分類效果最好),于是就是超參數(shù)調(diào)參方法,即Hyperparameter tuning。
tuning的過(guò)程有很多問(wèn)題會(huì)出現(xiàn),需要考慮:過(guò)擬合、欠擬合等。
同時(shí),有幾個(gè)關(guān)鍵的要點(diǎn)需要牢記:
Evaluate on the test set only a single time, at the very end.(測(cè)試集數(shù)據(jù)只能在最后的最后使用,最后測(cè)試識(shí)別效果的,調(diào)參的時(shí)候不能介入)
Split your training set into training set and a validation set. Use validation set to tune all hyperparameters. At the end run a single time on the test set and report performance.(把訓(xùn)練集數(shù)據(jù)劃分為訓(xùn)練集和驗(yàn)證集數(shù)據(jù)。使用驗(yàn)證集數(shù)據(jù)進(jìn)行調(diào)參。最后,采用測(cè)試集數(shù)據(jù)進(jìn)行測(cè)試,導(dǎo)出性能報(bào)告)
提供了兩種方法:最簡(jiǎn)單的一種,及將原先的訓(xùn)練樣本集再分割為兩部分,一部分為訓(xùn)練集,一部分為驗(yàn)證集,先訓(xùn)練后驗(yàn)證,調(diào)參。另一種(Cross-validation),將訓(xùn)練樣本均分為若干部分,其中一部分為驗(yàn)證集,其余的都為訓(xùn)練集,然后訓(xùn)練驗(yàn)證,之后再選取另一部分為驗(yàn)證集,其余為訓(xùn)練集,進(jìn)行訓(xùn)練驗(yàn)證。如此循環(huán),最后平均化所有的驗(yàn)證精度,從而再確定調(diào)參。
這里寫(xiě)圖片描述
Example of a 5-fold cross-validation run for the parameter k. For each value of k we train on 4 folds and evaluate on the 5th. Hence, for each k we receive 5 accuracies on the validation fold (accuracy is the y-axis, each result is a point). The trend line is drawn through the average of the results for each k and the error bars indicate the standard deviation. Note that in this particular case, the cross-validation suggests that a value of about k = 7 works best on this particular dataset (corresponding to the peak in the plot). If we used more than 5 folds, we might expect to see a smoother (i.e. less noisy) curve.
實(shí)際操作中,如果樣本數(shù)據(jù)多的話,可以直接使用第一種方法,如果樣本少的話,需要使用第二種方法,可將樣本集合均分為3、5、10類等等。
這里寫(xiě)圖片描述
Common data splits. A training and test set is given. The training set is split into folds (for example 5 folds here). The folds 1-4 become the training set. One fold (e.g. fold 5 here in yellow) is denoted as the Validation fold and is used to tune the hyperparameters. Cross-validation goes a step further iterates over the choice of which fold is the validation fold, separately from 1-5. This would be referred to as 5-fold cross-validation. In the very end once the model is trained and all the best hyperparameters were determined, the model is evaluated a single time on the test data (red).
最鄰近分類器的優(yōu)缺點(diǎn)
優(yōu)點(diǎn):
- 算法簡(jiǎn)單可實(shí)現(xiàn)
- 不用訓(xùn)練(只要圖片數(shù)據(jù)有就行,不需要生成訓(xùn)練的一些結(jié)果)
缺點(diǎn):
- 測(cè)試時(shí)花費(fèi)計(jì)算時(shí)間(需要對(duì)每個(gè)圖片進(jìn)行一一比對(duì),很耗時(shí)。這個(gè)問(wèn)題很重要,大家對(duì)訓(xùn)練時(shí)間的長(zhǎng)短并不介意,但對(duì)測(cè)試的時(shí)間很在意)
事實(shí)上,深度神經(jīng)網(wǎng)絡(luò)后面發(fā)展了,將這個(gè)測(cè)試的代價(jià)轉(zhuǎn)移到另外的極端方向:訓(xùn)練代價(jià)極其昂貴,而一旦訓(xùn)練完畢,測(cè)試非常快速簡(jiǎn)單。這種方式更適應(yīng)于實(shí)際應(yīng)用。
另外,最鄰近分類法的計(jì)算復(fù)雜度也是一個(gè)常見(jiàn)的研究方向,并已經(jīng)開(kāi)發(fā)出了一些近似最鄰近(ANN)算法和庫(kù),來(lái)加速最鄰近查找方法 (e.g. FLANN)。這些算法權(quán)衡了最近李。。。。
最鄰近分類法子在某些情況下是個(gè)不錯(cuò)的分類選擇(尤其是數(shù)據(jù)為低緯度的),但是它一般較少應(yīng)用于實(shí)際的圖像分類應(yīng)用中。一個(gè)問(wèn)題是圖像是高緯度物體,包含很多像素值,且高緯度空間的距離很特殊。下圖就表示雖然圖片僅是鏤空部分或者變暗了一些,它與原圖的匹配相似度很低(pixel-wise距離),說(shuō)明上述方法并不能用于知覺(jué)或語(yǔ)義相似度。
