Caffe: Convolutional Architecture for Fast Feature Embedding∗

Caffe: Convolutional Architecture for Fast Feature Embedding∗

Caffe: Convolutional Architecture for Fast Feature Embedding∗ Yangqing Jia∗, Evan Shelhamer∗, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, Trevor Darrell SUBMITTED to ACM MULTIMEDIA 2014 OPEN SOURCE SOFTWARE COMPETITION UC Berkeley EECS, Berkeley, CA 94702 {jiayq,shelhamer,jdonahue,sergeyk,jonlong,rbg,sguada,trevor}@eecs.berkeley.edu ABSTRACT 1. INTRODUCTION Caffe provides multimedia scientists and practitioners with A key problem in multimedia data analysis is discovery of a clean and modifiable framework for state-of-the-art deep effective representations for sensory inputs|images, sound- learning algorithms and a collection of reference models. waves, haptics, etc. While performance of conventional, The framework is a BSD-licensed C++ library with Python handcrafted features has plateaued in recent years, new de- and MATLAB bindings for training and deploying general- velopments in deep compositional architectures have kept purpose convolutional neural networks and other deep mod- performance levels rising [8]. Deep models have outper- els efficiently on commodity architectures. Caffe fits indus- formed hand-engineered feature representations in many do- try and internet-scale media needs by CUDA GPU computa- mains, and made learning possible in domains where engi- tion, processing over 40 million images a day on a single K40 neered features were lacking entirely. or Titan GPU (≈ 2.5 ms per image). By separating model We are particularly motivated by large-scale visual recog- representation from actual implementation, Caffe allows ex- nition, where a specific type of deep architecture has achieved perimentation and seamless switching among platforms for a commanding lead on the state-of-the-art. These Con- ease of development and deployment from prototyping ma- volutional Neural Networks, or CNNs, are discriminatively chines to cloud environments. trained via back-propagation through layers of convolutional Caffe is maintained and developed by the Berkeley Vi- filters and other operations such as rectification and pooling. sion and Learning Center (BVLC) with the help of an ac- Following the early success of digit classification in the 90's, tive community of contributors on GitHub. It powers on- these models have recently surpassed all known methods for going research projects, large-scale industrial applications, large-scale visual recognition, and have been adopted by in- and startup prototypes in vision, speech, and multimedia. dustry heavyweights such as Google, Facebook, and Baidu for image understanding and search. Categories and Subject Descriptors While deep neural networks have attracted enthusiastic interest within computer vision and beyond, replication of I.5.1 [Pattern Recognition]: [Applications{Computer vi- published results can involve months of work by a researcher sion]; D.2.2 [Software Engineering]: [Design Tools and or engineer. Sometimes researchers deem it worthwhile to Techniques{Software libraries]; I.5.1 [Pattern Recognition]: release trained models along with the paper advertising their [Models{Neural Nets] performance. But trained models alone are not sufficient for rapid research progress and emerging commercial applica- General Terms tions, and few toolboxes offer truly off-the-shelf deployment Algorithms, Design, Experimentation of state-of-the-art models|and those that do are often not computationally efficient and thus unsuitable for commercial Keywords deployment. To address such problems, we present Caffe, a fully open- Open Source, Computer Vision, Neural Networks, Parallel source framework that affords clear access to deep architec- Computation, Machine Learning tures. The code is written in clean, efficient C++, with ∗Corresponding Authors. The work was done while CUDA used for GPU computation, and nearly complete, Yangqing Jia was a graduate student at Berkeley. He is well-supported bindings to Python/Numpy and MATLAB. currently a research scientist at Google, 1600 Amphitheater Caffe adheres to software engineering best practices, pro- Pkwy, Mountain View, CA 94043. viding unit tests for correctness and experimental rigor and speed for deployment. It is also well-suited for research use, due to the careful modularity of the code, and the clean sep- aration of network definition (usually the novel part of deep learning research) from actual implementation. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are In Caffe, multimedia scientists and practitioners have an not made or distributed for profit or commercial advantage and that copies orderly and extensible toolkit for state-of-the-art deep learn- bear this notice and the full citation on the first page. To copy otherwise, to ing algorithms, with reference models provided out of the republish, to post on servers or to redistribute to lists, requires prior specific box. Fast CUDA code and GPU computation fit industry permission and/or a fee. needs by achieving processing speeds of more than 40 mil- Copyright 2014 ACM X-XXXXX-XX-X/XX/XX ...$15.00. Core Open Pretrained Framework License language Binding(s) CPU GPU source Training models Development Python, Caffe BSD C++ distributed MATLAB cuda-convnet [7] unspecified C++ Python discontinued Decaf [2] BSD Python discontinued OverFeat [9] unspecified Lua C++,Python centralized Theano/Pylearn2 [4] BSD Python distributed Torch7 [1] BSD Lua distributed Table 1: Comparison of popular deep learning frameworks. Core language is the main library language, while bindings have an officially supported library interface for feature extraction, training, etc. CPU indicates availability of host-only computation, no GPU usage (e.g., for cluster deployment); GPU indicates the GPU computation capability essential for training modern CNNs. lion images per day on a single K40 or Titan GPU. The may be used to construct networks and classify inputs. The same models can be run in CPU or GPU mode on a vari- Python bindings also expose the solver module for easy pro- ety of hardware: Caffe separates the representation from the totyping of new training procedures. actual implementation, and seamless switching between het- Pre-trained reference models. Caffe provides (for aca- erogeneous platforms furthers development and deployment| demic and non-commercial use|not BSD license) reference Caffe can even be run in the cloud. models for visual tasks, including the landmark \AlexNet" While Caffe was first designed for vision, it has been adopted ImageNet model [8] with variations and the R-CNN detec- and improved by users in speech recognition, robotics, neu- tion model [3]. More are scheduled for release. We are roscience, and astronomy. We hope to see this trend con- strong proponents of reproducible research: we hope that tinue so that further sciences and industries can take advan- a common software substrate will foster quick progress in tage of deep learning. the search over network architectures and applications. Caffe is maintained and developed by the BVLC with the active efforts of several graduate students, and welcomes 2.1 Comparison to related software open-source contributions at http://github.com/BVLC/caffe. We summarize the landscape of convolutional neural net- We thank all of our contributors for their work! work software used in recent publications in Table 1. While our list is incomplete, we have included the toolkits that are 2. HIGHLIGHTS OF CAFFE most notable to the best of our knowledge. Caffe differs from Caffe provides a complete toolkit for training, testing, other contemporary CNN frameworks in two major ways: finetuning, and deploying models, with well-documented ex- (1) The implementation is completely C++ based, which amples for all of these tasks. As such, it's an ideal starting eases integration into existing C++ systems and interfaces point for researchers and other developers looking to jump common in industry. The CPU mode removes the barrier of into state-of-the-art machine learning. At the same time, specialized hardware for deployment and experiments once it's likely the fastest available implementation of these algo- a model is trained. rithms, making it immediately useful for industrial deploy- (2) Reference models are provided off-the-shelf for quick ment. experimentation with state-of-the-art results, without the Modularity. The software is designed from the begin- need for costly re-learning. By finetuning for related tasks, ning to be as modular as possible, allowing easy extension to such as those explored by [2], these models provide a warm- new data formats, network layers, and loss functions. Lots start to new research and applications. Crucially, we publish of layers and loss functions are already implemented, and not only the trained models but also the recipes and code plentiful examples show how these are composed into train- to reproduce them. able recognition systems for various tasks. Separation of representation and implementation. Caffe model definitions are written as config files using the 3. ARCHITECTURE Protocol Buffer language. Caffe supports network archi- tectures in the form of arbitrary directed acyclic graphs. 3.1 Data Storage Upon instantiation, Caffe reserves exactly as much memory Caffe stores and communicates data in 4-dimensional ar- as needed for the network, and abstracts from its underly- rays called blobs. ing location in host or GPU. Switching between a CPU and Blobs provide a unified memory interface, holding batches GPU implementation is exactly one function

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    4 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us