# CNN Pooling layers unhelpful when location important?

I'm trying to use a CNN to analyse statistical images. These images are not 'natural' images (cats, dogs, etc) but images generated by visualising a dataset. The idea is that these datasets hopefully contain patterns in them that can be used as part of a classification problem.

Most CNN examples I've seen have one of more pooling layers, and the explaination I've seen for them is to reduce the number of training elements, but also to allow for some locational independance of an element (e.g. I know this is an eye, and can appear anywhere in the image).

In my case location is important and I want my CNN to be aware of that. ie. the presence of a pattern at a specific location in the image means something very specific compared to if that feature or pattern appears elsewhere.

At the moment my network looks like this (taken from an example somewhere):

_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
conv2d_1 (Conv2D)            (None, 196, 178, 32)      896
_________________________________________________________________
activation_1 (Activation)    (None, 196, 178, 32)      0
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 98, 89, 32)        0
_________________________________________________________________
conv2d_2 (Conv2D)            (None, 96, 87, 32)        9248
_________________________________________________________________
activation_2 (Activation)    (None, 96, 87, 32)        0
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 48, 43, 32)        0
_________________________________________________________________
conv2d_3 (Conv2D)            (None, 46, 41, 64)        18496
_________________________________________________________________
activation_3 (Activation)    (None, 46, 41, 64)        0
_________________________________________________________________
max_pooling2d_3 (MaxPooling2 (None, 23, 20, 64)        0
_________________________________________________________________
flatten_1 (Flatten)          (None, 29440)             0
_________________________________________________________________
dense_1 (Dense)              (None, 32)                942112
_________________________________________________________________
activation_4 (Activation)    (None, 32)                0
_________________________________________________________________
dropout_1 (Dropout)          (None, 32)                0
_________________________________________________________________
dense_2 (Dense)              (None, 3)                 99
_________________________________________________________________
activation_5 (Activation)    (None, 3)                 0
=================================================================
Total params: 970,851
Trainable params: 970,851
Non-trainable params: 0
_________________________________________________________________


The 'images' I'm training on are 180 x 180 x 3 pixels and each channel contains a different set of raw data.

What strategies are there to improve my CNN to deal with this? I have tried simply removing some of the pooling layers, but that greatly increased memory and training time and didn't seem to really help.

• Can you tell me more about statistical images? How should I interpret the image you posted? – Martin Thoma Nov 19 '18 at 6:43
• How good is your current network? Which type of mistakes does it make? Have a look at chapter 2.5 of my Master's thesis for some ideas how to analyze your network. – Martin Thoma Nov 19 '18 at 6:46

keras.layers.Conv2D(filters, kernel_size, strides=(1, 1), padding='valid', data_format=None, dilation_rate=(1, 1), activation=None, use_bias=True, kernel_initializer='glorot_uniform', bias_initializer='zeros', kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, bias_constraint=None)