Git Product home page Git Product logo

caffe-sl's Introduction

caffe-sl

caffe-based implementation of the Deep Similarity Learning algorithm used in the MM 2014 paper. Other similarity learning algorithms are still under development.

Example

caffe-sl is fully compatible with caffe, please follow the instructions from the project site of caffe to build caffe-sl before you start.

# get the MNIST dataset
./data/mnist/get_mnist.sh
# extract images and generate triplets
./examples/mnist_sl/create_mnist.sh
# training
./examples/mnist_sl/train_lenet_naive.sh 

Notes

1. Input data

caffe-sl loads data with TripletImageDataLayer, which works with a triplet list file contains image paths:

caffe-sl $ head examples/mnist_sl/data/train.tri 
040846.png      051449.png      041185.png
024899.png      033969.png      039096.png
000520.png      022406.png      006979.png
025207.png      020904.png      020818.png
054660.png      040836.png      023925.png
009412.png      035528.png      003730.png
033029.png      011219.png      017586.png
053240.png      033959.png      007701.png
021132.png      042217.png      015489.png
021732.png      028399.png      031010.png
...

The first column consists of query images, the second column consists of positive images, and the third column consists of negative images.

2. Loss layer

The example use cosine similarity. The output of the last feature layer is normalized and then feed to the NaiveTripletLossLayer. The NaiveTripletLossLayer splits the features into three parts: query, positive, and negative features and compute hinge loss on triplet:

l(qry, pos, neg) = max{0, margin - S(qry, pos) + S(qry, neg)}

New Layers

finished

  • TripletImageDataLayer load image data in triplet manner

  • TripletBinaryDataLayer load binary data in triplet manner

  • BinaryDataLayer similar to ImageDataLayer

  • L2NormLayer l2-normalization

  • DotProductSimilarityLayer element-wise dot-product similarity

  • EuclideanSimilarityLayer element-wise euclidean similarity

  • BatchTripletLossLayer triplet based similarity learning in batch mode

  • NaiveTripletLossLayer triplet based similarity learning in list mode

  • PairwiseRankingLossLayer pair wise learning to rank

  • RankAccuracyLayer ranking accuracy

unfinished

  • HDMLLossUpperBoundLayer Hamming distance metric learning

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}
}

caffe-sl's People

Contributors

shelhamer avatar jeffdonahue avatar yangqing avatar longjon avatar sguada avatar kloudkl avatar sergeyk avatar ronghanghu avatar wanji avatar qipeng avatar lukeyeager avatar flx42 avatar rbgirshick avatar philkr avatar dgolden1 avatar eelstork avatar mavenlin avatar jamt9000 avatar tnarihi avatar yosinski avatar erictzeng avatar cypof avatar mohomran avatar jyegerlehner avatar mtamburrano avatar netheril96 avatar ducha-aiki avatar kkhoot avatar timmeinhardt avatar ste-m5s avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.