An automated approach for counting ants in densely populated images and gaining insight into ant foraging behavior

Verifying Detection Robustness Across Multiple Lab Setups
To verify the system's reliability extends beyond a single controlled environment, the model was validated across multiple distinct experimental setups, ranging from simple clean backgrounds (A01–A03) to complex arenas containing debris and various baiting structures (B01–B03). This figure illustrates the strong linear correlation (r2 >0.88 for most subsets) between manual and automated counts, demonstrating that the pipeline maintains high precision even when deployed in varying imaging conditions that mimic real-world behavioral studies.

Accurate Small Object Detection in Crowded Settings
Standard object detection models often fail to identify minute organisms in high-resolution images because the objects disappear during the feature map downsampling process. This figure visually demonstrates the transformative impact of SAHI in these dense scenarios: while inference on the full-scale image fails to detect the colony, the slicing-aided approach effectively divides the image into patches to 'zoom in', allowing the model to accurately localize and count hundreds of tiny ants that were previously undetectable.

Hyperparameter Tuning with SAHI
To achieve the best balance between detection accuracy and computational speed, the study investigated key SAHI hyperparameters, specifically the divider (which determines the cropping ratio/patch size) and the overlap ratio between patches. This figure presents heatmaps revealing that increasing the divider number significantly improves Mean Average Precision (up to 81.8%) by making small ants appear larger to the model, though this comes at the cost of increased inference time, guiding users to select the optimal settings for their hardware.



