## 2 Materials and Methods
### Drinking Behavior Detection  
To focus on detecting drinking behaviors, we designated a specific region of interest (ROI) along the \(x\)-axis, between pixels 1300 and 1400. Instead of using an average depth threshold, we quantified the proportion of pixels within this region that fell within a predefined disparity range of 16 to 20 (Algorithm 1), which corresponds to the depth of the drinking line. This method enabled the detection of chicken drinking behavior based on localized disparity concentration rather than simple depth comparison. Although the DAM was originally developed for general object detection and segmentation tasks, in our study, we utilized its pre-trained monocular depth estimation capability to generate depth maps. These maps were then analyzed using a designated region of interest (ROI) to detect drinking behavior through disparity changes [24]. ```
import cv2 import numpy as np # Load the image image_path = '/mnt/data/image.png' # Update with the path image = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) # Define the region of interest (ROI) x_start, x_end = 1300, 1400 roi = image[; x_start.x_end] min_depth, max_depth = 16, 20 average_depth = np.mean(roi) # Compare the pixel values in the ROI with the depth range within_depth_range = (roi >= min_depth) & (roi <= max_depth) proportion_within_range = np.sum(within_depth_range) / roi.size print(f\"Average depth in ROI: {average_depth}\")  print(f\"Proportion of pixels within the depth range: {proportion_within_range:.2f\"}

Figure 3: Pipeline for the deep anything model applied in poultry science for monitoring and analysis (S means strong perturbations). ### Optimized Route Distance Calculation

In this study, we propose an optimized route design to enhance the efficiency of egg collection using robotic systems with the K-means clustering algorithm. The optimization is based on egg depth detection and clustering techniques. Eggs are first grouped into clusters according to their proximity, using a pre-planned strategy. Within each cluster, the robot follows a sequential order to minimize travel distance [25]. Once all eggs in a cluster are collected, the robot moves to the next cluster in the most efficient sequence. The detailed algorithm is presented in Algorithm 2. ```
def calculate_optimized_route(cluster_routes):  full_route = [] total_distance = 0 route_details = [] # Collect eggs within clusters in a pre-determined order (cluster_routes) for cluster_num in cluster_routes.keys():  eggs_in_cluster = cluster_routes[cluster_num]  full_route.extend(eggs_in_cluster) # Calculate total distance for the optimized route for i in range(len(full_route) - 1):  dist = distance_matrix_eggs[full_route[i], full_route[i + 1]]  total_distance += dist  route_details.append((full_route[i], full_route[i + 1], dist)) return total_distance, full_route, route_details
```

**Algorithm 2** Optimized Egg Collection Routes Using Depth and Clustering Techniques

### Model Evaluation and Statistical Data Analysis

In the task of monocular depth estimation, the absence of stereoscopic information--such as geometric constraints from binocular or multi-view systems--limits the model to inferring only relative depth relationships from a single two-dimensional image. Consequently, the estimated depth is often scale-ambiguous, reflecting the relative depth between objects in the scene rather than the absolute depth consistent with real-world physical scales. Monocular depth estimation relies on features such as texture, shadow, and perspective for reasoning, but these elements only provide relative depth orderings without determining the actual distance between objects and the camera. To convert the model's estimated relative depth into physical depth values, a known reference scale is required. By comparing the estimated depth to ground truth data, a scale factor is calculated between the estimated and true depths. This scale factor is then applied to convert relative depth into actual depth, ensuring that the model's output corresponds to real-world physical distances.