Model Zoo

WekaDeeplearning4J contains a wide range of popular architectures, ready to use either for training or as feature extractors. The table below outlines the different models included, whether pretrained weights are available, the types of pretrained weights, and the model variations (if any). WekaDeeplearning4j merges the model zoo of Deeplearning4j and Keras. Values in bold are the defaults.

Framework Model Pretrained Implemented Weights Available Varieties
DL4J AlexNet No - -
DL4J Darknet19 Yes ImageNet 224x224 or 448x448 input size
DL4J FaceNetNN4Small2 No - -
DL4J InceptionResNetV1 No - -
DL4J LeNet Yes MNIST -
DL4J ResNet50 Yes ImageNet -
DL4J SqueezeNet Yes ImageNet -
DL4J VGG Yes ImageNet, VGGFace (VGG16 only) 16, 19
DL4J XCeption Yes ImageNet -
Keras DenseNet Yes ImageNet 121, 169, 201
Keras EfficientNet Yes ImageNet B0-B7
Keras InceptionV3 Yes ImageNet -
Keras NASNet Yes ImageNet Mobile, Large
Keras ResNet Yes ImageNet 50, 50V2, 101, 101V2, 152, 152V2
Keras VGG Yes ImageNet 16, 19
Keras Xception Yes ImageNet -

Finetuning some of these models can result in NaN errors (returns NaN for all classes when performing prediction on an instance). Currently, the only fix for this is to retune the network: DL4J Help


To set a predefined model, e.g. ResNet50, from the model zoo in the GUI is straightforward via the corresponding pop-up menu. To set a predefined model from the command-line or via the API, it is necessary to add the -zooModel ".Dl4jResNet50" option via commandline, or call the setZooModel(new ResNet50()) on the Dl4jMlpClassifier object.

Model names from Keras are prepended with Keras, i.e., KerasResNet, and similarly for Deeplearning4j models (e.g., DL4JDarknet19). In addition, some models support different variations. Again, it is straightforward to do this via the GUI. To do via command line you must add the -variation argument e.g.:

-ZooModel ".KerasResNet -variation RESNET152V2" 

If using the Java API, these can be set via .setVariation() e.g.:

KerasResNet kerasResNet = new KerasResNet();

View the featurizing tutorial and the finetuning tutorial for usage examples with the model zoo.

Model Summaries

The following summaries are generated from the pretrained zoo models included in WekaDeeplearning4j. These may be useful as a reference for trying different feature extraction layers, or simply to investigate famous model architectures.