sharing ideas for collaboration or working on them individually? I'm in the middle of my PhD and published 2 conference papers only with my supervisor, But i always want to have collaborations with other academic people in the field. Unfortunately i am a bit confused there!


I met people in conferences who were working on similar problems in the area, but i do not know how to initiate/request for collaboration? especially with a professor or a high level researcher. 
Sometime when i read a paper related to my work, an idea for improvement of the proposed approach comes to my mind. But i put it somewhere in the shelf to get back to it later. But i'm not sure if it is a good idea to share it with the author or keep it to myself and work on it alone? In case of the first, should i contact the student author or the professor?
BTW, my field is computer science and i deal with machine learning and data analysis! so the most probable scenario which comes to my mind is getting some specific data from someone and working on that, but then it wouldn't be considered collaboration!
As a PhD student you are not usually required to have significant collaborations outside your school or department, although it does happen. So, if you are thinking about external collaborations, the first think you should do is talk to your advisor about it. Your advisor almost certainly has many connections in the field. Thus, they might be able to recommend someone to work with. But, they might also discourage this. You are (at least in theory) being trained by your supervisor. This gives them a greater responsibility for helping you develop your research abilities. Working with someone externally can put some of this burden onto them if your advisor isn't also involved.

For instance, I have a current PhD student that is part of an external collaboration, but I do some work to ensure that anything that we do that goes to our external collaborators is high enough quality that we aren't wasting their time. My colleague does something similar when his students work with me.

When I receive an unsolicited research request from a colleague's student, the first thing I do is contact their supervisor to see if they know about the request. I don't want to be seen as going behind their back to work with their student, and I wouldn't want someone else doing this with students I'm supervising.