< Back to previous page


In-line detection of clinical mastitis by identifying clots in milk using images and a neural network approach

Book Contribution - Book Chapter Conference Contribution

Automated milking systems (AMS) already incorporate a variety of milk monitoring and sensing equipment, but the sensitivity, specificity and positive predictive value of clinical mastitis (CM) detection remain low. A typical symptom of CM is the presence of clot(s) in the milk during pre-milking. The objective of this study is the development and evaluation of a neural network (NN) that can detect these clot(s) on pictures of the filters of the milking system after the pre-milking phase. The data for this study was generated by adding debris and/or clot(s) from used milk filters of AMS to milk and passing this milk through a blue circular milk filter mounted in a PVC tube. A camera was mounted in the PVC pipe to take a photo after each pass of milk. In total 696 pictures were taken with clot(s), and 586 pictures without. These were randomly divided into a 60/20/20 training, validation, and testing datasets, respectively, for the training and validation of the NN. A convolutional NN with residual connections was trained and the hyperparameters were optimized based on the validation dataset using a genetic algorithm. The integrated gradients were calculated to explain the interpretation of the NN. The accuracy, specificity, and sensitivity of the NN on the testing dataset were 100%. The integrated gradients showed that the NN identified the clot(s). Further validation and integration on farm in AMS are necessary, but the proposed method is very promising for the inline detection of CM on AMS farms.
Book: 2nd United States Precision Livestock Farming Conference (USPLF 2023), Proceedings
Pages: 200 - 205
Publication year:2023