Predicting social density in mass events to prevent crowd disasters