๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ปStandford CS231N Deep Learning -2

4704 ๋‹จ์–ด cs231n๋”ฅ๋Ÿฌ๋‹cs231n

2020/09/05 ๊นƒํ—™ ๋ธ”๋กœ๊ทธ ๊ธฐ๋ก

2. Image Classification

Image Classification์˜ ์–ด๋ ค์šด ์ 

  • semantic gap : ์‚ฌ์ง„์„ ์ด๋ฏธ์ง€๋กœ ๋ณด๋Š”๊ฒŒ ์•„๋‹ˆ๋ผ ํ”ฝ์…€์˜ ์ˆซ์ž๋กœ ๋ด„
  • viewpoint variation
  • background clutter
  • Illumination : ๋ฐ๊ธฐ๋‚˜ ์Œ์˜
  • occlusion : ๋‹ค๋ฅธ ์‚ฌ๋ฌผ์— ๊ฐ€๋ ค์ ธ ๊ตฌ๋ถ„์ด ํž˜๋“  ๊ฒฝ์šฐ
  • deformation
  • intracalss variation : ๊ฐ™์€ ์ข…๋ฅ˜์ง€๋งŒ ๋‹ค ๋‹ค๋ฅธ ์ƒ๊น€์ƒˆ

image ์—์„œ edge๋ฅผ ์ถ”์ถœํ•˜๋Š” ๋ฐฉํ–ฅ์„ ์ƒ๊ฐํ–ˆ์ง€๋งŒ, ๋„ˆ๋ฌด ๋ถˆ์•ˆ์ •ํ•˜๊ณ  ์ผ€์ด์Šค๊ฐ€ ๋‹ค์–‘ํ•ด ๋น„ํšจ์œจ์ด์˜€๋‹ค.
๊ทธ๋ž˜์„œ data-driven approach๋กœ ์ด๋ฏธ์ง€์…‹์„ ๋ผ๋ฒจ๋งํ•˜๊ณ  ๋จธ์‹ ๋Ÿฌ๋‹ ๋ชจ๋ธ์„ ํ›ˆ๋ จ์‹œ์ผœ ์ƒˆ ์ด๋ฏธ์ง€๋ฅผ ๊ตฌ๋ถ„ํ•ด๋‚ด๊ฒŒ ํ–ˆ๋‹ค.

  • CIFAR10 data set
    - 10 classes
    - 50,000 trn-img
    - 10,000 tst-img
    - 32*32 piexel

Nearest Neighbor

  • L1 distance (Manhattan)

    	- Train O(1) , Predict O(N)
    	-> **ํ›ˆ๋ จ์„ ๋Š๋ฆฌ๊ฒŒํ•˜๊ณ , ์˜ˆ์ธก์„ ๋น ๋ฅด๊ฒŒ ํ•  ์ˆœ ์—†์„๊นŒ?**
  • KNN
    - majority vote

  • L2 distance (Euclidean)

  • Hyper-parameter
    - ์šฐ๋ฆฌ๊ฐ€ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์œ„ํ•ด ์„ ํƒํ•œ ๊ฒƒ
    - problem dependent -> try and pick!
    - k, distance matrix...
    - data set -> train, validation, test ๋กœ ๋‚˜๋ˆ ์„œ ์‚ฌ์šฉ
    1. train์œผ๋กœ ์—ฌ๋Ÿฌ ๋ชจ๋ธ๋“ค์„ ํ•™์Šตํ•œ๋‹ค(ํ•˜์ดํผ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ๋‹ค๋ฅด๊ฒŒ ํ•ด์„œ)
    2. vaildaion์œผ๋กœ ๊ฐ€์žฅ ๋‚˜์€ ๋ชจ๋ธ์„ ๊ณ ๋ฅธ๋‹ค
    3. test๋กœ ๊ทธ ๋ชจ๋ธ์„ ํ‰๊ฐ€ํ•œ๋‹ค.
    - cross-validation
    ์ด ์˜ˆ์‹œ๋Š” five fold
    - fold๋ฅผ ๋Œ์•„๊ฐ€๋ฉฐ ํ•˜๋‚˜์”ฉ validation์— ์‚ฌ์šฉํ•ด์„œ ํšจ์œจ์„ฑ ๋†’์ด๊ธฐ
    - ๋”ฅ๋Ÿฌ๋‹์—์„œ๋Š” ๋ฐ์ดํ„ฐ๊ฐ€ ํฌ๊ธฐ ๋•Œ๋ฌธ์— ์ž˜ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค
    - ์—ฅ validation ์—ฌ๋Ÿฌ๋ฒˆ ํ•˜๋Š”๊ฒŒ ์žฅ์ ์ธ๊ฑด๊ฐ€?

Linear Classification

  • parametric model
    - W, weight
    - f(x,W)f(x, W)
    - f(x,W)=Wx+bf(x,W) = Wx + b

๊ผผ์ง€๋ฝ

knn ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ๋จธ์‹ ๋Ÿฌ๋‹์œผ๋กœ ํ•™๊ต์—์„œ ์ด๋ฏธ ๋ฐฐ์šด๊ฑฐ๋ผ ๋ณต์žกํ•˜์ง€ ์•Š๊ฒŒ ๋“ค์—ˆ๋Š”๋ฐ, cross validation์ด ์กฐ๊ธˆ ํ—ท๊ฐˆ๋ ค์„œ ๋” ์ฐพ์•„๋ด์•ผ๊ฒ ๋‹ค.
L2๋ฅผ ์ด๋ฏธ์ง€ ๋น„๊ต์— ์‚ฌ์šฉํ•œ๋‹ค๋Š”๊ฒŒ ์ดํ•ด๊ฐ€ ๊ณ„์† ์•ˆ๋๋Š”๋ฐ, ๋งˆ์ง€๋ง‰์— ๊ต์ˆ˜๋‹˜์ด KNN์€ ์ด๋ฏธ์ง€์— ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด๋ผ๊ณ  ํ•ด์„œ ๊ทธ๋ƒฅ ๊ทธ๋งŒ ์ƒ๊ฐํ•ด๋ณด๊ธฐ๋กœ ํ–ˆ๋‹ค. ํ”ฝ์…€์˜ ๋น„์Šทํ•จ์„ L2๋กœ....
๋‹ค ๋“ฃ๊ณ ๋‚˜์„œ ๋ณด๋‹ˆ๊นŒ notes๊ฐ€ ์ž์„ธํžˆ ์ž˜ ๋‚˜์™€์žˆ์–ด์„œ ๋‹ค์Œ๋ถ€ํ„ฐ๋Š” ๊ฐ•์˜๋Š” ๊ทธ๋ƒฅ ์ง‘์ค‘ํ•ด์„œ ๋“ฃ๊ณ , ๋…ธํŠธ๋ฅผ ์ฝ์–ด์•ผ๊ฒ ๋‹ค! ๊ณผ์ œํ•˜๊ณ , ์ž์•ผ์ง€!

์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ