A Gloucestershire farmer says he uses artificial intelligence to monitor the behaviour of his cows.