What to set the number recognition first layer as 25 units?

any specific reason?

Experimentation.

  • Too small and the model is too simple.
  • Too large and it’s too difficult or slow to train.

Also, two hidden layers may not even be needed - always start with one, and only add more if absolutely necessary to get good enough results.

ok. Thank you. which means no specific reason to have 25 units for a simple digital recognition.