Validation of an automated data collection method for quantifying social networks in collective behaviours