I'm applying to phd programs after being out of school for a couple of years working as a software engineer. The problem is that all my research and work experience has been in machine learning, but I'm not that interested in this field. Not only so, there's too much competition in this area for me to get into a good program. What should i do?
Why do you think you are pigeonholed? Many people will do a PhD in a different area than their undergraduate (masters). People will do postdocs and become professors in different (but related) departments than their PhD degree. Assuming your undergrad is in any hard discipline (engineering, math, physics, cs, etc.) you can basically do a phd in any hard discipline.
When applying to a PhD program you are going to be evaluated based on your potential, not based on what you've already done.
With a bachelors in the US, starting doctoral study doesn't have you pigeonholed at all. In fact, if you have some research experience in pretty much anything then you will be a good candidate, other things being equal (grades, letters...).
Doctoral study (which I'd recommend over a MS, here) leaves you lots of time to choose an area of specialization. The only thing you need to be clear about is the general field, such as Math or CS, say.
The early program is filled with advanced coursework and probably only an introduction to research. The first hurdle is (most places) comprehensive exams. Only then do you need to be real specific and choose a dissertation advisor.
The situation is a bit different in some lab sciences where you need to join a lab earlier, but form most fields you are a "free agent" for at least a couple of years.
I advise doctoral study since you can get funded as a doctoral student (as a TA, perhaps) and have tuition forgiven. That isn't as likely for an MS student.
But since you've been out of school a couple of years, try to reestablish contact with old professors who can verify your skill and dedication.