Skip to content

liangt/caffe

 
 

Repository files navigation

Multilabel Caffe

License

This is a modified Caffe which is convenient for me to do multilabel classification. Although, there are many ways to do multilabel classification in Caffe, such as using two Data layer, one for image and the other for label, I'd like to have a more intuitive way to do it.

Here are changes I make:

  • MultilabelData layer: similar to Data layer expect that MultilabelData use multilabel_data_param instead of data_param.

  • MultilabelDataParameter: similar to DataParameter expect that MultilabelDataParameter has an extra attribute label_size which is the total number of labels.

  • MultilabelDatum: similar to Datum expect that the label in MultilabelDatum is repeated.

  • tools/convert_multilabel_imageset: convert a set of images to a lmdb/leveldb by storing them as MultilabelDatum proto buffers.

    convert_multilabel_imageset [FLAGS] filelist db_name
    

    The filelist is a list of files as well as their labels, in the format as:

    img_path label_1,label_2,label_3,...
    

    label_i is an integer in [0, label_size).

  • add a function to output the label probability for each test sample.

An example of MultilabelData layer:

layer {
  name: "data"
  type: "MultilabelData"
  include {
    phase: TRAIN
  }
  top: "data"
  top: "label"
  transform_param {
    crop_size: 224
    mean_value: 104
    mean_value: 117
    mean_value: 123
    mirror: true
  }
  multilabel_data_param {
    source: "image_db"
    batch_size: 8
    label_size: 66
    backend: LMDB
  }
}

Caffe

Build Status License

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 community contributors.

Check out the project site for all the details like

and step-by-step examples.

Join the chat at https://gitter.im/BVLC/caffe

Please join the caffe-users group or gitter chat to ask questions and talk about methods and models. Framework development discussions and thorough bug reports are collected on Issues.

Happy brewing!

License and Citation

Caffe is released under the BSD 2-Clause license. The BVLC reference models are released for unrestricted use.

Please cite Caffe in your publications if it helps your research:

@article{jia2014caffe,
  Author = {Jia, Yangqing and Shelhamer, Evan and Donahue, Jeff and Karayev, Sergey and Long, Jonathan and Girshick, Ross and Guadarrama, Sergio and Darrell, Trevor},
  Journal = {arXiv preprint arXiv:1408.5093},
  Title = {Caffe: Convolutional Architecture for Fast Feature Embedding},
  Year = {2014}
}

About

Caffe: a fast open framework for deep learning.

Resources

License

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 80.2%
  • Python 9.1%
  • Cuda 5.7%
  • CMake 2.8%
  • MATLAB 0.9%
  • Makefile 0.7%
  • Other 0.6%