<p>40% accuracy is not good. It needs to train more. You should rescale images to <code>128 or 256</code> to save time. Also try increasing epoch count to something like 100 or minimize loss to at least around 1 before testing. Another thing is class imbalance. </p>

<p>According to this, <a href="https://arxiv.org/abs/1708.07747" rel="nofollow noreferrer">https://arxiv.org/abs/1708.07747</a> link <code>Fashion MNIST</code> contains <code>7000</code> images per class with <code>70000</code> images in total. If your dataset has class imbalance which seems likely then you should look into other metrics and methods.</p>
Neural network training accuracy is too low and prediction is not working in Image Classification with Keras
<p>I am following this guide to learn image classification with neural networks:</p>

<p><a href="https://www.tensorflow.org/tutorials/keras/classification" rel="nofollow noreferrer">https://www.tensorflow.org/tutorials/keras/classification</a></p>

<p>And I implement this code for my custom dataset. I have 2300 gray scaled 1024x1024 pictures to train model. I hold all my images in 3D numpy array as train_images and test_images. I have 4 class which are 0,1,2,3 and I hold those as list, named "labels".</p>

<pre><code>train_images.shape # returns (2300,1024,1024)
test_images.shape # returns (384,1024,1024)

# normalize values
train_images = train_images / 255.0
test_images = test_images / 255.0

model = keras.Sequential([
    keras.layers.Flatten(input_shape=(1024, 1024)),
    keras.layers.Dense(128, activation='relu'),
    keras.layers.Dense(4, activation='softmax')
])

model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

model.fit(train_images, labels, epochs=10)
</code></pre>

<p>Everything almost same with guide. But my epoch accuracy is around 0.4</p>

<pre><code>Epoch 10/10
...
2176/2300 [===========================&gt;..] - ETA: 0s - loss: 9.5701 - acc: 0.4062
2208/2300 [===========================&gt;..] - ETA: 0s - loss: 9.5628 - acc: 0.4067
2240/2300 [============================&gt;.] - ETA: 0s - loss: 9.5485 - acc: 0.4076
2272/2300 [============================&gt;.] - ETA: 0s - loss: 9.5417 - acc: 0.4080
2300/2300 [==============================] - 12s 5ms/step - loss: 9.5307 - acc: 0.4087
</code></pre>

<p>Also in guide some predictions are fractional but when I try to do prediction, My model predictions are only 0 or 1. It says this is %100 (x) but its wrong.</p>

<pre><code>predictions = model.predict(test_images)
print(predictions)
# 0 | 0 | 1 | 0
# 0 | 0 | 1 | 0
# 1 | 0 | 0 | 0
</code></pre>

<p><strong>UPDATED</strong></p>

<p>Here is epoch results for 256*256 2 classed 100 images per class:</p>

<pre><code>32/200 [===&gt;..........................] - ETA: 0s - loss: 8.5627 - acc: 0.4688
200/200 [==============================] - 0s 317us/step - loss: 8.0590 - acc: 0.5000
Epoch 10/10
</code></pre>

<p>Also I lowered my classes into 2 but my predictions are still return %100 and wrong class.</p>

<hr>

<p>I dont know where I am doing wrong. If you have any advice/idea I would be grateful. Thank you in advance.</p>