Is it okay to start a collaboration with a research group of which you're reviewing a paper? A scientific journal assigned me a paper to review.
During the review process, I realized I have some interesting ideas about the paper project, so I am thinking about to contact the authors and propose them to start a collaboration together.

What should I do?

Should I contact them and explain my proposals directly? But will this invalidate my journal review?
Finish the review and wait until the paper you are reviewing is published to contact them.

Reviews are supposed to be anonymous and by doing this you waive your anonymity away.