AI livestock counting: how accurate is it for cattle and sheep?
AI livestock counting works well in research trials, but it is not perfect and the conditions matter. On drone video frames from a farm in Armidale, Australia, a deep learning system reported counting accuracy of 94.7% for cattle and 97.3% for sheep (Xu et al. 2020b), and another study by the same group reported 94% for cattle on pastures and 92% in feedlots (Xu et al. 2020a). The same research shows where it goes wrong: animals bunched together, calves hidden against cows, stock that move between photos, and paddocks the program has never seen (Barbedo et al. 2020; Shao et al. 2020).
What is AI livestock counting?
AI livestock counting uses computer vision, which means software that reads photos or video, to find and count animals. Most systems use deep learning: a program called a neural network is shown many photos where people have marked every animal, and it learns what a cow or a sheep looks like from above or from the side.
There are two main ways to turn that into a number. Count by detection draws a box or outline around each animal and adds them up. Count by regression estimates the number straight from the picture, for example by predicting a "density map" of the image (Shao et al. 2020; Liu 2023). When several overlapping photos or video frames are used, the software also has to recognise an animal it has already seen, so it is not counted twice.
How accurate is AI at counting cattle?
The table shows what peer-reviewed studies report, in the papers' own measures. They are not directly comparable: each used different animals, cameras, heights and scoring rules.
| Study | Animals and images | Reported result | Conditions to note |
|---|---|---|---|
| Xu et al. 2020b | Cattle and sheep, drone video, Armidale, Australia | Counting accuracy 94.7% cattle, 97.3% sheep | 200 test images cropped to 512 by 512 pixels; single images mostly 50% to 100% |
| Xu et al. 2020a | Cattle, quadcopter images | 94% on pastures, 92% in feedlots | Described as an offline quadcopter vision system |
| Barbedo et al. 2020 | Nelore and Canchim cattle, drone photos, Brazil | 935 estimated against 989 actual over 12 dates | Biggest miss on a date with several young calves |
| Shao et al. 2020 | Cattle, drone photos, Japan | Within 3 head for dozens of cattle | Only when cattle moved less than a body length |
| Ocholla et al. 2024 | Cattle, 10 cm aerial images, Kenya | Best counting model: root mean square error 1.3, R2 0.98 | Shrubs, shadows and coarser images reduced detection |
| Torrusio et al. 2024 | Cows, very high resolution satellite images, Argentina | Average count error of plus or minus four cows | Described as preliminary results |
In Brazil, the whole-paddock estimates came to about 94.5% of the true total by our arithmetic (Barbedo et al. 2020). For how these numbers look from the air, and the flying rules, see our guide to counting cattle with drones.
Can AI count sheep?
Yes, and in the Armidale study sheep were counted more accurately than cattle. The authors put this down to "the complexity of the environment for cattle and various postures of cattle", which made them harder to tell apart from trees and rocks (Xu et al. 2020b).
Other sheep studies point the same way, with caveats. A 2021 study on detecting sheep in drone images combined two networks and raised recall, the share of real animals found, "from 90% to 98%" (Sarwar et al. 2021). A density map method tested on 190 drone images of sheep reported "an average counting accuracy of 91.02%". The same paper warns that for dense flocks with sheep hiding each other, existing methods "cannot meet the needs of practical applications" (Liu 2023). Another approach looks only for sheep heads and pairs the detector with a tracking program for counting; it reported 96.11% average detection accuracy for heads, but no head-count error figure was given in the abstract (Wang et al. 2023).
Sheep are harder from the air in one way: they are small. A 2026 study notes that sheep in wide drone images are "small, densely distributed, closely spaced, and easily confused with similar background textures", which causes missed animals, false alarms on background and duplicate detections (Huang et al. 2026). Our guide to how to count sheep covers the gate and race methods that still work best for a full tally.
Why does AI miss or double count animals?
The failure cases repeat across studies. Knowing them helps you judge any AI livestock counter.
| Problem | What the research found |
|---|---|
| Animals touching or overlapping (occlusion) | Errors rose as clusters grew; calves touching other animals often went undetected (Barbedo et al. 2020). Dense flocks defeat many methods (Liu 2023). |
| Crowded frames | Most errors came with 10 or more animals in view; with fewer than 10, accuracy rose to 98.78% (Rivas et al. 2018). |
| Animals moving between photos | Some counts reached about 1.5 times the true number (Shao et al. 2020). |
| Look-alike background | Shrubs and shadows hurt detection (Ocholla et al. 2024); glary bare soil and yellowish cattle on dry pasture caused errors (Barbedo et al. 2020). |
| Fences, brightness and colour shifts | Named as common problems when counting cattle in ranch images (Li, Fang and Zhao 2024). |
| New paddock, season or breed | Detection score fell from 0.952 to 0.713 on a new area (Shao et al. 2020); other breeds would probably need new training (Barbedo et al. 2019). |
Occlusion: when animals hide each other
Occlusion means part of an animal is blocked from view, usually by another animal, a tree or a fence. In Brazil, the worst single-photo error was 20 head short, in a photo with several calves that "tend to remain undetected when touching other animals due to their comparatively small size" (Barbedo et al. 2020). The authors also found that changes in body position made size-based rules fail inside clusters, and called this "the main cause of the misestimates" (Barbedo et al. 2020).
Dense herds are not always worse
One surprising result: in the Armidale study, images with many animals scored higher percentage accuracy than sparse ones. Missed animals did rise with density, but each mistake was a smaller share of a bigger total (Xu et al. 2020b). So a percentage on its own can hide a real number of missing head.
Is a high accuracy score the same as an accurate count?
No. Papers often report precision (how many of the things it called animals were animals) and recall (how many real animals it found). Those describe detection, not the final tally.
The Kenyan study shows the gap. Its YOLOv8m model had the best detection score, with precision of 91.0% and recall of 83.4%, yet "had the highest counting error of -8%". A slightly lower scoring model, YOLOv5m, gave "the most accurate cattle count". The authors conclude that "a model with high AP0.5-0.95 detection accuracy may struggle with counting cattle accurately" (Ocholla et al. 2024). AP, or average precision, is a common detection score.
Single photos also vary a lot. In the Armidale study, the overall counting figures were above 94%, but for individual test images counting accuracy was "mainly between 50% and 100%" (Xu et al. 2020b). When a product quotes one accuracy figure, ask what it was measured on, how many animals were in each photo, and whether those photos looked like your paddocks.
Can satellites count livestock?
Researchers are trying. In Argentina, a project set up to meet a need of SENASA, the national body responsible for plant and animal health, trained a deep learning model on about 320 very high resolution satellite scenes with around 8,000 labels, and reported an average count error of plus or minus four cows in preliminary results (Torrusio et al. 2024). The Kenyan team suggested its aerial models could be scaled up to satellite images "for conducting cattle censuses over large areas" (Ocholla et al. 2024).
Closer to the ground, ranch images bring their own problems. A 2024 study names cattle hidden by fences, colour shifts and very bright images as common issues (Li, Fang and Zhao 2024). That study reported 98.8% accuracy and 99.0% recall for detection, but those are detection measures, not a herd count.
What should a farmer expect from an AI livestock counter?
Expect a good estimate when animals are spread out, still, clearly visible and in conditions like the ones the software learned from. Expect errors with tight mobs, young stock tucked against their mothers, animals walking between photos, heavy shade or scrub, and unfamiliar country. No study above claims a count that is always exact.
That is why a range around the count is more honest than a single number. Count My Herd is a phone app that counts cattle, sheep, horses or goats in a few paddock photos, puts a dot on every animal it found and gives a range, for example "47, likely 44 to 50". In our first check, 9 small groups of animals (1 to 7 head, one photo each) were all counted exactly. Big mobs and sweeps of several photos have not been tested yet, and it is an estimate, not a count through the race. For an exact tally, a race or gate count is still the standard, as explained in how to count cattle.
Common questions
How accurate is AI livestock counting?
In research trials it is good but not exact. A study on an Armidale farm reported counting accuracy of 94.7% for cattle and 97.3% for sheep, and another reported 94% on pastures and 92% in feedlots. Single photos varied much more, with accuracy mainly between 50% and 100% in the Armidale study.
Can AI count sheep?
Yes. In the Armidale study sheep were counted more accurately than cattle. A density map method on 190 drone images reported 91.02% average counting accuracy, but its author warns that existing methods for dense flocks, where sheep hide each other, cannot meet the needs of practical use.
Why does AI miss animals when counting?
Mostly because animals hide each other. Calves were detected 99% of the time alone but counted properly only 71% of the time in clusters in a Brazilian study. Moving stock, shrubs, shadows, glare on bare soil, fences and unfamiliar paddocks also cause missed animals or double counts.
Is there an app that counts livestock?
Count My Herd is a phone app that counts cattle, sheep, horses or goats in a few paddock photos and gives a range around the count. In our first check, 9 small groups of animals (1 to 7 head, one photo each) were all counted exactly. Big mobs and sweeps of several photos have not been tested yet.
Can satellites count cattle?
Researchers are testing it. A project in Argentina trained a deep learning model on about 320 very high resolution satellite scenes and reported an average count error of plus or minus four cows in preliminary results. A Kenyan team suggested aerial models could be scaled up to satellite images for large-area cattle censuses.
References
- Barbedo, J.G.A., Koenigkan, L.V., Santos, P.M. and Ribeiro, A.R.B. (2020) 'Counting cattle in UAV images: dealing with clustered animals and animal/background contrast changes', Sensors, 20(7), 2126. Available at: https://doi.org/10.3390/s20072126 (Accessed: 17 October 2026).
- Barbedo, J.G.A., Koenigkan, L.V., Santos, T.T. and Santos, P.M. (2019) 'A study on the detection of cattle in UAV images using deep learning', Sensors, 19(24), 5436. Available at: https://doi.org/10.3390/s19245436 (Accessed: 17 October 2026).
- Huang, S., Lv, J., Wang, B. and Shen, B. (2026) 'DAFS-YOLO: dense-aware feature enhancement for UAV-based grassland livestock detection in dense sheep scenes', AgriEngineering, 8(9), 363. Available at: https://doi.org/10.3390/agriengineering8090363 (Accessed: 17 October 2026).
- Li, B., Fang, J. and Zhao, Y. (2024) 'An algorithm for cattle counting in rangeland based on multi-scale perception and image association', IET Image Processing, 18(13), pp. 4151 to 4167. Available at: https://doi.org/10.1049/ipr2.13240 (Accessed: 17 October 2026).
- Liu, Q. (2023) 'Few-shot sheep counting based on density map regression', Journal of Physics: Conference Series, 2646(1), 012019. Available at: https://doi.org/10.1088/1742-6596/2646/1/012019 (Accessed: 17 October 2026).
- Ocholla, I.A., Pellikka, P., Karanja, F., Vuorinne, I., Väisänen, T., Boitt, M. and Heiskanen, J. (2024) 'Livestock detection and counting in Kenyan rangelands using aerial imagery and deep learning techniques', Remote Sensing, 16(16), 2929. Available at: https://doi.org/10.3390/rs16162929 (Accessed: 17 October 2026).
- Rivas, A., Chamoso, P., González-Briones, A. and Corchado, J.M. (2018) 'Detection of cattle using drones and convolutional neural networks', Sensors, 18(7), 2048. Available at: https://doi.org/10.3390/s18072048 (Accessed: 17 October 2026).
- Sarwar, F., Griffin, A., Rehman, S.U. and Pasang, T. (2021) 'Detecting sheep in UAV images', Computers and Electronics in Agriculture, 187, 106219. Available at: https://doi.org/10.1016/j.compag.2021.106219 (Accessed: 17 October 2026).
- Shao, W., Kawakami, R., Yoshihashi, R., You, S., Kawase, H. and Naemura, T. (2020) 'Cattle detection and counting in UAV images based on convolutional neural networks', International Journal of Remote Sensing, 41(1), pp. 31 to 52. Available at: https://doi.org/10.1080/01431161.2019.1624858 (Accessed: 17 October 2026).
- Torrusio, S., Gonzalez, J., Errázquin, M., Cereceda, A., Cassano, M.J., Morales, N. and Saucedo, R. (2024) 'Counting cattle in Argentina with AI and satellite images', The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, XLVIII-4-2024, pp. 459 to 464. Available at: https://doi.org/10.5194/isprs-archives-xlviii-4-2024-459-2024 (Accessed: 17 October 2026).
- Wang, L., Hu, B., Hou, Y. and Wu, H. (2023) 'Lightweight sheep head detection and dynamic counting method based on neural network', Animals, 13(22), 3459. Available at: https://doi.org/10.3390/ani13223459 (Accessed: 17 October 2026).
- Xu, B., Wang, W., Falzon, G., Kwan, P., Guo, L., Chen, G., Tait, A. and Schneider, D. (2020a) 'Automated cattle counting using Mask R-CNN in quadcopter vision system', Computers and Electronics in Agriculture, 171, 105300. Available at: https://doi.org/10.1016/j.compag.2020.105300 (Accessed: 17 October 2026).
- Xu, B., Wang, W., Falzon, G., Kwan, P., Guo, L., Sun, Z. and Li, C. (2020b) 'Livestock classification and counting in quadcopter aerial images using Mask R-CNN', International Journal of Remote Sensing, 41(21), pp. 8121 to 8142. Available at: https://doi.org/10.1080/01431161.2020.1734245 (Accessed: 17 October 2026).