# Deep Learning Framework **Source:** [Caffe](https://caffe.berkeleyvision.org) --- # Caffe Caffe is a deep learning framework made with expression, speed, and modularity in mind. It is developed by Berkeley AI Research ([BAIR](http://bair.berkeley.edu)) and by community contributors. [Yangqing Jia](http://daggerfs.com) created the project during his PhD at UC Berkeley. Caffe is released under the [BSD 2-Clause license](https://github.com/BVLC/caffe/blob/master/LICENSE). Check out our web image classification [demo](http://demo.caffe.berkeleyvision.org)! ## Why Caffe? **Expressive architecture** encourages application and innovation. Models and optimization are defined by configuration without hard-coding. Switch between CPU and GPU by setting a single flag to train on a GPU machine then deploy to commodity clusters or mobile devices. **Extensible code** fosters active development. In Caffe’s first year, it has been forked by over 1,000 developers and had many significant changes contributed back. Thanks to these contributors the framework tracks the state-of-the-art in both code and models. **Speed** makes Caffe perfect for research experiments and industry deployment. Caffe can process **over 60M images per day** with a single NVIDIA K40 GPU\*. That’s 1 ms/image for inference and 4 ms/image for learning and more recent library versions and hardware are faster still. We believe that Caffe is among the fastest convnet implementations available. **Community**: Caffe already powers academic research projects, startup prototypes, and even large-scale industrial applications in vision, speech, and multimedia. Join our community of brewers on the [caffe-users group](https://groups.google.com/forum/#!forum/caffe-users) and [Github](https://github.com/BVLC/caffe/). \* With the ILSVRC2012-winning [SuperVision](http://www.image-net.org/challenges/LSVRC/2012/supervision.pdf) model and prefetching IO. ## Documentation - [DIY Deep Learning for Vision with Caffe](https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/edit#slide=id.p) and [Caffe in a Day](https://docs.google.com/presentation/d/1HxGdeq8MPktHaPb-rlmYYQ723iWzq9ur6Gjo71YiG0Y/edit#slide=id.gc2fcdcce7_216_0) Tutorial presentation of the framework and a full-day crash course. - [Tutorial Documentation](https://caffe.berkeleyvision.org/tutorial) Practical guide and framework reference. - [arXiv / ACM MM ‘14 paper](http://arxiv.org/abs/1408.5093) A 4-page report for the ACM Multimedia Open Source competition (arXiv:1408.5093v1). - [Installation instructions](https://caffe.berkeleyvision.org/installation.html) Tested on Ubuntu, Red Hat, OS X. - [Model Zoo](https://caffe.berkeleyvision.org/model_zoo.html) BAIR suggests a standard distribution format for Caffe models, and provides trained models. - [Developing & Contributing](https://caffe.berkeleyvision.org/development.html) Guidelines for development and contributing to Caffe. - [API Documentation](https://caffe.berkeleyvision.org/doxygen/annotated.html) Developer documentation automagically generated from code comments. - [Benchmarking](https://docs.google.com/spreadsheets/d/1Yp4rqHpT7mKxOPbpzYeUfEFLnELDAgxSSBQKp5uKDGQ/edit#gid=0) Comparison of inference and learning for different networks and GPUs. ### Notebook Examples - [Image Classification and Filter Visualization](http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/00-classification.ipynb) Instant recognition with a pre-trained model and a tour of the net interface for visualizing features and parameters layer-by-layer. - [Learning LeNet](http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/01-learning-lenet.ipynb) Define, train, and test the classic LeNet with the Python interface. - [Fine-tuning for Style Recognition](http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/02-fine-tuning.ipynb) Fine-tune the ImageNet-trained CaffeNet on new data. - [Off-the-shelf SGD for classification](http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/brewing-logreg.ipynb) Use Caffe as a generic SGD optimizer to train logistic regression on non-image HDF5 data. - [Multilabel Classification with Python Data Layer](http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/pascal-multilabel-with-datalayer.ipynb) Multilabel classification on PASCAL VOC using a Python data layer. - [Editing model parameters](http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/net_surgery.ipynb) How to do net surgery and manually change model parameters for custom use. - [R-CNN detection](http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/detection.ipynb) Run a pretrained model as a detector in Python. - [Siamese network embedding](http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/siamese/mnist_siamese.ipynb) Extracting features and plotting the Siamese network embedding. ### Command Line Examples - [ImageNet tutorial](https://caffe.berkeleyvision.org/gathered/examples/imagenet.html) Train and test "CaffeNet" on ImageNet data. - [LeNet MNIST Tutorial](https://caffe.berkeleyvision.org/gathered/examples/mnist.html) Train and test "LeNet" on the MNIST handwritten digit data. - [CIFAR-10 tutorial](https://caffe.berkeleyvision.org/gathered/examples/cifar10.html) Train and test Caffe on CIFAR-10 data. - [Fine-tuning for style recognition](https://caffe.berkeleyvision.org/gathered/examples/finetune_flickr_style.html) Fine-tune the ImageNet-trained CaffeNet on the "Flickr Style" dataset. - [Feature extraction with Caffe C++ code.](https://caffe.berkeleyvision.org/gathered/examples/feature_extraction.html) Extract CaffeNet / AlexNet features using the Caffe utility. - [CaffeNet C++ Classification example](https://caffe.berkeleyvision.org/gathered/examples/cpp_classification.html) A simple example performing image classification using the low-level C++ API. - [Web demo](https://caffe.berkeleyvision.org/gathered/examples/web_demo.html) Image classification demo running as a Flask web server. - [Siamese Network Tutorial](https://caffe.berkeleyvision.org/gathered/examples/siamese.html) Train and test a siamese network on MNIST data. ## Citing Caffe 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} } ``` If you do publish a paper where Caffe helped your research, we encourage you to cite the framework for tracking by [Google Scholar](https://scholar.google.com/citations?view_op=view_citation&hl=en&citation_for_view=-ltRSM0AAAAJ:u5HHmVD_uO8C). ## Contacting Us Join the [caffe-users group](https://groups.google.com/forum/#!forum/caffe-users) to ask questions and discuss methods and models. This is where we talk about usage, installation, and applications. Framework development discussions and thorough bug reports are collected on [Issues](https://github.com/BVLC/caffe/issues). ## Acknowledgements The BAIR Caffe developers would like to thank NVIDIA for GPU donation, A9 and Amazon Web Services for a research grant in support of Caffe development and reproducible research in deep learning, and BAIR PI [Trevor Darrell](http://www.eecs.berkeley.edu/~trevor/) for guidance. The BAIR members who have contributed to Caffe are (alphabetical by first name): [Carl Doersch](http://www.carldoersch.com/), [Eric Tzeng](https://github.com/erictzeng), [Evan Shelhamer](http://imaginarynumber.net/), [Jeff Donahue](http://jeffdonahue.com/), [Jon Long](https://github.com/longjon), [Philipp Krähenbühl](http://www.philkr.net/), [Ronghang Hu](http://ronghanghu.com/), [Ross Girshick](http://www.cs.berkeley.edu/~rbg/), [Sergey Karayev](http://sergeykarayev.com/), [Sergio Guadarrama](http://www.eecs.berkeley.edu/~sguada/), [Takuya Narihira](https://github.com/tnarihi), and [Yangqing Jia](http://daggerfs.com/). The open-source community plays an important and growing role in Caffe’s development. Check out the Github [project pulse](https://github.com/BVLC/caffe/pulse) for recent activity and the [contributors](https://github.com/BVLC/caffe/graphs/contributors) for the full list. We sincerely appreciate your interest and contributions! If you’d like to contribute, please read the [developing & contributing](https://caffe.berkeleyvision.org/development.html) guide.