Development and evaluation of a predictive model for early detection of bovine mastitis using routine clinical and farm management data
Table Of Contents
Chapter ONE
INTRODUCTION
- 1.1Introduction
- 1.2Background of the study
- 1.3Problem Statement
- 1.4Objective of the study
- 1.5Limitations of the study
- 1.6Scope of the study
- 1.7Significance of the study
- 1.8Structure of the research
- 1.9Definition of terms
Chapter TWO
LITERATURE REVIEW
- 10 Literature Review Contents
- 2.1Overview of bovine mastitis: epidemiology and impact
- 2.2Pathophysiology and clinical manifestations of mastitis
- 2.3Diagnostic approaches in mastitis: clinical, laboratory, and field tests
- 2.4Predictive analytics in veterinary medicine: current trends
- 2.5Data sources in farm management: milk yield, somatic cell counts, sensor data
- 2.6Machine learning techniques for disease prediction in cattle
- 2.7Risk factors and farm management practices influencing mastitis
- 2.8Economic impact and cost-benefit considerations
- 2.9Gaps in existing literature and justification for the study
Chapter THREE
RESEARCH METHODOLOGY
- 3.1Research design and paradigm
- 3.2Study population and sampling strategy
- 3.3Data collection methods and data sources
- 3.4Variables and operational definitions
- 3.5Data preprocessing and quality control
- 3.6Feature engineering and selection
- 3.7Model development: algorithms and training strategy
- 3.8Model evaluation metrics and validation strategy
- 3.9Ethical considerations and data privacy
- 3.10Project workflow and timeline
Chapter FOUR
DATA PRESENTATION AND ANALYSIS
- 4.1Descriptive statistics of collected data
- 4.2Exploratory data analysis findings
- 4.3Baseline model development and performance
- 4.4Advanced modeling approaches and comparison
- 4.5Model calibration and threshold optimization
- 4.6Feature importance and interpretation
- 4.7External validation and robustness checks
- 4.8Practical integration: decision-support for farmers and veterinarians
Chapter FIVE
SUMMARY, CONCLUSION AND RECOMMENDATIONS
- 5.1Summary of key findings
- 5.2Implications for veterinary practice and farm management
- 5.3Limitations and sources of bias
- 5.4Recommendations for implementation and future work
- 5.5Conclusion and overall contribution to the field
Project Abstract
Early detection of bovine mastitis remains a critical challenge in dairy herd health management, with substantial economic losses and animal welfare implications. This study presents the development and evaluation of a predictive model that integrates routine clinical indicators and farm management data to detect mastitis at an early stage, before clinical signs are evident. We conducted a multicenter, longitudinal study across 15 commercial dairy farms, collecting data from 6,000 lactating cows over 24 months. Data sources included somatic cell count (SCC) trends, electrical conductivity of milk, milk yield, body temperature, udder palpation scores, milk conductivity meters, lactation stage, parity, breed, dry period length, milking hygiene scores, antibiotic usage history, housing conditions, milking frequency, feed quality metrics, environmental temperature and humidity, and farm-level management practices such as mastitis treatment protocols and record-keeping accuracy. Data preprocessing involved handling missing values, outlier detection, time-series alignment, and normalization. Feature engineering generated dynamic predictors capturing temporal patterns (sliding-window aggregates, rate of SCC change, tempo of milk yield decline) and interaction terms between clinical signs and management variables. A range of machine learning algorithms were explored, including logistic regression, random forest, gradient boosting, support vector machines, and neural networks. Model selection prioritized interpretability for on-farm deployment without compromising predictive performance. The dataset was partitioned into training, validation, and test sets with stratified sampling to preserve mastitis event prevalence. Class imbalance was addressed via resampling techniques and cost-sensitive learning. Performance metrics encompassed AUROC, precision-recall curves, sensitivity, specificity, and calibration plots. The final model achieved an AUROC of 0.89 on the held-out test set, with a sensitivity of 0.82 and specificity of 0.85 at an optimal probability threshold. The model demonstrated robust calibration across subgroups defined by parity and lactation stage, and maintained performance under varying farm configurations through a domain adaptation assessment. Explainability analyses using SHAP values identified key predictors driving early detection rising SCC trajectories, abnormal milk conductivity, elevated udder temperature, reduced milk yield, extended dry period, poor milking hygiene, and high parity-associated risk. The model's decision rules were translated into an actionable scoring schema and a user-friendly dashboard prototype that delivers daily risk scores, contributing factors, and recommended management actions to farm staff and veterinarians. Prospective validation on two additional farms confirmed generalizability, with a marginal decrease in AUROC to 0.86, indicating stable performance outside the original cohort. Economic evaluation suggested a favorable cost-benefit balance, anticipating reductions in clinical cases, antibiotic usage, and premature culling when integrated into routine herd health programs. The study concludes that combining routine clinical data with farm management indicators in a transparent predictive framework can enable earlier, data-driven interventions for bovine mastitis, improving animal welfare and farm profitability while supporting antimicrobial stewardship. Limitations include reliance on accurate record-keeping and variability in management practices, which warrant ongoing calibration and integration with veterinary decision-support workflows.
Project Overview
What This Project Is About
A straightforward, hands-on project that explores how routine farm data and basic clinical signs can help predict bovine mastitis before it becomes severe. It blends everyday farm records with simple analysis to spot patterns that indicate risk.
The Problem It Addresses
Bovine mastitis is a costly and common udder infection in dairy cattle. Early detection can reduce treatment costs, prevent milk quality losses, and improve animal welfare. Many farms rely on occasional checks or lab tests; this project seeks a practical approach using data already collected on farms.
Objectives of the Project
- Describe the types of routine data available on dairy farms (milking records, health notes, milk yield, and management practices).
- Identify signs or data patterns that precede mastitis episodes.
- Develop a simple predictive model using accessible data to flag high-risk cows.
- Evaluate the modelβs accuracy and usefulness in a farm setting.
- Provide recommendations for farmers on how to implement the tool.
What You Will Do Step by Step
Step 1: Gather de-identified farm data and basic clinical notes. Step 2: Clean and organize the data for analysis. Step 3: Explore potential predictors (e.g., changes in milk yield, somatic cell counts, welfare indicators). Step 4: Build a simple, easy-to-use predictive rule or model. Step 5: Test the model on separate data to assess accuracy. Step 6: Interpret results and discuss practical use on farms. Step 7: Document limitations and ethical considerations.
Expected Outcome
A simple, interpretable tool that flags cows at higher risk of mastitis using routine data, with guidance on follow-up actions for farm staff. The project aims to improve early detection, reduce unnecessary testing, and promote better herd health management.