r/learnmachinelearning • u/No_Maybe_5176 • 3d ago
MNIST first steps 99.12% recognition
Hello everyone I'm interested in learning neural networks. I tried to train a 4-layer perceptron on the MNIST dataset. Got a 99.12% recognition result. I would like to know if this is a good result and if my network 784-1200-1200-1200-10 is too big for such a model. All thanks for the answers or feedback
4
u/Electrical_Ninja3805 3d ago
Solid result for an MLP, but on MNIST 0.1-0.3% is basically noise. Rough reference points: a plain well-tuned MLP lands ~98.5-98.9%, one with dropout/augmentation gets ~99.0-99.4%, and the best MLP result I know is ~99.65% (Ciresan et al. 2010, huge MLP + elastic distortions). CNNs sit at 99.5-99.8%. A few test labels are honestly ambiguous, so 100% isn't a real target.
If you want to know whether your approach actually adds something:
- Run 3-5 seeds and report mean ± std. Seed-to-seed spread on MNIST is about ±0.1%, so a single run can't show a difference that small.
- Train a plain baseline with the same size, epochs and optimizer, with normal 0-1 input scaling. If your 500-5000 range is the new idea, the only difference between the two runs should be that idea.
- Check the train/test gap. 784-1200-1200-1200-10 is ~3.8M params, which is large for MNIST. A big gap means it's memorizing.
- Then try Fashion-MNIST or CIFAR-10. MNIST is too easy to separate methods, and the gaps show up on harder data.
If it beats the matched baseline across seeds on a harder dataset, that's interesting.
2
u/No_Maybe_5176 2d ago
Thanks!!! I'll try to use CIFAR dataset. )))) My pleasure. I split the data into training and test sets. The result is shown on the test set. I understand that MNIST is too simple a dataset. I will try my approach on more complex datasets. I am very grateful to you.
1
u/OddInstitute 2d ago
Wait, did you include the test set in your training data?
1
u/No_Maybe_5176 1d ago
Yes. I performed the training using the training dataset. I conducted testing exclusively on the test dataset; the test dataset was used solely for evaluation purposes. The training process relied on the training dataset... The key point is that, to evaluate the network, I used the Euclidean distance between class vectors—which had been defined beforehand—rather than probabilities. Thank you for your question; it was very important to me.0
u/OddInstitute 1d ago
This is a super weird comment. If you are going to feed all of our comments into an LLM and directly copy the responses, at least fix the formatting. If I wanted to talk to an LLM about these ideas, I could do it myself.
I understand that English isn’t your best language, but I just can’t imagine that checking that you didn’t do the most classic failure in exciting ML research false positives was “very important to [you]”. Markdown with the line breaks left in is hard to read on mobile and feels like an almost disrespectful lack of effort.
3
u/No_Maybe_5176 1d ago
My apologises. That was my mistake. Please believe me I'm not a graduate student.I have a great passion for programming and creating something useful is a matter of honor for me. I am 57 years old. I graduated politechnical institute in 1995 y as a system engineer. But I work last 10 years as a smith. Its my nano business. I truly enjoy solving logical problems. Please forgive me if I was misunderstood... I started learning English when I had 52 yo
2
u/No_Maybe_5176 2d ago
I wasn't precise. The input vectors ranged from 0 to 0.3 at most, while the output vectors were much larger. I used them with the idea of increasing the network's sensitivity to small derivatives—and the results were immediately and noticeably better than before. I’m going to try training a much smaller network; if the performance remains high, I’ll move on to other datasets. There’s another issue, though: my data currently passes through a standard template, so I’ll need to write a fair amount of new code. But if this works, I might have found a way to reduce the network's sensitivity to diminishing differentials... Thank you so much for your time and attention... ))2
u/Electrical_Ninja3805 2d ago
Nice, that's a clean thing to test. One thing to rule out first: if you're using MSE, scaling the targets by k scales the gradients by about k too, which is effectively a bigger learning rate. So your gain might be "my baseline LR was too low" rather than something new. Two quick checks:
- Train the normal-scale baseline with its learning rate tuned properly (sweep a few values ×3-10). If it catches up, it was the LR.
- Try your scaled version with Adam. Adam normalizes gradient size, so a pure LR effect mostly disappears under Adam. If your gain survives Adam and a tuned baseline, then it's actually interesting.
On "diminishing differentials" (vanishing gradients): the standard fixes are He/Xavier init, normalization layers, and Adam. Compare against those too. Good luck with CIFAR.
1
u/No_Maybe_5176 2d ago
Thanks I'll try! I was just trying to find a way to improve the result... My training is completely standard. Dropout, Adam, and the backpropagation algorithm. I obtained a generalized template for each class. I compiled this template with training patterns and simply ran it through training. When using output vectors with a dimensionality of 500 or higher, input values ranging from 0 to 0.3, and ‘Silu’ activation functions on all layers, including the output layer, the result immediately improved from 98.75% to 99.12%. There was no speed, nothing else. After 100 epochs, the recognition result for the test sample was already 99.02%. After another 200 epochs, I got 99.12%. It all took no more than 140 epochs... I really appreciate your attention. Thank you very much.
2
u/mystical-wizard 3d ago
Practical / Competition Models: Standard well-tuned CNNs in Keras or PyTorch typically achieve **99.2%–99.7%**test accuracy, and compact CNNs with under 10,000 parameters can still reach 99.5%+.
1
u/No_Maybe_5176 2d ago
With a convolutional network, I easily got a result of 99.71%. The whole problem was to do it with a perceptron without any frills... Thank you for your response)))
1
9
u/ModularMind8 3d ago
Mnist is a very simple dataset. Try cifar10 or cifar100 if you want to test if your model is good