# Leveraging IGOOSE-XGBoost for the Early Detection of Subclinical Mastitis in Dairy Cows
## 5 Prediction Model for Subclinical Mastitis in Dairy Cows Based on IGOOSE-XGboost
### Data Processing  
The study was conducted at Gansu Nongken Tianmu Dairy Co., Ltd., located in Jinchang City, China. The farm utilized a free-stall housing system with mattress-bedded stalls. The cows were given a total mixed ration (TMR) twice a day, which included concentration, alfalfa hay, and corn silage. Milking was performed in an enclosed milking facility equipped with a large rotary milking parlor (72-80 stalls). The milking process followed a systematic routine where cows entered the rotary platform in sequence. The milking procedure included pre-milking teat sanitization (medicine bath), disinfection, cleaning, and milk inspection before cluster attachment. The milking clusters were automatically removed upon completion. Post-milking procedures included teat cleaning, sanitization, and disinfection to prevent infection. The fresh milk was immediately transferred to rapid cooling tanks and delivered to processing facilities to ensure milk quality. The herd consisted of pure Holstein cows. As shown in Table 3, the dataset comprised the DHI data of a total of 4154 cows on the farm in 2022. The data records included more than 20 indicators, such as individual number, parity, measurement date, milk yield, milk fat amount and so on. It was analyzed to form a test report reflecting the information of breeding, reproduction, feeding, disease, production performance of the farm, etc. The test report recorded the basic information of the dairy herd and the individual cows at the same time, which provided the raw data for the improvement of the herd and the monitoring of the health and nutritional level of the individual cows [25]. After eliminating irrelevant attributes, handling outliers, and imputing missing values in the DHI dataset, we obtained a final dataset comprising 3232 samples and 21 features. These features include Parity, Lactation Persistence, Days In Milk, Within-Herd Index (WHI), Milk Yield, Foreemilk yield, Milk Fat Percentage, Peak Milk Yield, Protein Percentage, Peak Lactation Day, Fat-to-Protein Ratio [26], 305-Day Milk Yield, Urea Nitrogen, Total Milk Volume, Milk Loss, Total Milk Fat, Economic Loss, Total Protein, Corrected Milk, Adult Equivalent, and Somatic Cell Score, as shown in Table 3. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**No.** & **Variable** & **Mean** & **Standard Deviation** \\ \hline x1 & Parity & 1.1 & 0.37 \\ x2 & Lactation Persistence & 101.38 & 10.39 \\ x3 & Days in milk & 138.86 & 64.90 \\ x4 & WHI & 99.98 & 26.33 \\ x5 & Milk yield & 1.16 & 0.16 \\ x6 & Fore milk yield & 11.41 & 2.49 \\ x7 & Milk Fat Percentage & 4.46 & 0.85 \\ x8 & Peak Milk Yield & 0.27 & 0.90 \\ x9 & Protein Percentage & 3.7376 & 0.3657 \\ x10 & Peak Lactation Day & 100.88 & 9.48 \\ x11 & Fat-to-Protein Ratio & 1.19 & 0.28 \\ x12 & 305-Day Milk Yield & 7696 & 1684 \\ x13 & Urea Nitrogen & 8.55 & 16.90 \\ x14 & Total Milk Volume & 33.37 & 6.69 \\ x15 & Milk Loss & 0.1789 & 0.6414 \\ x16 & Total Milk Fat & 7720.51 & 1666.25 \\ x17 & Economic Loss & 0.4915 & 0.7616 \\ x18 & Total Protein & 206.36 & 59.64 \\ x19 & Corrected Milk & 166.42 & 49.42 \\ x20 & Adult equivalents & 8828.01 & 1863.72 \\ x21 & SCS & 2.1 & 1.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Description of features. To predict subclinical mastitisti in dairy cows, the cows were classified into healthy and diseased groups based on somatic cell count (SCC). The international standard for judging the SCC of breast milk in cases of recessive mastitis ranges from 100,000 to 500,000/m, and in China, the current criterion for recessive breast infection is 200,000 to 500,000/mL [27]. To enhance the predictive accuracy of our model, this study adopted an SCC greater than 100,000 cells/mL as the criterion for diagnosing subclinical mastitisti. Somatic cell score (SCS), derived from SCC, exhibits a higher genetic correlation (0.6-0.8) with subclinical mastitisti in dairy cows and has a higher heritability compared to SCC [28].