{'fraction_non_alphanumeric': 0.029304836399691527, 'fraction_numerical': 0.012779552715654952, 'mean_word_length': 5.039920159680639, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Computer vision-based techniques for cow object recognition

The productivity of livestock farming depends on the welfare of the livestock. This can be achieved by physically and constantly monitoring their behaviors and activities by human experts. However, the degree of having high accuracy and consistency with manual monitoring in a commercial farm is herculean, and in most cases impractical. Hence, there is a need for a method that can overcome the challenges. Proposed in this paper, therefore, is the cow detection and monitoring method using computer vision techniques. The proposed method is capable of tracking and identifying cow objects in video experiments, thereby actualizing precision livestock farming. The method generates reasonable results when compared to other methods.


Introduction
Livestock monitoring is a herculean task especially when it involves physical and manual monitoring of their welfare in a commercial farm [1]. Human experts are mostly trained to diagnose and detect the welfare challenges of livestock using their physical appearance [2]. However, the limitations in labor and time prevent the human experts from having high accuracy and consistency in the monitoring of the livestock [3]. Consequently, there is a rising demand for substituting computer vision techniques for human experts [4]. Without a doubt, the application of techniques involving video analytics has cut across different domains including animal husbandry, and this is made possible through series of vision and image processing algorithms making animal biometrics an emerging research area among researchers [5]. The feasibility of developing a system for detecting and locating individual cow objects can be made possible using computer vision techniques [6]. In performing the tasks involved in this paper, the particle filter (PF) algorithm [7] was enhanced (PF tm ) and combined with mean-shift [8] (MPF tm ). While PF tm involves the incorporation of temporary memory (tm) to store the former location of the cow and predict the next likely location using the former location that was stored, MPF tm on the other hand adds to the tracking accuracy using its capable algorithm to detect and provide necessary information about the movement sensitivity of the object.

Related works
Recently, research in visual object monitoring has greatly been accepted by the community of computer vision. Monitoring visual objects is still a difficult task to accomplish despite the discovery that has led to the development and implementation of several visual object algorithms for object monitoring. Variation in illumination, instability in object posture, and similarity in color of objects and their environment are several factors that could affect the successful implementation of object tracking and monitoring. Zhang et al. [9] categorized the methods employ in monitoring visual objects into probabilistic methods and deterministic methods where mean-shift is frequently used as one of the deterministic methods [10,11]. In this paper, mean-shift, and the algorithms of particle filter and Kalman filter were studied for individual cow tracking and detection. This is to enable the possibility of health and performance monitoring of individual cows, especially when in the ranch or on an official test [12].

Mean-shift
Mean-shift, for its robustness against partial occlusion, is the most widely accepted and employed method for virtual object tracking and monitoring from among the several deterministic methods. Moreover, being effective during computation without wasting time, effort or expense makes the meanshift algorithm suitable for implementing real-time tracking and monitoring of objects. However, the possibility of tracking full occluded and fast-moving objects with mean-shift is minimal.

Kalman filter algorithm
To the highest degree, the Kalman filter [13,14] represents one of the probabilistic methods applied in visual object tracking. The development and implementation of the Kalman filter using a robust algorithm enable easy prediction of the location of any linearly moving and occluded object during tracking task in a real-time scenario, making the method appropriate for linear system estimation [15]. Nonetheless, the application of the Kalman filter is not a perfect method when it involves the tracking of a non-linear moving object. The non-linear movement [16] of target objects in real-life scenarios due to changes in their trajectory is the major reason for the inability of the Kalman filter in tracking a nonlinear moving object.

Particle filter algorithm
Unlike the Kalman filter, the particle filter algorithm [17,18] is an effective and efficient probabilistic method of visual object tracking that can handle problems involving objects' non-linear movement [19]. However, its application is not appropriate for visual object tracking in a real-time environment because of the following: (1) it reduces tracking performance, (2) it involves massive computation, and (3) it involves a huge amount of particles as samples.

Materials and methods
The breed of cow employed in performing the experiment in this study is Muturu. Three analytic experiments were performed on the cow video dataset (50 frames) using both existing and proposed methods. Figure 1 shows the flowchart of the enhanced object tracking method. The cow activity as analyzed at t-2 ( Figure 2) predicts the next possible location of the cow. Three time-frames at t, t-1, and t-2 were initialized. The coordinates were randomly assigned throughout the first three steps. The identification of the cow coordinates enables the estimation of the next movement and this is by allocating a higher weight to the cow at the upper right quadrant. By this, if the value of x at time t and t-1 shows any similarity, consideration for recalculation is given to the coordinate of t-2 for identification of the next potential location of the cow as shown in Figure 2.    % Apply morphological operations to remove noise and fill in holes. mask = imopen(mask, strel('rectangle', [3,3])); mask = imclose(mask, strel('rectangle', [15,15])); mask = imfill(mask, 'holes'); % Perform blob analysis to find connected components.
[~, centroids, bboxes] = obj.blobAnalyser.step(mask); End  Figures 4-6 show the cow's real-time tracking results. Figure 5 shows the qualitative comparison between the tracking results for non-linear motion of cow objects using PF and PF tm . PF tm shows improvement over the PF method in tracking the cow non-linear motion. Figure 6 shows the qualitative comparison between the tracking results for partial occlusion of cow objects using MPF and MPF tm . MPF tm shows improvement over the MPF method in tracking the partial occlusion. Figure 7 shows the 7th International Conference on Agricultural and Biological Sciences (ABS 2021) IOP Conf. Series: Earth and Environmental Science 858 (2021) 012008 IOP Publishing doi:10.1088/1755-1315/858/1/012008 6 qualitative comparison between the tracking results for full occlusion of cow objects using MPF and MPF tm . MPF tm shows substantial improvement over the MPF method in tracking full occlusion. The tm (temporary memory) is employed to predict the target object position using previously stored position especially when the results recorded for particle filter and mean-shift tracker are not convincing due to high concentration of particle distribution in them. Figure 8 shows tracking results based on center errors. The center errors for PF tm (dotted blue line) and MPF tm (red line) are less than the center errors for PF (dotted green slant line). These results imply that the particle filter algorithm has been successfully enhanced in PF tm and MPF tm as proposed methods for accomplishing the tracking task.     Table 1 shows the quantitative results of cow detection using the precision-recall method. MPF tm achieved 89% precision and 85% recall more than PF tm and PF, which achieved 85% precision and 82% recall, and 82% precision and 80% recall respectively. This result implies that both MPF tm and PF tm as proposed methods have higher detection accuracy more than the particle filter (PF) algorithm.

Conclusion
Tracking and detection of cow objects in video experiments have been presented in this paper. The experiment was performed by enhancing the particle filter algorithm (PF tm ) and combining it with the mean-shift tracker (MPF tm ). While PF tm involves the incorporation of temporary memory (tm) to store the former location of the cow and predict the next likely location using the former location that was stored, MPF tm on the other hand adds to the tracking accuracy using its capable algorithm to detect and provide necessary information about the movement sensitivity of the object. The MPF tm and PF tm showed fewer center errors than PF, and they also recorded precision accuracy of 89% and 85% respectively higher than PF that recorded 82% accuracy. Our future work includes segmentation of the detected cow objects for individual classification.