# Keras: apply multiple filters to each feature map in CNN

I am new to Keras, and I want to do the following: take a 2D image, and apply four 2D convolution kernels to it, giving four 2D feature maps. I could accomplish this. But then I want to apply two distinct 2D convolutions to each of those 4 maps, giving 8 feature maps. Is that possible?

Here's what I have so far:

import keras
from keras.layers import Conv2D

input_img = keras.Input(shape=(N_rows, N_cols, 1))
x = Conv2D(4, (3,3))(input_img)


But then I don't know how to apply 2 kernels to each of the 4 channels, so that I have eight 2D maps.

You may try Keras DepthwiseConv2D layer
It will convolute each Channel separately. As shown in this depiction. $$\hspace{6cm}$$Image credit - Blog by Chi-Feng Wang
With depth_multiplier argument, you can add more Filetrs i.e. more copy of the "triplet" shown in the depiction.