What are the ways to transfer from my current PhD program to another one? I am currently a 2nd year PhD student at a university in Canada. My PhD program is about environment chemistry. For a long time I wanted to learn computer science, especially machine learning, and I have 1 year work experience in an IT company.

I do not have a diploma in CS, though I have learned some course about programming and have experience in some programming languages.

Now I realize that I do not like my current research about chemistry, and my research has little progress recently. I also keep thinking about changing my PhD program or transfer to another program. I am particularly interested in machine learning, and relevant researches.

What ways can lead me to that track ? 
Thank you.
It is occasionally possible to switch to another department as a PhD student, if you can find a department/advisor who wants you.  I know someone who switched from chemistry to math when I was in grad school.  However it is not so common for a couple of reasons:


If you weren't successful (by ability or by choice) in another PhD program, why would you be in this one?
You will be taking a slot away from another potential student who is likely much better prepared than you for a CS PhD.


Getting an MS in CS first will do a lot to alleviate both of these concerns--it shows commitment to graduate work in this field and addresses your lack of preparation.  

In any case, it makes sense to try to set up an appointment with the CS graduate director at your university and ask him/her about the possibility of switching to one of their grad programs.