Using sensor data patterns from an automatic milking system to develop predictive variables for classifying clinical mastitis and abnormal milk

A. Kamphuis, D. Pietersma, R. van der Tol, M. Wiedermann, H. Hogeveen

Research output: Contribution to journalArticleAcademicpeer-review

46 Citations (Scopus)


Dairy farmers using automatic milking are able to manage mastitis successfully with the help of mastitis attention lists. These attention lists are generated with mastitis detection models that make use of sensor data obtained throughout each quarter milking. The models tend to be limited to using the maximum or average value of the sensor data pattern, potentially excluding other valuable information. They often put cows on the lists unnecessarily, and their sensitivity for abnormal milk classification is too low for automated separation. Therefore, we analyzed sensor data patterns within quarter milkings in order to identify potentially predictive variables for abnormal milk and clinical mastitis classification. The data used in this study was obtained at a commercial dairy farm in Germany in September 2002, where a German Simmental herd was milked by a Lely Astronaut system. In total, 3232 quarter milkings from 63 cows were analysed; 94 quarter milkings were defined as milk with abnormal homogeneity and 270 as clinical mastitis. A data flow diagram was developed to systematically describe the steps involved in the transformation of within quarter milking measurements into variables that potentially predict abnormal milk and clinical mastitis. Three types of pattern descriptors were used: level, variability, and shape. In addition to using the absolute value of the pattern descriptor, the descriptors were considered relative to their expected value based on pattern descriptor values from previous milkings and from other quarters within the same cow milking. Using this method, potentially predictive variables were computed for electrical conductivity, the colours red, green and blue, a combination of colour sensors, and milk production. The importance of a variable in predicting abnormal milk and clinical mastitis was evaluated by computing correlation coefficients as well as information gain ratios. The most important variables came from the sensors for electrical conductivity, blue and green. Variables describing the variability and shape of the measurement patterns were as important as mean and maximum values, and should be included in future modelling. Also variables that are based on absolute values should be considered for future modelling. Results suggest that clinical mastitis and abnormal milk classification models may include similar predictive variables, but requirements for these models differ resulting in the need for different models. The schematic approach to developing potentially predictive variables will be helpful when exploring the usefulness of new sensors, researching other approaches to estimate expected values, and studying sensor data patterns in general.
Original languageEnglish
Pages (from-to)169-181
JournalComputers and Electronics in Agriculture
Issue number2
Publication statusPublished - 2008


  • electrical-conductivity
  • subclinical mastitis
  • foremilk


Dive into the research topics of 'Using sensor data patterns from an automatic milking system to develop predictive variables for classifying clinical mastitis and abnormal milk'. Together they form a unique fingerprint.

Cite this