cs231n-notes-Lecture-2/3

CS231n主要是关于image classification的一些算法以及迁移到其他问题的几个应用。这几节的内容比较基础,正好有时间就过一遍。

Lecture 2 image classification pipeline

compare two images

  • L1 (Mahanttan)Distance: L = ∑ ∣ X i j − Y i j ∣ L = \sum{|X_{ij} - Y_{ij}|} L=XijYij
    • depends on the coordinate
    • application: the different features have different meaning, here maybe L1 is better.
  • L2 (Euclidean) distance d ( I 1 , I 2 ) = ∑ ( I 1 p − I 2 p ) 2 d(I_1, I_2) = \sqrt{\sum{(I_1^p-I_2^p)^2}} d(I1,I2)=(I1pI2p)2

K-Nearest Neighbors

  • training is unnecessary
  • distance metrics is essential
  • it’s better that the samples in the training data can densely cover the space. It’s obviously hard in high-dimension spaces.

cross validation

  • split all the training data and validation data into several folds.
  • use every fold as the validation data, the results are average in some ways.
  • high cost of computation.

linear classifier

Lecture 3 Loss function and optimization

Hinge Loss

  • consider the difference between the probability of true label and that of the false ones.
    在这里插入图片描述
    在这里插入图片描述

Occam’s Razor

Among the competing hypotheses, the simplest is the best. – William of Ockham

Regularization

  • L1 : prefer more zeroes in the parameters in order to decrease the complexity. W1 = [1,0,0,0,0]
  • L2 : prefer to spread the influence over all the parameters.(more pixels and parameters are working) W2 = [0.2,0.2,0.2,0.2,0.2]

Histogram of oriented gradient

方向梯度直方图(HOG),通过计算和统计图像局部区域的梯度方向直方图来构成特征,主要应用于图像识别、行人检测。2015年CVPR首次提出了HOG+SVM进行行人检测。

  • 主要思想:局部图像的表象和形状呢能够通过梯度的方向密度分布很好的表现出来。
  • 主要流程
    1. 利用gamma校正法标准化输入图像,目的是调整图像的对比度降低阴影和光照变化的影响,抑制噪声干扰。
    2. 计算每个像素的梯度的大小和方向
    3. 将图像划分成小cell(比如6*6像素)
    4. 统计每个cell的梯度直方图:将梯度方向划分为几个bin,然后权重梯度的大小
      在这里插入图片描述
    5. 将多个cell组合成block,所有cell的特征拼接起来作为block的特征
    6. 将图片设置一个步长扫描确定block的个数,拼接所有block的特征作为image的特征
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值