Im trying to use the MNIST database of handwritten numbers to make a neural network that predicts a number. The issue is that the validation accuracy is very high, around 98%, but when i try to apply the model to numbers outside of the database, the accuracy is very low. I got an accuracy of 50% with a dense network and 60% with a CNN. Im not sure what the issue is or how I can make the network work more consistently with new data that I give it. Any advice would be appreciated. If needed, I can send the code and test images.