AI Boosts Dairy Production and Improves Animal Welfare

When a cow is comfortable, she lies down more—and for every additional hour she rests, she produces an average of 1.5 liters more milk. But tracking how much each cow actually lies down in a day is both time-consuming and complex for farmers—especially when the average Danish dairy herd numbers over 300 freely moving cows.

VikingDanmark is a Danish association owned by cattle farmers, specializing in breeding and genetics for dairy cattle. As the largest and only remaining cattle breeding association in Denmark, a key focus area is providing owners with effective digital tools to run efficient operations.

Manual Monitoring Is Not Scalable

VikingDanmark offers video monitoring of barns as part of their efforts to improve operations and animal welfare. Until recently, analysis of cow behavior has relied on manually reviewing video footage—observing each cow individually at various times. Not only is this a time-consuming task, it’s also prone to subjective assessments and human error. With herds of over 300 cows roaming freely, it quickly became clear that this process couldn’t scale without automation. VikingDanmark needed a solution capable of continuously processing large amounts of data without compromising accuracy or decision-making quality.

If we humans can count how many cows are standing or lying down, a computer should be able to do it too. I compared it to how football analysts pull stats from video footage—we should be able to do the same in the barn.

Anne-Mette Søndergaard, Head of Digital Advisory, VikingDanmark

Partnering With Computas: From Idea to Tested Solution

VikingDanmark wanted to explore whether artificial intelligence (AI) could be used to automatically analyze video streams and generate reliable reports on cow behavior. To test the idea, they partnered with Computas to develop a proof of concept (PoC)—aimed at identifying the number of standing and lying cows with high precision in varying conditions.

To create a truly valuable AI solution, Computas’ product team visited the barn. We know that the best solutions are built when the whole team works on-site—close to the problem and the people facing it. By observing real-world conditions, the team gained deep insight into the farmer’s daily challenges, the most valuable data, how the cows move, how the video monitoring works in practice, and which needs are most critical to solve. All this ensured that the solution wouldn’t just work technically—it would actually deliver real value.

Produktteamet på besøk i fjøset.

How the AI Solution Performed

The Computas product team developed and tested two different AI models using video streams from existing cameras in the barns. The solution analyzes how many cows are standing or lying—at various times of day—and presents the data in a format that’s easy for farmers to use in their operations.

Both models performed strongly—with over 80% accuracy and reliable classification:

Model TypeDetection RateClassification (Stand/Lie)Overall Accuracy
Object Detection86%89%78%
Object Segmentation83%91%81%

The models were also assessed based on setup and maintenance costs. The PoC clearly demonstrated that AI is a far more efficient and precise alternative to manual counting—and gives farmers access to insights they otherwise wouldn’t have the capacity to extract.

Business Value: More Efficient Production With AI

Good animal welfare isn’t just ethically important—it’s directly tied to farm economics. Cows that lie down after eating produce 20% more milk. By using the AI model to track how much time cows actually spend lying down, farmers gain an objective basis for decisions that can boost production. This makes it possible to detect deviations early and take action that leads to more efficient operations and higher returns over time.

We considered several providers, but Computas stood out with their approach and expertise. The collaboration felt like a true partnership—their team showed genuine commitment and understanding of our challenges.

Anne-Mette Søndergaard, VikingDanmark

Next Step: Scalable AI for Global Use

The PoC gave VikingDanmark the confidence to move forward. The next phase involves testing in more barns, using larger datasets, and further developing the model for even greater precision. The goal is fully automated, accurate detection that identifies patterns, generates reports, and alerts farmers to issues. Additionally, data from multiple barns can be compared to identify best practices.

With over 500,000 cows in Denmark—and the number of farms expected to halve over the next ten years—the need for effective, data-driven solutions is greater than ever.

— We also see this technology being applicable in other markets like Germany, Finland, Italy, and the US, says Anne-Mette.

Technology Used

  • Google Cloud Vertex AI
  • Google Cloud
  • Python
  • NumPy
  • FastAPI
  • Docker

The tech stack was chosen for flexibility, scalability, and efficient model training—and can be adapted to different environments and needs.

Want to know more?

Please fill out our contact form