As a typical harmful social behaviour, tail biting is considered to be a welfare-reducing problem with economic consequences for pig production. Taking a computer-vision based approach, in this study, we have developed a novel method to automatically identify and locate tail-biting interactions in group-housed pigs. The method employs a tracking-by-detection algorithm to simplify the group-level behaviour to pairwise interactions. Then, a convolution neural network (CNN) and a recurrent neural network (RNN) are combined to extract the spatial-temporal features and classify behaviour categories. The performance of the proposed method was evaluated by quantifying the localisation accuracy and behaviour classification accuracy. The results demonstrate that the tracking-by-detection approach is capable of obtaining the trajectories of biters and victims with a localisation accuracy of 92.71%. The spatial-temporal features trained by CNN and RNN are robust and effective with a category accuracy of 96.25%. In total, our proposed method is capable to identify and locate 89.23% of tail-biting behaviour in group-housed pigs. (C) 2020 IAgrE. Published by Elsevier Ltd. All rights reserved.