You've heard of algorithms, but how about a herd farmed by 'cowgorithms'?
Kiwi agri-tech company Halter has created electronic collars that use sound and vibration to guide and contain individual cows without the need for fences.
The cowgorithm learns the animal's behaviour and translates the human intentions into signals it can understand. Halter has about 60 employees - and a new $32 million investment will allow for expansion by another 115.
Halter's founder and CEO Craig Piggott dreamed up the idea while he was working as a mechanical engineer for Peter Beck at Rocket Lab.
Piggott grew up on dairy farms around south Waikato and loved the life.
"For as long as I can remember myself and my sister were involved in the farm, that was everything we did really."
Ultimately though, he left the family farm to study mechanical engineering in Tāmaki Makaurau.
In 2016, he joined Rocket Lab. "Still at that point that everyone thought they were relatively crazy."
But Piggott says that was one of the lessons - from the outside it may have looked crazy but everyone was very driven.
"[I was] fortunate enough to work directly for Peter Beck. I kind of turned up on day one and was expecting to be put in a team and it just didn't really happen, and I didn't fully appreciate it at the time until kind of going through the months there and realise that I was getting some pretty good access to an incredible mind."
Any farmer knows you have no problem with working hard if that's what needs to happen, he says.
"I guess what I learnt at Rocket Lab was the power of a highly crafted very ambitious team trying to reach a very ambitious goal and how contagious that is and how powerful it is."
Halter was a side project, something Piggott started doing in the weekend. "It just never stopped."
He says if you look at a farm from a high level, almost everything is there to manage the cow, or the herd.
The animal is central to a farm and if you want to improve things that's where you should start, he says.
One of the first things he came to was that a device needed to be put on the cow, he says, one that was consistent and repeatable.
"The was the start to something everyone refers to as virtual fencing and the ability to shift cows and that's based on Pavlovian conditioning, that's training a cow to respond to a cue."
Piggott says it's something that already happens on a farm, with a dog barking for example, it's just that this cue is made through software.
Forward movement and direction are the focus of the cowgorithm. Both use sound cues but how they are used is different for every animal.
"It's definitely a taught behaviour, so there's a training phase when it comes to rolling out the system. That's something the collar mostly manages itself but every time we deploy onto a farm we have customer success people to help set up the system and help train those cows."
Most cows learn within a day or two and a herd tends to be trained within a week.
Pulse is used in the training phase, to recondition the visual fence through to the audio cue.
"Once the cow is trained, understands the system, the system relies on sound and vibration to give those directional cues."
Collecting upwards of 1000 data points per minute from each cow, Halter can build a baseline of the behaviour and personalities of cows. By nature, cows hide any form of discomfort or injury until it's bad enough that they can't but with the technology, Piggett says they're able to pick up these things very early and flag them to the farmer.
From very early on Halter has worked with an ethics committee, he says.
"The core principle is if the cow's not happier and healthier we're not really achieving much."