Related Experiment Video
Updated: Apr 23, 2026

08:51
Intraductal Injection of LPS as a Mouse Model of Mastitis: Signaling Visualized via an NF-κB Reporter Transgenic
Published on: September 4, 2012
18.7K
An interpretable stacking model for early warning of mastitis in dairy cows
Haoyu Wang1, Shenghui Yang2, Yongjun Zheng1
1State Key Laboratory of Veterinary Public Health and Safety, Beijing 100193, China; College of Engineering, China Agricultural University, Beijing 100083, China.
Preventive Veterinary Medicine
|April 21, 2026
Summary
A new stacking model accurately predicts mastitis in dairy cows, improving early detection and management. This advanced system enhances animal health and dairy production through superior predictive performance.
Area of Science:
- Veterinary Medicine
- Machine Learning
- Animal Health
Background:
- Mastitis poses significant threats to dairy cow health and production.
- Existing early warning systems often lack comprehensive predictive power due to reliance on single models.
Purpose of the Study:
- To develop and evaluate a stacking prediction model for early mastitis detection in dairy cows.
- To improve predictive performance and model interpretability compared to individual models.
Main Methods:
- Constructed a balanced dataset using random under-sampling.
- Selected relevant features based on correlation and physiological relevance.
- Optimized hyperparameters for nine binary classification models and determined base learners via exhaustive search.
- Employed SHAP (SHapley Additive exPlanations) for model interpretability.
Main Results:
- The stacking model achieved high predictive performance: AUC of 0.9318, F1-score of 0.8547, accuracy of 0.8557, and recall of 0.8484.
- The stacking model outperformed individual base learners.
- SHAP analysis identified key features like early milk yield and electrical conductivity, clarifying their impact on predictions.
Conclusions:
- The developed stacking model offers superior predictive performance for early mastitis detection.
- Integrating SHAP analysis enhances model transparency, aiding in understanding prediction drivers.
- This approach supports improved mastitis early warning and management decisions in dairy farming.

