If you want to do this I’d say go all in and get a PhD. I was an engineer major in undergrad and did a lot of coding. Now doing a lot of work in AI on clinical side especially for prediction modeling. Definitely a big future in this and a PhD is likely to open more opportunities than just a masters and you’ll get a deeper understanding of AI. Plus you could basically match into any residency, assuming scores are decent. And VC firms will be banging on your door before you graduate Med school. All scenarios based on real life events. With a masters will have same as above but attenuated.