For many years now, one of the major issues in pig farming has been reducing injurious behaviours, such as fighting or tail-biting. By detecting these kinds of behaviour or, if possible, early warning signals of them, farmers can intervene very early on to reduce welfare problems.
An algorithm which analyses behaviour

In order to obtain automated techniques to monitor behaviour, INRA and the CEA developed sensors, inserted in ear tags, which contain a wireless accelerometer and observed pigs by video cameras. The data registered are analysed by artificial intelligence algorithms.
On a farm where animals are monitored, data are transmitted to a program which analyses them in real time. If two accelerometers go crazy at the same time, this no doubts indicates aggressive behaviour or a fight. The algorithm is still being developed but the results are encouraging since the software correctly identifies about 50% of fighting behaviours. Once finely tuned, this tool will enable the farmer, warned by SMS, to act rapidly.
Wednesday March 27, 2019/ INRA/ France.
http://www.rennes.inra.fr