## 4 Animal Tracking and Safety
### Animal Location Tracking  
The importance of tracking in combination with an identification task and counting the number of animals entering after grazing outside plays a crucial role in animal welfare, and improves husbandry techniques [62]. Animal behavior data can help with husbandry system optimization, resulting in more efficient and sustainable animal production and animal handling that is conducted correctly, which leads to better animal health and welfare [63]. Monitoring and recording individual animal behavior has now played an important role in providing high-quality research and effective farm management. Basic dairy cattle behavior often refers to feeding, standing, and laying activity, with groups exhibiting coordinated resting and activity patterns [63]. In animal husbandry, decreased resting behavior can be utilized to detect social stress. Dairy cattle that spend too much time lying down may be unwell, a dairy cow that has difficulty walking may be lame, and a dairy cow that spends too little time feeding may have difficulties with its mouth, teeth, or digestive system. There is growing interest in installing sensors and electrical systems to monitor animal activities and detect behavioral aberrations automatically. In several farms for animal supervision, direct observation and video monitoring are both time-consuming tasks [64]. In animal research, additional wearable sensors are added to record animal behavior. Tri-axial accelerometers, for example, are utilized to monitor lying time and heat events. Human inspectors have been replaced by computer vision-based systems that track animal movement using image segmentation and feature extraction from a single camera [65]. Few studies used dual cameras to examine cow standing and lying behavior based on the cow's position, with the resting area referring to lying and the feeding alley referring to standing  
Figure 4: Architecture of Real-time animal health tracking. Furthermore, simply employing the RGB camera in a barn with low illumination, a complicated background, and a dusty atmosphere can impair the performance of computer vision analysis [66]. The use of a computer vision system allows for the regular monitoring of animal behavior, and in order to maximize the contribution of each animal, the system must be able to identify and locate individual animals in the herd. Vision-based systems have difficulty identifying the location of cows; however, ML-based vision-based systems can help identify the location of cows, but they require additional infrastructure to monitor dairy animals in big areas such as barns [67]. So, in dairy farms, identifying technology such as passive radio-frequency identifications (RFIDs) are used to register food intake, and this technology has traditionally been utilised to determine the position and identity of animals in a barn. The drawback of this approach is that the antennae are sensitive to disruptions, and the system only indicates where the animals are in relation to an antenna. A real-time positioning system based on ultra-wideband (UWB) provides new potential for determining the position of animals in real-time with high precision [68]. An existing system (Ubisense, Cambridge, UK) determines the location of moving objects in a variety of situations, with the system's accuracy ranging between 30 and 100 cm [69]. Although these tests demonstrated the capability of tracking individual animals on-farm, the location information was derived using the barn's position along the \(x\)- and \(y\)-axes. However, without evaluating the cow's location along the \(z\)-axis, the system cannot determine whether the cow is lying or staying in the resting region. As a result, a sensor fusion back system capable of automatically detecting and reporting the standing and lying behaviors of individuals in larger barns would be extremely beneficial and in high demand [70].