Would getting started in research in something outside my specific interest hurt my ability to research in that area later? I'm a CS undergrad who wants to eventually do research in machine learning. My university has plenty of machine learning labs, but they are quite competitive. At the moment, I have a few opportunities to get started in research. One is a project in the electrical engineering department that involves optimization algorithms for Cyber Physical Systems. One is a bio lab looking for someone to work on software for analyzing signals of particular types of fish. Another is working on scientific computing for a physics lab.

I would not be opposed to getting my first shot at research in any of these places, but would getting too involved outside the CS department actually hurt my chances of getting a chance to research in Machine Learning later? Or would having some type of research experience raise my chances for these competitive labs?
I don't see any reason why doing research in one area would prevent you from doing research in another area later on. Many people do several different research projects before they figure out what it is that they want to do and, in some graduate programs, it's even a requirement to do several different "rotation" projects before officially selecting a research group and project.

So I would view any research project as worthwhile. You could find:


you really do like research and find a new area that you'd want to pursue.
you don't like the project but want to try something else.
you really don't like research.


Any of these would be a notable and valuable end result. So don't worry about getting into machine learning later on if you can't get it into it now. Doing research in something that has piqued your interest (at least temporarily) is all that really matters, especially early on in your career.