02/17/2020 Stanford- CS231-note image classification

本文介绍了图像分类问题的挑战,如视角变化、光照、形变等,并探讨了数据驱动的方法,特别是K-最近邻(K-NN)算法。K-NN存在训练快速但预测慢的问题,以及选择合适的距离度量和K值的挑战。接着,提出了使用验证集和交叉验证选择超参数的重要性。最后,文章指出K-NN在图像上的应用受限,引出了线性分类作为更高效的选择。
摘要由CSDN通过智能技术生成
  • pre : read python and numpy tutorial
  • the problem: semantic gap (difference between computer and human)
  • challenges: viewpoint variation (camera moves)/ illumination/ deformation(poses and positions)/ occulsion/ background clutter( look similar with background)/ intraclass variation
  • an image classifier
def classify_image(image)
#some magic here?
return  class_label
  • data-driven approach
    -collect a dataset of images and labels
    -use of machine learning to train a classifer
    -evaluate the classifier on new images
def train(images,labels):
#machine learning!
return model
def predict(model, test_images):
#use model to predict labels
return(test_labels)
  • first classifer: nearest neighbors
    drawback: qucik training time, long predict time

  • distance metric to compare images
    -L1 distance (Manhattan distance) reply on coordiante system you choose/ if the individual entries have important mearnings for your task
    -L2 distance (Euclidean distance) don’t reply on coordiante you choose - it’s circle/ if only generic vector and don’t know which of the different elements
    -good to try first

  • K-Nearest Neighbors
    instead of copying label from nearest neighbor, take majority vote from K cosest points
    expect use k>1, smooth out decision boundaries

  • hyperparameters- choices about the algorithm that we set rather than learn
    -what is the best value of k to use?
    -what is the best distance to use?
    -idea1: work best on data ❌(bad: k=1 always works perfectly on training data)
    -idea2: split your data into train and test/ work best on test data ❌(bad: no idea how algorithm will perform on new data- may just pick the right set of hyperparameters that cause our algorithm to work well on this training data)
    -idea3: split data into train, valuation and test/ choose hyperparameters on val and evaluate on test
    -idea3: cross-validation, used for small datasets not deep learning(computation expensive)/ try each fold as validation and average the result

  • what is the difference between validation set and test set?
    our algorithm memorizes all the training set, now we will take each of elment of the validation set compared with training data and then use this to determine what is the accuracy of classifer

  • representative: partition should be random for train data and test data

  • K-nearest neighbor on images never used
    -very slow at test time
    -distance metrics on pixels are not informative
    -curse of dimensionability/ you never get enough images to cover each pixels in high dimensional space
    (ex. dimensions=1, points=4; dimensions=2, points=16)

  • Linear Classification

  • parametric approach: we only need parameters at test time, allow our models to be more efficient and can actually run on small devices
    -problem: only learn one template for each class

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值