Hello! Thank you again, and I've noticed an issues that might be worth addressing:
The model shows 100% confidence when classifying inputs that are clearly not digits.

I drew a horse on grid, and the model with 100% confidence says it's 3, with 50xdataset training weights. The winning neuron shows very high logit values (e.g., 20+) Even a blank/uniform input produces confident predictions.
Actually this is a common issue in machine and deep learning called overconfidence on out-of-distribution (OOD) data. While the model is correctly trained on MNIST, it has no mechanism to express uncertainty when it encounters inputs outside its training distribution.
I would appreciate it if you could let me know if you ever find a solution to this problem.