CNN Input Output Shape
Refer to this link.
Input Shape
You need to ensure that all images are the same dimensions. Usually the images are squares with dimensions by powers of 2.
4D Array of Image
(batch_size, height, width, depth)
Displaying Input Image
Batch Size
Specifying batch size in CNN
Specifying batch size when fitting (default batch size will be None
)
None
)Depth of an image
Number of colour channel
RGB:
Greyscale:
Output Shape
4D Array
batch_size
always stays the same as input (even when Flattening)The rest change based on filter, kernal size, padding, etc.
Changing dimensions of Output Shape
Usually, Dense layers are added on top of Conv layers for classification, but Dense layers take in a 2D array
So you must Flatten before adding a Dense layer to change the dimensions to 2D array.
Last updated