0
$\begingroup$

I am using Conv1d for time-series data and I have create a model as follows,

model=Sequential()
model.add(Conv1D(32,250,strides=9,padding='same',input_shape=(1500,9), kernel_regularizer=regularizers.l2(0.01)))
c1 = MaxPooling1D(2)
model.add(c1)
model.add(Dropout(0.5))
model.add(BatchNormalization())

model.add(Conv1D(64,250,strides=9, padding='same',kernel_regularizer=regularizers.l2(0.01)))
conv1 = MaxPooling1D(2)
model.add(conv1)
model.add(Dropout(0.5))
model.add(BatchNormalization())

model.add(Flatten())

model.add(Dense(512, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(40, activation='softmax'))

opt = keras.optimizers.adam(lr = 0.001, decay = 1e-6)
model.compile(loss = 'categorical_crossentropy', optimizer = opt, metrics = ['accuracy'])

The model.summary() when using strides as 9 looks like enter image description here

The model.summary() for the above model with stride as 1 looks as follows enter image description here

I am confused as to how would the higher number of strides affect the performance of the model. Which would be better, strides = 1 or strides = 9? Can someone guide me with this?

$\endgroup$
  • $\begingroup$ Don't you want causal padding for most ts models? $\endgroup$ – generic_user Feb 19 at 11:53
1
$\begingroup$
  • In most cases which I have seen, a larger number of strides skips the essential context of an image required for image classification. The higher number of strides moves the convolution windows far away from each other which may lower down validation accuracy. For smaller images, they are useless. But, for larger images they might prove useful.

  • Smaller strides like 1 are the best choice for Convolutional networks. They move the convolution window one by one to the next of pixels/values. This helps to retain the context of the image, and hence the validation accuracy remains high, if the images are smaller in image classification tasks.

$\endgroup$
  • $\begingroup$ I am using conv1d in time-series data. Its basically is a signal. So I am trying to use strides of size 10 or more to filter out the noise. $\endgroup$ – Gala Feb 19 at 20:55

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.