Are you drinking enough water?
I would suggest you see your doctor and have your eyes checked, as well.
Thinking doesn't cause headaches, stress does
I know if I am playing by memory I tend to hunch towards the keys which strains my neck and that can cause headaches.
Cut down your practicing time - 5 hours a day is too much
If not, you probably found the source of your problems and you don't have to worry about your mental state.