1
$\begingroup$

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.

enter image description here

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.

$\endgroup$
  • $\begingroup$ Can you tell me more about statistical images? How should I interpret the image you posted? $\endgroup$ – Martin Thoma Nov 19 '18 at 6:43
  • $\begingroup$ 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. $\endgroup$ – Martin Thoma Nov 19 '18 at 6:46
-1
$\begingroup$

Pooling doesn't completely remove information about location of features within your image. If you don't want to use pooling but want to reduce the size of your neural net layers you should try a value of stride greater than 1 in your convolutional layers. e.g:

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)

$\endgroup$
  • $\begingroup$ Increasing the side is very similar to pooling. In fact you can represent pooling by the convolutional layers $\endgroup$ – Martin Thoma Nov 19 '18 at 6:48
  • $\begingroup$ @MartinThoma where in my answer did I say that stride is not similar to pooling? $\endgroup$ – Mike Vella Nov 19 '18 at 12:15
-1
$\begingroup$

1X1 convolution might improve accuracy as they reduce dimension in filter space.

Google inception V3 architecture would be a good starting point.

https://arxiv.org/pdf/1512.00567.pdf

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.