Total num | TRAIN num | TEST num | |
---|---|---|---|
Caffe | 6060 | 4158 | 1902 |
Current config for 8 GPUs with 32 mini-batch size each.
The layer names are designed to match MSRA released pre-trained models to allow for finetuning. You may need to enable/disable bias on conv1
to use these prototxts with some pretrained models.
Running the ResNet-50 as-is gets a few percent lower accuracy than MSRA if done without random reshape & crop.
Pulmonary-nodules-deep-networks 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
- the deep learning and other usages library Tensorflow
Training | Prediction | Classification | Object Detection | Segmentation | Regression | Autoencoder | |
---|---|---|---|---|---|---|---|
Caffe | Y | Y | Y | Y | Y | Y | Y |
Tensorflow | N | Y | Y | N | N | N | N |
Training | Prediction | |
---|---|---|
Caffe | Y | Y |
Tensorflow | Y | Y |
CSV | SVM | Text words | Text characters | Images | |
---|---|---|---|---|---|
Caffe | Y | Y | Y | Y | Y |
Tensorflow | N | N | N | N | Y |
Pulmonary-nodules-deep-networks 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, segmentation, regression, autoencoders, ...
- CUDA 8 or 7.5 is recommended for GPU mode.
- BLAS via ATLAS, MKL, or OpenBLAS.
- protobuf
- IO libraries hdf5, leveldb, snappy, lmdb
- Cmake > 3
- Bazel
By default Pulmonary-nodules-deep-networks 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, segmentation, 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.
Caffe | Tensorflow | Source | Top-1 Accuracy (ImageNet) | |
---|---|---|---|---|
AlexNet | Y | N | BVLC | 57.1% |
SqueezeNet | Y | N | DeepScale | 59.5% |
Inception v1 / GoogleNet | Y | Y | BVLC / Google | 67.9% |
Inception v2 | N | Y | 72.2% | |
Inception v3 | N | Y | 76.9% | |
Inception v4 | N | Y | 80.2% | |
ResNet 50 | Y | Y | MSR | 75.3% |
ResNet 101 | Y | Y | MSR | 76.4% |
ResNet 152 | Y | Y | MSR | 77% |
Inception-ResNet-v2 | N | Y | 79.79% | |
VGG-16 | Y | Y | Oxford | 70.5% |
VGG-19 | Y | Y | Oxford | 71.3% |
ResNext 50 | Y | N | https://github.com/terrychenism/ResNeXt | 76.9% |
ResNext 101 | Y | N | https://github.com/terrychenism/ResNeXt | 77.9% |
ResNext 152 | Y | N | https://github.com/terrychenism/ResNeXt | 78.7% |
DenseNet-121 | Y | N | https://github.com/shicai/DenseNet-Caffe | 74.9% |
DenseNet-161 | Y | N | https://github.com/shicai/DenseNet-Caffe | 77.6% |
DenseNet-169 | Y | N | https://github.com/shicai/DenseNet-Caffe | 76.1% |
DenseNet-201 | Y | N | https://github.com/shicai/DenseNet-Caffe | 77.3% |
VOC0712 (object detection) | Y | N | https://github.com/weiliu89/caffe/tree/ssd | 71.2 mAP |
More models:
- 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/
Pulmonary-nodules-deep-networks comes with a built-in system of neural network templates (Caffe backend only at the moment). This allows the creation of custom networks based on recognized architectures, for images, text and data, and with much simplicity.
Usage:
- specify
template
to use, frommlp
,convnet
andresnet
- specify the architecture with the
layers
parameter:- for
mlp
, e.g.[300,100,10]
- for
convnet
, e.g.["1CR64","1CR128","2CR256","1024","512"], where the main pattern is
xCRywhere
yis the number of outputs (feature maps),
CRstands for Convolution + Activation (with
reluas default), and
xspecifies the number of chained
CRblocks without pooling. Pooling is applied between all
xCRy`
- for
- for
resnets
:- with images, e.g.
["Res50"]
where the main pattern isResX
with X the depth of the Resnet - with character-based models (text), use the
xCRy
pattern of convnets instead, with the main difference thatx
now specifies the number of chainedCR
blocks within a resnet block - for Resnets applied to CSV or SVM (sparse data), use the
mlp
pattern. In this latter case, at the moment, theresnet
is built with blocks made of two layers for each specified layer after the first one. Here is an example:[300,100,10]
means that a first hidden layer of size300
is applied followed by aresnet
block made of two100
fully connected layer, and another block of two10
fully connected layers. This is subjected to future changes and more control.
- with images, e.g.
Pulmonary-nodules-deep-networks is designed and implemented by Yingyi Wu [email protected].
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:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
If you would like to build with cuDNN, your cmake
line should be:
cmake .. -DUSE_CUDNN=ON
To target the build of underlying Caffe to a specific CUDA architecture (e.g. Pascal), you can use:
cmake .. -DCUDA_ARCH="-gencode arch=compute_61,code=sm_61"
If you would like a CPU only build, use:
cmake .. -DUSE_CPU_ONLY=ON
If you would like to constrain Caffe to CPU only, use:
cmake .. -DUSE_CAFFE_CPU_ONLY=ON
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
:
cmake .. -DUSE_TF=ON
If you would like to constrain Tensorflow to CPU, use:
cmake .. -DUSE_TF=ON -DUSE_TF_CPU_ONLY=ON
You can combine with XGBoost support with:
cmake .. -DUSE_TF=ON -DUSE_XGBOOST=ON
- Caffe (https://github.com/BVLC/caffe)