Reputation: 389
I am reading this Tensorflow tutorial about Fashion MNIST classification with tf.keras. Although it is an image classification problem, they train with only dense layer and softmax:
model = keras.Sequential([
keras.layers.Flatten(input_shape=(28, 28)),
keras.layers.Dense(128, activation='relu'),
keras.layers.Dense(10)
])
I checked myself, it trains very fast and achieves a high accuracy. The question is how they do it without convolution at all, just matrix multiplication and RELU? I thought it could be done with at least one convolutional layer.
Upvotes: 1
Views: 415
Reputation: 2331
Convolution are not mandatory when the task is not too complex (small and simple images).
Images are just a matrix of pixel that you can flatten and classify, but this method has its limits.
By flattening you'll loose all the spacial informations of the image, informations that can be really important. That's why convolutional networks are better, they keep all those features.
To summarize : Fully connnected networks can achieve high accuracy quickly on simple tasks but will never perform as good as a convolutional network on images.
Upvotes: 3