The behaviour of beef cattle, especially abnormal behaviours such as mounting, fighting, and running, provides valuable information regarding their health status. Recently, existing methods based on deep convolutional networks have achieved state-of-the-art performance in beef cattle behaviour recognition. However, these methods focus only on the basic motion behaviours of a single cow (e.g. lying and standing) and ignore the abnormal behaviours of group-housed cattle, which further limits their application in an actual farm environment. In this study, we collected a realistic dataset of beef cattle abnormal behaviour called Beef Cattle Abnormal Actions, which was captured in different light environments and on different behavioural area scales. With the proposed dataset, we proposed a Dual-Branch Temporal Excitation and Aggregation with Frequency Channel Attention (DB-TEAF) method. First, a sampling strategy based on differences in image RGB information was proposed to extract representative motion-salient frames from redundant videos. Second, the temporal excitation and aggregation branch with frequency channel attention (TEAF) was introduced to focus attention on the key channels of short- and long-range temporal features. The spatial branch is incorporated into the TEAF branch to obtain the representative spatio-temporal features. In addition, focal loss was used to train the proposed model, which made the learning process aware of valuable samples from abnormal behaviour. Testing with the newly collected dataset verified that the proposed DB-TEAF method achieved superior performance compared to other state-of-the-art approaches. The findings of this study would provide support for recognising the abnormal behaviour of livestock during precision farming.