<p>My guess is that you're misunderstanding how convolutional layers defined.</p>

<p>My notation for the shape of the convolutional layer is <code>(out_channels, in_channels, k, k)</code> where <code>k</code> is a the size of the kernel. The <code>out_channels</code> is the number of filters (i.e. convolutional neurons). Consider following image:</p>

<p><a href="https://i.stack.imgur.com/8o519.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8o519.png" alt="Convolution illustration"></a></p>

<p>The 3d convolutional kernel weights in the picture slide across different data windows of <code>A_{i-1}</code>(i.e. input image). Patches of 3D data of that image of shape <code>(in_channels, k, k)</code> are paired with individual 3d convolutional kernels of matching dimensionality. How many such 3d kernels are there? As the number of output channels <code>out_channels</code>. The depth dimension that kernel adopts is the <code>in_channels</code> of <code>A_{i-1}</code>. Therefore, the dimension <code>in_channels</code> of <code>A_{i-1}</code> is contracted away by the depth-wise dot product that builds up the output tensor with <code>out_channels</code> channels. The precise way in which the sliding windows are constructed is defined by the sampling tuple (<code>kernel_size, stride, padding)</code> and results in output tensor with spatial dimensions determined by the formula that you're correctly applied.</p>

<p>If you want to understand more, including backpropagation and implementation take a look at <a href="https://arxiv.org/pdf/1811.11987.pdf" rel="nofollow noreferrer">this</a> paper.</p>
Understanding the output shape of conv2d layer in keras
<p>I do not understand why the channel dimension is not included in the output dimension of a conv2D layer in Keras.</p>

<p>I have the following model</p>

<pre><code>def create_model():
    image = Input(shape=(128,128,3))

    x = Conv2D(24, kernel_size=(8,8), strides=(2,2), activation='relu', name='conv_1')(image)
    x = Conv2D(24, kernel_size=(8,8), strides=(2,2), activation='relu', name='conv_2')(x)
    x = Conv2D(24, kernel_size=(8,8), strides=(2,2), activation='relu', name='conv_3')(x)
    flatten = Flatten(name='flatten')(x)

    output = Dense(1, activation='relu', name='output')(flatten)
    model = Model(input=image, output=output)
    return model

model = create_model()
model.summary()
</code></pre>

<p>The model summary is given the figure at the end of my question. The input layer takes RGB images with width = 128 and height = 128. The first conv2D layer tells me the output dimension is (None, 61, 61, 24). I have used the kernel size of (8, 8), a stride of (2, 2) no padding. The values 61 = floor( (128 - 8 + 2 * 0)/2 + 1) and 24 (number of kernels/filters) makes sense. <strong>But why isn't the dimension for the different channels included in the dimension?</strong> As far as I can see the parameters for the 24 filters on each of the channels is included in the number of the parameters. <strong>So I would expect the output dimension to be (None, 61, 61, 24, 3) or (None, 61, 61, 24 * 3). Is this just a strange notation in Keras or am I confused about something else?</strong></p>

<p><a href="https://i.stack.imgur.com/Ptyqi.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Ptyqi.png" alt="enter image description here"></a></p>