In general, if you want to maximize money, it does not make sense to go into any hard and niche fields (graphics, machine learning research etc.) because they're filled with very talented enthusiasts, and if you're not that, you will have a very hard time even being average in such fields. Not to mention that such fields often (but not always) pay less that your run of the mill backend development job, and have 1000x less open positions, which means it's harder to apply for jobs, you may have to move more often etc. It's basically all downsides pretty much, and the only upside is being able to work on your passion - which is what motivates people who get into those fields.