Can sensor data collected by DeLaval VMS™ be used to forecast chronic mastitis cases?

There are different sensors available that measure mastitis indicators. These measures are typically used for the detection of (clinical) mastitis.

However, sensors can possibly be used after detection as well. After detection, the farmer needs to decide on the right intervention. In order to decide on how to intervene, the farmer may need to know whether the cow is currently expected to recover or stay chronic.

John Bonestroo, industrial PhD student at DeLaval, evaluated whether past sensor data of a specific mastitis-affected cow can be used to forecast the future disease status (i.e., whether the cow remains chronic).

The results of this study have been described in the fourth publication of the sensor-based mastitis management industrial PhD project. The project is a cooperation between DeLaval, Wageningen University, and Swedish University of Agricultural Sciences, which also included Ilka Klaas, Dairy Development Director at DeLaval, as John’s supervisor, among others.

Machine learning part of the method 

“We used sensor data from DeLaval VMS™ and OCC (online cell counter) for the past 30 or 15 days to forecast the future chronic status of a cow with a recently high OCC,” says John. “We transformed the sensor data before the prediction model to highlight specific characteristics in the sensor data and used it as input for the model. In the paper, chronic mastitis was defined as a cow which somatic cell counts did not return to healthy levels in the future.”

“We trained a machine learning model called gradient-boosting trees on this data and we compared the model to baselines that mimic current ways in which farmers may determine chronic mastitis based on somatic cell counts,” John explains.

The team used data from seven VMS farms to fit the model and used the data from seven other VMS farms to test the model and assess its performance.


The model significantly outperforms the baseline methods on most metrics when tested in several farms. This means that the algorithm that were developed automatically forecasts the outcome of a current mastitis case and could potentially select chronic cows earlier and better than farms currently do. In the future, these algorithms will allow farmers to get a prognosis on cows that are currently on the mastitis alert list.

“Furthermore, we expect even better performance by tweaking the model further or using deep learning techniques instead of gradient-boosting trees,” John concludes.