On Tutorial with Caffe--a Hands DIY DL for Vision

原文链接:http://blog.sciencenet.cn/blog-1583812-844177.html

       Caffe作为DL的一个学习框架,Caffe is a deep learning framework made with expression, speed, and modularity in mind.It is developed by the Berkeley Vision and Learning Center (BVLC) and by community contributors.Yangqing Jia created the project during his PhD at UC Berkeley.Caffe is released under theBSD 2-Clause license.

       为什么是深度学习?............

On Tutorial with Caffe--a Hands DIY DL for Vision_第1张图片

现有的DL框架:

On Tutorial with Caffe--a Hands DIY DL for Vision_第2张图片



Caffe的不同之处:使用纯C++作为底层库,开放Python、Matlab接口,基于CUDA

On Tutorial with Caffe--a Hands DIY DL for Vision_第3张图片


Caffe的网络结构:一个块作为数据结构

On Tutorial with Caffe--a Hands DIY DL for Vision_第4张图片


Caffe单层网络定义(数据结构):

On Tutorial with Caffe--a Hands DIY DL for Vision_第5张图片


Caffe的基本Blob结构

On Tutorial with Caffe--a Hands DIY DL for Vision_第6张图片


如何训练Caffe网络:参数配置在solver.prototxt中

On Tutorial with Caffe--a Hands DIY DL for Vision_第7张图片


生成Caffe的数据结构




Examples:

Logistic Regression (in Python):
http://nbviewer.ipython.org/github/BVLC/caffe/blob/dev/examples/hdf5_classification.ipynb
Learn LeNet on MNIST:
http://caffe.berkeleyvision.org/gathered/examples/mnist.html


参数调整 : --将一个训练好的模型 参数调整 到一个新任务中......

On Tutorial with Caffe--a Hands DIY DL for Vision_第8张图片


方法:使用ImageNet训练的模型到任务,只需在定义里有一小点改变......

On Tutorial with Caffe--a Hands DIY DL for Vision_第9张图片

  #设定好模型路径和想要分类的图片


方法一:直接初始化....

Model_File = caffe_root + "examples/baby/deploy.prototxt"
PreTrained = caffe_root + "examples/baby/caffenet_train_iter_6001.caffemodel"
net = caffe.Classifier(Model_File,PreTrained);

方法二:New一下就可以了....

Net = new Caffe::Net(
      "style_solver.prototxt"
                        )
Net.CopyTrainedNetFrom(
     pretrained_model
     );
solver.Solve(net);

On Tutorial with Caffe--a Hands DIY DL for Vision_第10张图片


调整参数 使 CaffeNet
Fine-tuning CaffeNet for Style Recognition on “Flickr Style” Data
http://tutorial.caffe.berkeleyvision.org/gathered/examples/finetune_flickr_style.html


SoftMax 函数损失层:

On Tutorial with Caffe--a Hands DIY DL for Vision_第11张图片


SigMoid 交叉熵 损失函数:

欧式损失:

On Tutorial with Caffe--a Hands DIY DL for Vision_第12张图片


多重 损失:




On Tutorial with Caffe--a Hands DIY DL for Vision_第13张图片




On Tutorial with Caffe--a Hands DIY DL for Vision_第14张图片


On Tutorial with Caffe--a Hands DIY DL for Vision_第15张图片




Caffe Demo : http://demo.caffe.berkeleyvision.org/
Feature Visualization : http://nbviewer.ipython.org/github/BVLC/caffe/blob/dev/examples/filter_visualization.ipynb


On Tutorial with Caffe--a Hands DIY DL for Vision_第16张图片


How to transform models in Caffe:
http://nbviewer.ipython.org/github/BVLC/caffe/blob/dev/examples/net_surgery.ipynb

Related projects:
R-CNN: Regions with CNN
Ross Girshick et al.Rich feature hierarchies for accurate object detection and semanticsegmentation. CVPR14.
http://nbviewer.ipython.org/github/BVLC/caffe/blob/dev/examples/detection.ipynb

Full scripts:
https://github.com/rbgirshick/rcnn

Visual Style Recognition:
Karayev et al.Recognizing Image Style. BMVC14. Caffe fine-tuning example
Demo: http://demo.vislab.berkeleyvision.org/

Latest Roast:
Model Zoo: https://github.com/BVLC/caffe/wiki/Model-Zoo
- BVLC reference models
- VGG Devil + ILSVRC14 models in the zoo
- Network-in-Network / CCCP model in the zoo

Caffe + cuDNN

Parallel / distributed training across CPUs, GPUs, and cluster nodes
https://github.com/BVLC/caffe/pull/1148


参考:DIY Deep Learning for Vision with Caffe slides

https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/preview?sle=true#slide=id.p

你可能感兴趣的:(On Tutorial with Caffe--a Hands DIY DL for Vision)