Normally, in healthy police forces, the police is in contact with protest organisers to cooperate on weeding out the violent troublemakers to ensure the protest remains peaceful. This has always been very effective in many countries, including the US, before US police abandoned this approach and started training for escalation instead.