DeepDetect : Open Source Deep Learning Server & API
DeepDetect (http://www.deepdetect.com/) is a machine learning API and server written in C++11. It makes state of the art machine learning easy to work with and integrate into existing applications.
DeepDetect relies on external machine learning libraries through a very generic and flexible API. At the moment it has support for:
- the deep learning library Caffe
- distributed gradient boosting library XGBoost
- the deep learning and other usages library Tensorflow
Machine Learning functionalities per library (current):
Input data support per library (current):
|CSV||SVM||Text words||Text characters||Images|
DeepDetect implements support for supervised and unsupervised deep learning of images, text and other data, with focus on simplicity and ease of use, test and connection into existing applications. It supports classification, object detection, regression, autoencoders, ...
Please join either the community on Gitter or on IRC Freenode #deepdetect, where we help users get through with installation, API, neural nets and connection to external applications.
The reference platforms with support are Ubuntu 14.04 LTS and Ubuntu 16.04 LTS.
Supported images that come with pre-trained image classification deep (residual) neural nets:
docker images for CPU and GPU machines are available at https://hub.docker.com/r/beniz/deepdetect_cpu/ and https://hub.docker.com/r/beniz/deepdetect_gpu/ respectively. See https://github.com/beniz/deepdetect/tree/master/docker/README.md for details on how to use them.
Setup an image classifier API service in a few minutes: http://www.deepdetect.com/tutorials/imagenet-classifier/
List of tutorials, training from text, data and images, setup of prediction services, and export to external software (e.g. ElasticSearch): http://www.deepdetect.com/tutorials/tutorials/
Features and Documentation
Current features include:
- high-level API for machine learning and deep learning
- Support for Caffe, Tensorflow and XGBoost
- classification, regression, autoencoders, object detection
- JSON communication format
- remote Python client library
- dedicated server with support for asynchronous training calls
- high performances, benefit from multicore CPU and GPU
- connector to handle large collections of images with on-the-fly data augmentation (e.g. rotations, mirroring)
- connector to handle CSV files with preprocessing capabilities
- connector to handle text files, sentences, and character-based models
- connector to handle SVM file format for sparse data
- range of built-in model assessment measures (e.g. F1, multiclass log loss, ...)
- no database dependency and sync, all information and model parameters organized and available from the filesystem
- flexible template output format to simplify connection to external applications
- templates for the most useful neural architectures (e.g. Googlenet, Alexnet, ResNet, convnet, character-based convnet, mlp, logistic regression)
- support for sparse features and computations on both GPU and CPU
- Full documentation is available from http://www.deepdetect.com/overview/introduction/
- API documentation is available from http://www.deepdetect.com/api/
- FAQ is available from http://www.deepdetect.com/overview/faq/
- Python client:
- REST client: https://github.com/beniz/deepdetect/tree/master/clients/python
- 'a la scikit' bindings: https://github.com/ArdalanM/pyDD
- Java client: https://github.com/kfadhel/deepdetect-api-java
- Early C# client: https://github.com/beniz/deepdetect/pull/98
- C++, gcc >= 4.8 or clang with support for C++11 (there are issues with Clang + Boost)
- eigen for all matrix operations;
- glog for logging events and debug;
- gflags for command line parsing;
- OpenCV >= 2.4
- gtest for unit testing (optional);
- CUDA 7 or 6.5 is required for GPU mode.
- BLAS via ATLAS, MKL, or OpenBLAS.
- IO libraries hdf5, leveldb, snappy, lmdb
None outside of C++ compiler and make
- Cmake > 3
By default DeepDetect automatically relies on a modified version of Caffe, https://github.com/beniz/caffe/tree/master This version includes many improvements over the original Caffe, such as sparse input data support, exception handling, class weights, object detection, and various additional losses and layers.
The code makes use of C++ policy design for modularity, performance and putting the maximum burden on the checks at compile time. The implementation uses many features from C++11.
Image similarity search: Python script for indexing and searching images is in demo/imgsearch
Image object detection: Python script for object detection within images is in demo/objdetect
- List of examples, from MLP for data, text, multi-target regression to CNN and GoogleNet, finetuning, etc...: http://www.deepdetect.com/overview/examples/
|Caffe||Tensorflow||Source||Top-1 Accuracy (ImageNet)|
|Inception v1 / GoogleNet||Y||Y||BVLC / Google||67.9%|
|VOC0712 (object detection)||Y||N||https://github.com/weiliu89/caffe/tree/ssd||71.2 mAP|
- List of free, even for commercial use, deep neural nets for image classification, and character-based convolutional nets for text classification: http://www.deepdetect.com/applications/list_models/
DeepDetect is designed and implemented by Emmanuel Benazera firstname.lastname@example.org.
Below are instructions for Ubuntu 14.04 LTS. For other Linux and Unix systems, steps may differ, CUDA, Caffe and other libraries may prove difficult to setup. If you are building on 16.04 LTS, look at https://github.com/beniz/deepdetect/issues/126 that tells you how to proceed.
Beware of dependencies, typically on Debian/Ubuntu Linux, do:
sudo apt-get install build-essential libgoogle-glog-dev libgflags-dev libeigen3-dev libopencv-dev libcppnetlib-dev libboost-dev libboost-iostreams-dev libcurlpp-dev libcurl4-openssl-dev protobuf-compiler libopenblas-dev libhdf5-dev libprotobuf-dev libleveldb-dev libsnappy-dev liblmdb-dev libutfcpp-dev cmake libgoogle-perftools-dev
Default build with Caffe
For compiling along with Caffe:
mkdir build cd build cmake .. make
If you are building for one or more GPUs, you may need to add CUDA to your ld path:
If you would like to build with cuDNN, your
cmake line should be:
cmake .. -DUSE_CUDNN=ON
If you would like a CPU only build, use:
cmake .. -DUSE_CPU_ONLY=ON
Build with XGBoost support
If you would like to build with XGBoost, include the
-DUSE_XGBOOST=ON parameter to
cmake .. -DUSE_XGBOOST=ON
Build with Tensorflow support
First you must install Bazel and Cmake with version > 3.
And other dependencies:
sudo apt-get install python-numpy swig python-dev python-wheel unzip
If you would like to build with Tensorflow, include the
-DUSE_TF=ON paramter to
cmake .. -DUSE_TF=ON
You can combine with XGBoost support with:
cmake .. -DUSE_TF=on -DUSE_XGBOOST=ON
Note: running tests requires the automated download of ~75Mb of datasets, and computations may take around thirty minutes on a CPU-only machines.
To prepare for tests, compile with:
cmake -DBUILD_TESTS=ON .. make
Run tests with:
Start the server
cd build/main ./dede DeepDetect [ commit 73d4e638498d51254862572fe577a21ab8de2ef1 ] Running DeepDetect HTTP server on localhost:8080
Main options are:
-hostto select which host to run on, default is
0.0.0.0to listen on all interfaces
-portto select which port to listen to, default is
-nthreadsto select the number of HTTP threads, default is
To see all options, do:
See tutorials from http://www.deepdetect.com/tutorials/tutorials/