yunjhongwu / deeplearning4j-vgg-convnet

Deeplearning4j implementation and serialized models of convolutional layers of VGG ConvNet D and E (VGG16 and VGG19)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VGG ConvNet for Deeplearning4j

The codes contain the pretrained Deeplearning4j convolutional layers of ConvNet D (VGG 16) and ConvNet E (VGG 19) described in

  • Simonyan, K., & Zisserman, A. (2014). Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556.

The pretrained weights were downloaded from the authors' website. The serialized models and configurations in this repository do not contain the fullly connected layers in the original models. The pretrained convolutional networks can be used as feature extractors.

Content

  • src/Demo.java for demonstration
    • INDArray preprocess(INDArray raw) substracts the means (R: 123.680, G: 116.779, B: 103.939) from each channel of input image.
    • MultiLayerNetwork getBottomLayers(MultiLayerNetwork net, int k) returns bottom-k layers of a pretrained convolutional VGG network.
  • src/FeatureVisualizer.java: Visualize features
  • src/VGGConvNetD.java and src/VGGConvNetE.java contain the configurations of convolutional layers of VGG models.
  • model/vgg16.dl4jmodel and models/vgg19.dl4jmodel contain serialized Deeplearning4j VGG models

Example

Input: Fat squirrel of U-M

squirrel

Output of the first 10 layers (7 ConvolutionLayers and 3 SubsamplingLayers) of VGG ConvNet D

vgg16layer10

Final output of VGG ConvNet E

vgg19layer21

About

Deeplearning4j implementation and serialized models of convolutional layers of VGG ConvNet D and E (VGG16 and VGG19)


Languages

Language:Java 100.0%