Using the MNIST dataset, build a classification model in Python to classify a given image of a handwritten digit into one of 10 classes representing integer values from 0 to 9, inclusively. You have to use ANN and CNN with different loss functions as well as different optimization methods. Compare your results, and then select the best classification model for this dataset.  Your answer should have exactly 5 paragraphs. Make sure that the 4th paragraph starts with the word "credit" and that each paragraph is separated by two new lines.
user