# Squeeze-and-Excitation Network example (SENet / SE-ResNet)

**URL:** <https://community.konduit.ai/t/squeeze-and-excitation-network-example-senet-se-resnet/144>\
**Category:** DL4J\
**Created:** [February 19, 2020, 10:43pm UTC](https://community.konduit.ai/t/squeeze-and-excitation-network-example-senet-se-resnet/144 "2020-02-19T22:43:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexoooo](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@alexoooo](https://community.konduit.ai/u/alexoooo)\
**Post date:** [February 19, 2020, 10:43pm UTC](https://community.konduit.ai/t/squeeze-and-excitation-network-example-senet-se-resnet/144/1 "2020-02-19T22:43:17Z")

</div>

Squeeze-and-Excitation Network is an interesting publication:

> **[Squeeze-and-Excitation Networks](https://arxiv.org/abs/1709.01507)**
>
> The central building block of convolutional neural networks (CNNs) is the
> convolution operator, which enables networks to construct informative features
> by fusing both spatial and channel-wise information within local receptive
> fields at each layer....

There are many implementations online, e.g. in TensorFlow see se\_bottleneck:

> <https://github.com/tensorpack/tensorpack/blob/master/examples/ResNet/resnet_model.py>

It looks like it should be possible to implement it in DL4J, but I’m not sure which layers to use.

I guess first would be a GlobalPoolingLayer with “collapseDimensions = false”.  
Then CnnToFeedForwardPreProcessor, and 2 x DenseLayer.

Then we need to scale and add, see “SE-ResNet Module” picture in publications.

For that, do we use a FeedForwardToCnnPreProcessor into Upsampling2D and a ScaleVertex?  
I haven’t used the Upsampling2D or ScaleVertex before, do they make sense here or do we need something else?

It would be great to have an example of this on deeplearning4j-examples.
