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

Manual tallies of ant activity, often spanning tens of thousands of frames per experiment, are slow, error-prone, and rarely scalable. We introduce a hardware-agnostic computer-vision workflow that pairs state-of-the-art detectors (YOLOv11n/m and RT-DETR-L) with Slicing-Aided Hyper Inference (SAHI) to automate ant detection and counting in realistic laboratory and field imagery. The pipeline was evaluated across seven contrasting imaging setups through three key studies. First, we demonstrated that robust mean average precision (50.6-88.2%) can be achieved with as few as 64 annotated images across diverse backgrounds, while expanding the dataset to 1,024 images increases performance to 95.4%, establishing practical labor budgets for system deployment. Second, we showed that SAHI fine-tuning transforms dense-colony detection in scenes with over 1,200 ants per image from undetectable to highly functional, achieving 81% mean average precision. Third, we applied high-frequency counting to monitor a virus-challenged colony, revealing daily traffic patterns and inch-level movement hotspots that would be difficult to detect through manual observation. While RT-DETR-L delivers the highest overall accuracy, a YOLO variant that is 15 times smaller performs within a few percentage points and enables deployment on compact, energy-efficient edge devices like the Raspberry Pi. All models, images, and code are openly released, providing a turnkey framework that scales from petri-dish assays to distributed camera networks and is readily transferable to other small, densely packed organisms and behavior-rich systems (e.g., aphid colonies, social-bee foraging). By removing a long-standing counting bottleneck, the workflow enables large-scale behavioral ecology, pest-control optimization, and environmental surveillance at a fraction of previous labor costs. • Effective ant counting systems can be built cheaply with minimal manual effort. • Breaking images into smaller patches dramatically improves counting in dense ant colonies. • Automated counting reveals long-term foraging patterns that are difficult to capture through manual observation.

Authors

Institutions

Publication Details

Journal
Ecological Informatics
Published
2025-08-28
DOI
https://doi.org/10.1016/j.ecoinf.2025.103391
Primary Topic
Insect and Arachnid Ecology and Behavior
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Chin‐Cheng Scotty Yang, Chunpeng James Chen, Mautushi Das, F. H. Liu et al.
Ecological Informatics
Insect and Arachnid Ecology and Behavior
article

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

Chin‐Cheng Scotty Yang, Chunpeng James Chen, Mautushi Das, F. H. Liu, Charly Hartle
article en

Abstract

Manual tallies of ant activity, often spanning tens of thousands of frames per experiment, are slow, error-prone, and rarely scalable. We introduce a hardware-agnostic computer-vision workflow that pairs state-of-the-art detectors (YOLOv11n/m and RT-DETR-L) with Slicing-Aided Hyper Inference (SAHI) to automate ant detection and counting in realistic laboratory and field imagery. The pipeline was evaluated across seven contrasting imaging setups through three key studies. First, we demonstrated that robust mean average precision (50.6-88.2%) can be achieved with as few as 64 annotated images across diverse backgrounds, while expanding the dataset to 1,024 images increases performance to 95.4%, establishing practical labor budgets for system deployment. Second, we showed that SAHI fine-tuning transforms dense-colony detection in scenes with over 1,200 ants per image from undetectable to highly functional, achieving 81% mean average precision. Third, we applied high-frequency counting to monitor a virus-challenged colony, revealing daily traffic patterns and inch-level movement hotspots that would be difficult to detect through manual observation. While RT-DETR-L delivers the highest overall accuracy, a YOLO variant that is 15 times smaller performs within a few percentage points and enables deployment on compact, energy-efficient edge devices like the Raspberry Pi. All models, images, and code are openly released, providing a turnkey framework that scales from petri-dish assays to distributed camera networks and is readily transferable to other small, densely packed organisms and behavior-rich systems (e.g., aphid colonies, social-bee foraging). By removing a long-standing counting bottleneck, the workflow enables large-scale behavioral ecology, pest-control optimization, and environmental surveillance at a fraction of previous labor costs. • Effective ant counting systems can be built cheaply with minimal manual effort. • Breaking images into smaller patches dramatically improves counting in dense ant colonies. • Automated counting reveals long-term foraging patterns that are difficult to capture through manual observation.

Ecological InformaticsVol. 91
Virginia Tech (US)
U.S. Department of Agriculture, College of Agriculture and Life Sciences, Virginia Polytechnic Institute and State University
Openalex Percentile: Top 75%
Insect and Arachnid Ecology and Behavior
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.