Abstract:The activity index has been widely used as an important indicator to quantify the behavior response of livestock animals to their micro-environment. The variety of breeding facilities and dynamic backgrounds brings challenges to precisely monitor this indicator by the approach based on background subtraction. Aiming to extract the activity index under the dynamic background, a novel approach based on the Gaussian mixture model was proposed, in which the hyperbolic tangent function was introduced to regulate the learning rate parameter (ALR-GMM). In each iteration, through an adaptive learning rate regulation mechanism, the ALR-GMM can describe the image background and detect the moving pixels synchronously. The algorithm was evaluated on the manually labeled image. Compared with the calculation methods based on the background subtraction and the classical GMM methods, the mean relative errors were reduced by 0.74 percentage points and 3.74 percentage points, respectively. In order to further verify the feasibility, the proposed algorithm was applied to recognize aggressive behavior of group-housed pigs. The original video was divided into 3s episode units. In each video unit, the maximum, mean, variance and standard deviation of the activity index were taken as the feature vector. The behavior classifier was established by the linear kernel SVM. The results showed that the accuracy, sensitivity, specificity and precision were 97.6%, 97.9%, 97.7% and 97.8%, respectively, which met the requirements of practical application.