Computer Vision News - February 2018

Inception v4 in Keras: If what you need is to quickly and efficiently build and test a neural network, with minimal coding required, go with Keras. In just a few minutes, you can construct simple or very complex neural networks. Keras is a very easy-to-use, modular front-end library, to TensorFlow’s back-end, capable of running on top of other Machine- and Deep-Learning libraries like MXNet, Deeplearning4j, Tensorflow, CNTK or Theano. Keras library includes common neural network elements such as layers, objectives, activation functions, optimizers, etc. In addition it includes auxiliary functions for easily handling images and text. Looking at the code snippet for inception block 35 below, we see it is slightly more elegant, and simpler to use, than even TF-Slim. However, the fact that with the mildly greater effort spent to code the network in TF-Slim, you get access to all of the powerful tools of TensorFlow should you need them, makes it worthwhile. For the entire GoogLeNet inception v4 network coded in Keras, see here . Computer Vision News 17 Tool We Tried for You: TensorFlow-Slim def inception_resnet_block ( x , scale , \ block_type , block_idx , activation = 'relu' ): if block_type == 'block35' : branch_0 = conv2d_bn ( x , 32 , 1 ) branch_1 = conv2d_bn ( x , 32 , 1 ) branch_1 = conv2d_bn ( branch_1 , 32 , 3 ) branch_2 = conv2d_bn ( x , 32 , 1 ) branch_2 = conv2d_bn ( branch_2 , 48 , 3 ) branch_2 = conv2d_bn ( branch_2 , 64 , 3 ) branches = [ branch_0 , branch_1 , branch_2 ] elif block_type == 'block17' : elif block_type == 'block8' : block_name = block_type + '_' + str ( block_idx ) channel_axis = 1 \ if K . image_data_format () == 'channels_first' else 3 mixed = Concatenate ( axis = channel_axis , \ name = block_name + '_mixed' )( branches ) up = conv2d_bn ( mixed ,...) x = Lambda ( lambda inputs , scale : inputs [ 0 ] + inputs [ 1 ] * scale , output_shape = K . int_shape ( x )[ 1 :], arguments ={ 'scale' : scale }, name = block_name )([ x , up ]) if activation is not None : x = Activation ( activation , name = block_name + '_ac' )( x ) return x

RkJQdWJsaXNoZXIy NTc3NzU=