## 2 Materials and Methods
### Drinking Behavior Detection
This is because its camera is positioned above the drinking line, allowing for a wider field of view to monitor chickens while drinking. However, a potential concern is that the presence of the robot may disrupt the chickens' normal behavior. Therefore, adapting the robot to minimize its impact on the chickens' environment is essential. Overall, the application of DAM proved effective in automating the detection of drinking behavior in chickens with minimal errors, offering a practical and scalable solution for precision livestock farming. ### Evaluation of Applying DAM to Determine the Short Distance for Egg Collector Robotics

Mislaid eggs in cage-free houses are a common issue. While certain breeds of hens may have better habits for laying eggs in nesting boxes, the management of floor eggs remains an important area of exploration [38]. Egg collector robotics are at the forefront of solving this problem [39]. However, conventional egg collector robots typically collect eggs one by one, using computer vision to detect them. This method is efficient when the eggs are relatively dispersed across the poultry house. In real-world scenarios, however, hens tend to lay eggs in several concentrated areas, such as under feeders or in dark corners. When eggs are aggregated in these locations, the one-by-one collection strategy may become time-consuming. Through the utilization of depth estimation technology, it is possible to calculate the distance of each egg from the robotic collector and predict an optimal route. This approach allows for a more efficient collection process, minimizing time spent on retrieving eggs and improving overall productivity. In our research farm, chickens tended to lay eggs under the exhaust fan, so we detected the eggs' disparities (0.5053, 0.5025, 0.5578, 0.5468, 0.5605, 0.6178, 0.6607, 0.6363, 0.7604, 0.7509, 0.9251) through DAM (Figure 6). The first step in optimizing the robot's egg collection route involves grouping the eggs based on their depth disparities, which represent the relative distance between the eggs and the robot. To achieve this, the K-means clustering algorithm was applied to the disparity values [40]. This method allows for the identification of clusters of eggs that are spatially closer to one another, reducing the robot's travel distance within each group. The clustering process resulted in three distinct clusters, as shown in Figure 7, with each cluster representing a group of eggs located in proximity based on their depth measurements. Once the eggs were grouped into clusters, the next step was to determine the most efficient collection sequence within each cluster. For each group, the disparities were sorted in ascending order, allowing the robot to begin with the closest egg and proceed sequentially within the cluster. This approach ensures that the robot minimizes travel time and energy consumption when operating within each cluster, as it collects eggs with disparities ranging from 0.6 to 0.76 in Cluster 1, disparities ranging from 0.5 to 0.64 in Cluster 2, and the single egg with a disparity of 0.9251 in Cluster 3. After establishing the collection order within each cluster, the full collection route was designed. The robot starts with the cluster closest to its starting position (Cluster 2) and collects eggs in the optimal sequence within this group. Aftercompleting the collection in Cluster 2, which includes eggs at indices [1, 0, 3, 2, 4, 5, 7], the robot proceeds to Cluster 1, repeating the same process of collecting eggs based on their proximity, which includes eggs at indices [6, 9, 8]. Finally, the robot moves to Cluster 3, which contains the farthest egg at index [10], and completes the collection process. The robot was controlled via the official Unitree Go1 app and pre-programmed to follow a fixed inspection route covering all sections of the farm. Compared to the traditional one-by-one route, the cluster-based strategy reduces motion time by 11% by allowing the robot to visit only the centroid of each cluster, minimizing redundant travel.