Next Article in Journal
Pedagogical Qualities of Artificial Intelligence-Assisted Teaching: An Exploratory Analysis of a Personal Tutor in a Voluntary Business Higher-Education Course
Previous Article in Journal
Effect of Sodium Sulfate Treatment on the Modulation of Aliphatic Glucosinolates in Eruca sativa Mill Organs at Flowering Stage
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Leveraging IGOOSE-XGBoost for the Early Detection of Subclinical Mastitis in Dairy Cows

College of Information Science and Technology, Gansu Agricultural University, Lanzhou 730070, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(15), 8763; https://doi.org/10.3390/app15158763
Submission received: 24 October 2024 / Revised: 30 November 2024 / Accepted: 2 January 2025 / Published: 7 August 2025

Abstract

Subclinical mastitis in dairy cows poses a significant challenge to the dairy industry, leading to reduced milk yield, altered milk composition, compromised animal health, and substantial economic losses for dairy farmers. A model based on the XGBoost algorithm, optimized with an Improved GOOSE Optimization Algorithm (IGOOSE), is presented in this work as an innovative approach for predicting subclinical mastitis in order to overcome these problems. The Dairy Herd Improvement (DHI) records of 4154 cows served as the model’s original foundation. A total of 3232 samples with 21 characteristics made up the final dataset, following extensive data cleaning and preprocessing. To overcome the shortcomings of the original GOOSE algorithm in intricate, high-dimensional problem spaces, three significant enhancements were made. First, an elite inverse strategy was implemented to improve population initialization, enhancing the algorithm’s balance between global exploration and local exploitation. Second, an adaptive nonlinear control factor was added to increase the algorithm’s stability and convergence speed. Lastly, a golden sine strategy was adopted to reduce the risk of premature convergence to suboptimal solutions. According to experimental results, the IGOOSE-XGBoost model works better than other models in predicting subclinical mastitis, especially when it comes to recognizing somatic cell scores, which are important markers of the illness. This study provides a strong predictive framework for managing the health of dairy cows, allowing for the prompt identification and treatment of subclinical mastitis, which enhances the efficiency and quality of milk supply.

1. Introduction

1.1. Background

With the quick advancement of contemporary animal husbandry, dairy farming has become one of the most important industries in the world. High-quality milk is of great significance to both human health and the economy of the dairy industry. In dairy farming, cows can develop various health conditions due to factors such as environmental conditions, feed quality, and exposure to pathogens. Common health issues include mastitis, pneumonia, and hoof inflammation [1]. One of the biggest issues facing dairy producers is mastitis, which not only affects milk production and composition, but also affects the health of dairy cows and causes huge economic losses [2]. In India alone, mastitis causes an economic loss of about 237 million rupees per year, of which subclinical mastitis accounts for about 70% [3]. According to Tekel [4], on average, 50% of cows in herds without a mastitis health control program have subclinical mastitis. Clinical mastitis is thought to be responsible for 20–30% of the economic losses related to mastitis, with subclinical mastitis accounting for the remaining portion. In 90–95% of cases, despite the normal appearance of both the udder and milk, elevated somatic cell count (SCC) is accompanied by changes in milk composition and reduced yield. Chronical mastitis has been found to slow down normal calf development [5]. Therefore, early detection and treatment of mastitis in dairy cows is important for maintaining cow health, ensuring dairy product quality, improving production efficiency and animal welfare, and reducing financial losses for farms.
Nazira Mammadova et al. [6] employed support vector machine technology to identify dairy cows with subclinical and clinical mastitis according to their somatic cell counts. The cows were classified as healthy or infected. Somatic cell count (SCC) is a critical tool for diagnosing subclinical mastitis in dairy cows, yet its accuracy can be influenced by various non-infectious factors, leading to false-positive outcomes. These factors encompass the stage of lactation, environmental stress, milk yield levels, and genetic predispositions, which can cause an abnormal increase in SCC, thus generating false-positive results [7]. Consequently, when interpreting SCC data, it is imperative to consider these non-infectious factors comprehensively to prevent misdiagnosis and unnecessary treatment. In order to predict the presence of subclinical mastitis in Italian Mediterranean water buffaloes, T. Bobbo et al. [8] used machine learning (ML) analysis. They built prediction models using four different algorithms: neural networks, random forests, support vector machines, and generalized linear models. Based on multiple evaluation criteria, the test set was best predicted by the neural network, and it was established that machine learning techniques have promise for enhancing the monitoring and prevention of subclinical mastitis. The advent of these emerging methods offers fresh approaches to the early identification of mastitis in dairy cows and is anticipated to establish itself as a standard detection technique in dairy farming in the future. Wang et al. [9] presented an enhanced moth-flapping optimization algorithm (IMFO) and tested it on the UCI dataset and the dairy cow subclinical mastitis disease dataset. Comparative analysis revealed IMFO’s superior feature selection performance, which enables more efficient and accurate detection of subclinical mastitis in large dairy herds. A Satoła et al. [10] compared the accuracy of certain machine learning algorithms, such as logistic regression, support vector machines, Gaussian naive Bayes, k-nearest neighbors, and decision trees, with ensemble learning techniques, such as bagging, boosting, stacking, and super learner models. The results of the study confirmed the beneficial effect of the integrated ML method.
Existing machine learning models have significantly advanced in their ability to forecast the likelihood of subclinical mastitis in dairy cows; however, they still exhibit limitations. Predominantly, both domestic and international prediction models for animal diseases rely on classical machine learning methods such as support vector machines and decision trees. These methods allow the analysis and forecasting of disease probabilities, often emphasizing comparative evaluations across multiple machine learning algorithms. Currently, there is not universally accepted the most effective or accurate model, leaving ample room for experimentation and innovation. Of particular note are the parameters of machine learning models, which typically require manual configuration prior to training to regulate model learning and complexity [11]. This parameterization significantly impacts model performance and generalizability. Traditionally, grid search (GS) has been employed as a standard method to determine optimal hyperparameters [12]. However, GS becomes computationally expensive when dealing with extensive parameter spaces. Currently, swarm intelligence optimization algorithms are increasingly being adopted to navigate parameter spaces and identify optimal parameter combinations, thereby enhancing model performance and generalization capabilities [13]. In the realm of feature selection, these algorithms prove beneficial by identifying the most pertinent feature subsets [14]. This capability is particularly valuable for managing high-dimensional data and extensive feature sets, ultimately improving model efficiency and accuracy.
In this study, our principal objective was to construct a predictive model for subclinical mastitis in dairy cows, integrating an enhanced GOOSE optimization approach with the XGBoost algorithm. We hypothesized that the IGOOSE-XGBoost model would provide superior predictive accuracy compared to traditional machine learning approaches for both disease classification and somatic cell score prediction.

1.2. Methodological Approach

The research implements three distinct strategies to enhance the GOOSE optimization algorithm [15], developing the Improved GOOSE Optimization Algorithm (IGOOSE). Comparative simulation experiments were conducted between IGOOSE and other algorithms, including DBO [16], HBA [17], GWO [18], HHO [19], and the original GOOSE, using CEC2022 benchmark functions [20], leading to the establishment of the IGOOSE-XGBoost prediction model for bovine subclinical mastitis. The main innovations of this study include developing an XGBoost-based predictive model for subclinical mastitis in dairy cows, optimizing model parameters and feature selection through the improved GOOSE optimization algorithm, and developing the IGOOSE-XGBoost prediction model. Qualitative and quantitative evaluation results demonstrate the significant contribution of the IGOOSE-XGBoost model in diagnosing and predicting subclinical mastitis in dairy cows.

1.3. Paper Structure

The paper is structured as follows: Section 2 outlines the applications of XGBoost applications and the GOOSE algorithm; Section 3 introduces the development and technical details of the Improved GOOSE Optimization Algorithm; Section 4 evaluates IGOOSE performance using CEC2022 benchmark functions; Section 5 details the application of IGOOSE-XGBoost in subclinical mastitis prediction, including classification models for disease status prediction and regression models for somatic cell score prediction; Section 6 discusses the research findings and their implications. The overall research workflow is illustrated in Figure 1.

2. Relevant Methods and Theories

2.1. XGBoost Model

An ensemble machine learning approach based on decision trees, called XGBoost (eXtreme Gradient Boosting), has gained significant recognition for its exceptional performance in both classification and regression tasks [21]. For classification, it effectively handles binary and multi-class problems through optimized tree structures and node splitting strategies [22]. The algorithm’s robust performance against noise and missing values, coupled with its high computational efficiency, has led to successful applications across various domains.
In regression tasks, XGBoost efficiently manages complex relationships in high-dimensional data [23], achieving notable success through its gradient boosting technology. The algorithm’s extensive parameter set significantly influences model performance and training efficiency, making intelligent optimization algorithms essential for parameter tuning and feature selection. This optimization approach not only enhances model performance and generalization capabilities, but also improves the interpretability and practical applicability of machine learning models.

2.2. GOOSE Optimization Algorithm

The GOOSE algorithm, an innovative intelligent optimization technique inspired by geese’s activity during rest and foraging activities, was created in 2024 by Rebwar Khalid Hamad. The algorithm draws inspiration from the unique behavioral patterns of geese, particularly their resting habits, whereby a designated guardian goose maintains vigilance by holding a stone with one leg. This natural behavior is translated into algorithmic terms through specific mathematical formulations for position updates and search strategies.
The algorithm operates in two distinct phases determined by a random variable (rnd). When rnd ≥ 0.5, the development phase activates, utilizing Equations (1) and (2) to update goose positions:
X ( i t + 1 ) = F _ F _ S + D _ G i t × T _ A 2
X ( i t + 1 ) = F _ F _ S + D _ G i t × T _ A 2 × C o e
These equations incorporate parameters such as F _ F _ S (falling stone velocity), D _ G i t (guardian-individual distance), and T _ A (sound propagation time), with a specific condition for the coefficient Coe maintaining 0.17 as a threshold value. Conversely, when rnd < 0.5, Equation (3) governs the exploration phase:
X ( i t + 1 ) = r a n d n ( 1 , dim ) × ( M _ T × a l p h a ) + B e s t _ p o s
To better illustrate the working mechanism of the GOOSE algorithm, a simple numerical example is presented below. Consider the optimization problem of finding the minimum of the quadratic function:
f x   =   x 2     4 x   +   4 ,   x 2 ,   6
The implementation process begins with the initialization phase, in which a population of three geese (n = 3) is randomly distributed in the search area. The initial positions are assigned as x1 = −1, x2 = 2, and x3 = 5, with corresponding fitness values of f 1 = 9, f 2 = 0, and f 5 = 9, respectively. Given these values, the position x2 = 2 represents the guardian goose position as it yields the optimal fitness value. During the iterative process, when r n d ≥ 0.5, the development phase is activated. Equations (1) and (2) are applied with the following specific parameters: F _ F _ S = 0.17, D _ G i t 1 = |2 − (−1)| = 3, D _ G i t 3 = |2 − 5| = 3, and T _ A = 1. These parameters determine how the non-guardian geese update their positions relative to the guardian goose. Conversely, when r n d < 0.5, the exploring phase of the algorithm begins, utilizing Equation (3) with B e s t _ p o s = 2 as the reference point, allowing geese to explore new regions of the search space.
Through successive iterations, the geese progressively approach the optimal solution. The algorithm successfully identifies the global minimum at x = 2, where f 2 = 0, thereby validating the effectiveness of the GOOSE algorithm’s dual-phase optimization strategy. This example clearly demonstrates how the algorithm exploitation (development phase) and exploration phase to find the best solution and effectively navigate the search area.
While the emergence of new algorithms continually enriches the field of optimization, the “no free lunch” statement serves as a reminder that no one algorithm can tackle every optimization problem in an optimal manner. This understanding drives the ongoing refinement of the GOOSE algorithm to better address real-world complexities.

3. Improved GOOSE Optimization Algorithm (IGOOSE)

To mitigate the algorithm’s limitations in handling high-dimensional complex problems, this study introduces several enhancements. An elite reverse strategy is incorporated to enhance population initialization, thereby augmenting both global exploration and local development capabilities. Additionally, to improve algorithm stability and speed up convergence, an adaptive nonlinear control element is added. Furthermore, a golden sine strategy is implemented to mitigate the risk of converging to local optima. These improvements constitute the IGOOSE algorithm.

3.1. Elite Opposition-Based Learning Strategy (EOBL)

The success of swarm intelligence algorithms depends heavily on the population’s initiation. If the population is only initialized by randomness, it could lead to the population being overly concentrated in a specific geographic region, which will lead to an imbalance in the distribution of the population, and in turn make it easy for early individuals to fall into aimless exploration during the search process. Therefore, the initial stage uses the elite reverse learning technique. In addition to broadening the algorithm’s search range and enhancing its ability to search globally, its reverse solution creation, and its elite person selection, it also improves the algorithm’s capacity to avoid local optima [18].
Let the solution of the jth goose at the tth iteration be X j t , and its opposite answer be X j t . The fitness function is denoted by F(x). When F ( X j t ) < F X j t , the original solution is better than the inverse solution, which is the elite solution. Equation (5) provides an explanation of the elite inverse solution.
X j t = u b + l b X j t
In this case, the dynamic boundary’s lower and upper bounds are denoted by ub and lb. The advantage of the dynamic boundary is that it can compensate for the disadvantage of the fixed boundary, which cannot save search experience, and is conducive to shortening the search time.

3.2. Adaptive Nonlinear Control Parameter

The GOOSE Optimization Algorithm’s exploring phase, the parameter alpha ([0, 2]), is a crucial variable. The value of alpha decreases significantly with each iteration in the loop. Equation (6) is the expression of alpha. It is evident that alpha is near 2 when there are few iterations, which is conducive to global searching; when the number of iterations is large, alpha is close to 0, which is conducive to local searching. Adaptive nonlinear control parameters are introduced to enhance the algorithm’s robustness and adaptability, improve the position accuracy of the optimal solution, and more accurately simulate the behavior of the goose. This increases the likelihood that the algorithm will find a better solution faster or converge to the optimal solution sooner. Equation (7) is the expression of the adaptive nonlinear control parameter a l p h a .
a l p h a = ( 2 ( l o o p M a x _ I T 2 ) )
a l p h a = ( 2 ( l o o p M a x _ I T 2 ) 2 l o o p M a x _ I T )

3.3. Golden Sine Strategy

Due to a decline in population variety, the GOOSE algorithm is vulnerable to local optima in the later phases of the search. Thus, to improve global search capabilities and the ability of escaping local optima, the golden sine technique is employed [24]. The golden sine method simulates the search space by scanning the unit circle with a sine function and combines it with the golden section coefficient to iteratively search for a better traversal of the algorithm search space and keep the algorithm from becoming trapped in a local optimum. The mathematical model is as follows:
V j t + 1 = x j t sin ( r 1 ) r 2 sin ( r 1 ) x 1 D j t x 2 V j t
where is the jth individual’s position at the t + 1 iteration; V j t is the jth individual’s position at the tth iteration; D j t is the jth individual’s global optimal position at the tth iteration; r1 is a random number in [0, 2 π ] that controls the search distance; r2 is a random number in [0, π ], which controls the search direction; and the golden ratio coefficients are x 1 = a ( 1 g ) + b g and x 2 = a g + b 1 g , where the golden ratio is g = 5 1 / 2 , and the golden ratio search initial values are a = − π and b = π .
The goose’s position update procedure is as follows, following the introduction of the golden sine strategy:
x j t _ n e w = x j t sin ( r 1 ) r 2 sin ( r 1 ) x 1 x b e s t x 2 x j t
where x b e s t is the position of the tth iteration of the goose; x j t is the position of the jth goose obtained by applying the position update formula from the initial iteration of the GOOSE algorithm; and x j t _ n e w is the position of the jth goose obtained by using the golden sine strategy in the tth iteration.

3.4. Algorithm Flow Chart

Based on the three improvement strategies, enhancements were made to the GOOSE optimization algorithm. The detailed flowchart is depicted in Figure 2.

4. Performance Testing and Comparison

CEC2022 benchmark functions are a standard test set designed by the IEEE Computational Intelligence Society for evaluating the performance of optimization algorithms. It contains different types of optimizations problems, including single-peaked functions (for testing local search capability), multi-peaked functions (for testing global search capability), hybrid functions, and combinatorial functions (for testing the performance of algorithms in complex scenarios). These functions have different characteristics, such as multimodality, non-separability, rotation, etc., which enable a thorough evaluation of the optimization techniques’ performance. The IGOOSE method was simulated using CEC2022 benchmark functions to examine its performance. Single-peak (F1), multimodal (F2–F5), hybrid (F6–F8), and mixed (F9–F12) functions are among the functions used. These functions were picked because they can thoroughly test the algorithm’s performance and represent many kinds of optimization challenges. Through these studies, we can confirm the IGOOSE algorithm’s capacity for optimization in a range of situations and guarantee its dependability for use in the future when predicting subclinical mastitis in dairy cows. This article uses 10 dimensions. The specific function information is shown in Table 1.
This study compared IGOOSE with the DBA, HBA, GWO, HHO, and GOOSE algorithms to confirm its superiority and efficacy. The comparison algorithms were set to a population size of N = 30, a maximum number of iterations of T = 1000, and each algorithm was executed 30 times independently to guarantee the fairness of the comparison findings. In Table 2, the statistical findings are displayed.
(1) Table 2 shows that, for 11 of the test functions, the algorithm results are nearly at the hypothetical ideal values, except for the test results for F6. According to the experimental data, IGOOSE achieves the theoretical optimal value for the unimodal function F1 and exhibits notable optimization performance. The theoretical best value is reached by F4 for the multimodal functions F2 through F5. The theoretical best value is reached by F6 and F8 for the mixed functions F6 to F8. Every one of the combined functions F9–F12 reaches the supposedly ideal value. In F1, F3, F4, F8, F9, F10, F11, and F12, the extremely low standard deviation shows that IGOOSE is more stable than the other algorithms. In this study, we also selected six representative functions from Table 2—F1, F3, F6, F7, F10 and F12—and plotted convergence graphs for 30 runs. As seen in Figure 3, the ordinate denotes the function’s average fitness value, while the abscissa indicates the number of iterations.
(2) From the process point of view, in the single-peak function F1, despite starting the iteration with a somewhat slower rate of convergence than the HHO and GWO algorithms, the IGOOSE algorithm achieves the theoretical optimum after roughly 400 iterations. The IGOOSE algorithm starts to converge at around 100 iterations until it reaches the global optimum for function F3, and its convergence pace is marginally faster than HBA’s. After roughly 50 iterations, the IGOOSE algorithm starts to converge in the mixed function F6, eventually reaching the global optimum; meanwhile, the F7 function reaches its optimum after 100 iterations. For the combined functions F10 and F12, convergence begins at the 50th iteration, and at the beginning of the iteration, the convergence pace is faster than the other five algorithms, until convergence to the global optimum.
IGOOSE performs better than DBO, HBA, GWO, HHO, and GOOSE in terms of convergence speed and stability, as evidenced by the fact that its optimization curve is generally much lower than those of the other algorithms and that its convergence results are superior to those of the other algorithms.

5. Prediction Model for Subclinical Mastitis in Dairy Cows Based on IGOOSE-XGboost

This study applies IGOOSE to a predictive model of subclinical mastitis in dairy cows, aiming to validate its feasibility and applicability. There are two tasks: (1) predicting whether cows have subclinical mastitis, and (2) predicting somatic cell score (SCS). Task 1 involves classification prediction, while Task 2 involves regression prediction. The study yields two types of results: categorical disease status and numerical SCS. Qualitative analysis discusses non-numerical features related to disease status to assist in herd health management. Quantitative analysis utilizes SCS data to establish models predicting the risk and likelihood of subclinical mastitis, providing decision support for farms.

5.1. 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, Foremilk 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.
To predict subclinical mastitis 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 mastitis. Somatic cell score (SCS), derived from SCC, exhibits a higher genetic correlation (0.6–0.8) with subclinical mastitis in dairy cows and has a higher heritability compared to SCC [28]. Thus, SCC was transformed into SCS using the formula SCS = log2(SCC/100,000) + 3 [29], where SCS ≥ 3 indicates a score of 1 (indicating disease), and scores below 3 indicate 0 (indicating health).

5.2. Building the IGOOSE-XGBoost Classification Model

5.2.1. Evaluation Metrics for Classification Models

To predict whether a cow had subclinical mastitis, we used four different metrics [30] to evaluate the model: accuracy (ACC), precision (PRE), F1 score (F1), and recall (REC). Their expressions are as follows:
A c c u r a r y = T P + T N T P + T N + F P + F N
Pr e c i s i o n = T P T P + F P
Re c a l l = T P T P + F N
F 1 = 2 P R P + R

5.2.2. Building an IGOOSE-XGBoost Classification Model for Subclinical Mastitis in Dairy Cows

The intelligent optimization algorithm combined with XGBoost for feature selection and classification tasks is a powerful method that can help to find the best features in complex datasets and train high-performance classifiers. First, the dataset was split into an 8:2 ratio between a training set and a test set. The dataset was subjected to feature selection using the IGOOSE algorithm, GOOSE algorithm, SSA algorithm, HBA algorithm, HO algorithm [31], and DBO algorithm, respectively. Then, the XGBoost classification algorithm was used to classify and predict the data after feature selection. The number of algorithm populations was set to 30, the number of iterations was set to 1000, and an average of 50 experiments were used to confirm the results’ scientific nature. Six assessment indicators—accuracy, number of selected features, algorithm fitness value, recall rate, precision rate, and F1 score—were employed to compare the algorithms’ performance in feature selection. Table 4 displays the findings.
Table 4 shows the classification results of the different models after feature selection of the dataset. The experimental data show that among the six algorithms, the IGOOSE-XGBoost model achieves the highest average classification accuracy of 0.85 ± 0.013 after feature selection. In addition, the model has the highest recall (0.87 ± 0.015) and F1 score (0.80 ± 0.013). It is noteworthy that IGOOSE-XGBoost still achieved such excellent performance while maintaining a condensed feature set of only six features. In terms of fitness value, the IGOOSE-XGBoost model also outperforms the other models with a value of 0.151 ± 0.0019, indicating the best optimization. The standard deviations of all the evaluation indexes were controlled within a small range (≤0.02), reflecting the high repeatability and reliability of the experiment.
Analyses with Friedman’s test show significant differences between the algorithms (x2 = 4.93, p < 0.05). In particular, the IGOOSE-XGBoost model shows significant advantages in several assessment metrics, mainly in terms of accuracy (p < 0.05), recall (p < 0.05), and fitness value (p < 0.05). Although the improvement in precision rate is relatively modest, it is still statistically significant (p < 0.05). In terms of feature selection efficiency, IGOOSE consistently selects a compact feature set, which demonstrates its ability to identify the most relevant features while still maintaining high predictive performance.
IGOOSE’s greater optimization power is demonstrated by the fact that its fitness value (0.151 ± 0.0019) is much lower than that of the other algorithms (p < 0.05). In addition, the narrow confidence intervals for all the evaluated metrics indicate that the results are highly reliable and reproducible. The IGOOSE algorithm shows unique advantages in the feature selection process: not only can it achieve the best performance while maintaining a small number of features, but it also considers the interactions between the features during the feature selection process and effectively avoids local optimal solutions through the iterative optimization process.
The swarm intelligence optimization algorithm not only helps to determine the most representative feature subset, but also searches for the parameter space to find the optimal parameter combination to enhance the model’s functionality and capacity for generalization. Next, based on feature selection, the corresponding intelligent optimization algorithm simultaneously optimizes the parameters (maximum number of iterations, depth, learning rate) of the classifier XGBoost. The results are shown in Table 5.
Table 5 shows the classification results of each algorithm after parameter optimization. The prediction performance of the IGOOSE-XGBoost model is significantly improved in all metrics: the accuracy rate is increased to 0.87 ± 0.012, the precision rate reaches 0.89 ± 0.013, the recall rate stays at a high level of 0.88 ± 0.014, and the F1 score is improved to 0.88 ± 0.012. The standard deviation of all evaluation metrics remained below 0.014, indicating that the model has good stability. By comparing prediction performance, precision, recall, F1 score, fitness value, and number of features, it can be observed that the IGOOSE-XGBoost model has the best prediction effect.
From the perspective of disease prediction, recall is of particular importance. Lower recall means that many cows that are sick may be misclassified as healthy, which will delay diagnosis and treatment. The IGOOSE-XGBoost model (0.88 ± 0.014) and the DBO-XGBoost model (0.89 ± 0.017) perform well in terms of recall. A higher recall rate helps with disease prevention and early diagnosis and treatment. Considering all the metrics together, the IGOOSE-XGBoost model demonstrates the best overall prediction.
For the parameter-optimized model, IGOOSE-XGBoost shows significant improvements in accuracy, precision, and F1 score (p < 0.05). The smaller standard deviation (≤0.014) and narrow confidence interval further demonstrate the high stability and reliability of this model. Through parameter optimization, the model not only improves predictive accuracy, but also maintains the consistency and reproducibility of the results.
These modifications result in more rigorous and coherent content while maintaining scientific and readability. In the following subsection, each paragraph clearly describes the specific assessment metrics and analyses and provides a reasoned explanatory account of the important findings. The credibility of the study’s conclusions is enhanced by elaborating on the results of statistical tests and standard deviation analyses.

5.3. Building the IGOOSE-XGBoost Regression Model for Subclinical Mastitis in Dairy Cows

5.3.1. Correlation Analysis

Correlation analysis was conducted for the attributes listed in Table 3, to ensure variable independence and minimize redundancy. Pearson’s correlation coefficient was utilized to quantify the associations among variables. This coefficient measures the similarity between attributes and is suitable for analyzing correlations among continuous variables. A coefficient near 0 shows no connection or a very weak correlation (0 to 0.2), a coefficient between 0.2 and 0.4 indicates a weak correlation, a coefficient between 0.4 and 0.6 indicates a moderate correlation, a coefficient between 0.6 and 0.8 indicates a high correlation, and a coefficient between 0.8 and 1 indicates an extremely strong association [32]. The correlation heat map depicted in Figure 3 illustrates these relationships, based on the Pearson’s correlation coefficients between variables.
Figure 4 displays the Pearson correlation coefficients among the different variables, with darker colors indicating stronger correlations. This figure illustrates the relationship between various variables and SCS. In this study, features with correlation coefficients greater than or equal to 0.4 were selected. Ultimately, x7, x8, x13, and x21 (i.e., Milk Fat Percentage, Peak Milk, Urea Nitrogen, SCS) were identified and used to construct a regression model.

5.3.2. Evaluation Indicators for Regression Models

Four indicators—the mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE), and coefficient of determination (R2)—were taken into consideration in order to test and assess the prediction accuracy and performance of the regression method machine learning model examined in this study [33].
The regression problem’s loss was mostly measured by the mean square error, or MSE. The model’s prediction performance is higher if the MSE value is lower, since it indicates a lower error between the actual outcomes predicted by the approach and the original data. On the other hand, a higher MSE value indicates a greater discrepancy between the data and the expected outcomes, a higher error, and a less effective model. It is expressed as follows:
M S E = 1 n i = 1 n y i y 2
The root means square error (RMSE) falls between 0 and +∞. RMSE = 0, or an ideal model, occurs when the true value and the predicted value are the same. The RMSE value increases with the size of the error. The formula is expressed as follows:
R M S E = 1 m i = 1 m ( y i y i ) 2
The advantage of the mean absolute error (MAE) is that it is not sensitive to extreme values, it has a stable gradient regardless of the input value, and it has a robust solution. The range is [0, +∞). A smaller score indicates a better model, because there is less discrepancy between the true and predicted values. On the contrary, a greater score indicates that the model is poor. The formula is expressed as follows:
M A E = 1 n i = 1 n y i y i
The primary purposes of the adjusted R-squared (R2) are to assess the degree of fit between the expected and actual values and to ascertain whether the statistical model can adequately fit the data. The range of the value is [0, 1]. The model performs better in terms of prediction the closer it approaches to 1. The specific expression is as follows:
R 2 = 1 i y i y 2 i y i ¯ y i 2

5.3.3. Building the IGOOSE-XGBoost Regression Model

First, four commonly used machine learning methods, KNN [34], XGBoost, SVM [35], and GBDT [36], were used to perform regression prediction. According to the correlation analysis, each sample contained four features.
The comparison of the evaluation metrics of several regression models is displayed in Table 6. From the evaluation results, the XGBoost model shows optimal prediction performance, with the highest coefficient of determination (R2 = 0.631 ± 0.013) and the lowest mean absolute error (MAE = 0.552 ± 0.016) and mean square error (MSE = 0.565 ± 0.017). This is followed by the GBDT model, which performs slightly better than XGBoost in terms of root mean square error (RMSE = 0.753 ± 0.020) but is slightly inferior in terms of other metrics such as R2 value (0.611 ± 0.015) and MAE (0.565 ± 0.021). The KNN model has the worst overall performance, with the lowest R2 value (0.485 ± 0.018) and all its error metrics being significantly higher than the other models. All the models maintain strong stability (standard deviation ≤ 0.026), according to the standard deviation study, with the XGBoost model having the best stability (standard deviation range 0.013–0.018). The best prediction results are shown by the XGBoost model when all four evaluation measures are compared.
The relevant literature indicates that swarm intelligence optimization techniques are increasingly being used to optimize model search procedures. SSA [37], WOA [38], ESOA [39], GOOSE, and IGOOSE were combined with XGBoost, as shown in Figure 5. Five combined models were obtained by adding an optimization process, and the obtained prediction results were compared and analyzed to find a new model with optimal performance.
The comparison findings of these optimized models’ assessment standards are displayed in Table 7. As can be seen from the data, the IGOOSE-XGBoost model achieves the best performance in all the metrics: it has the highest R2 value (0.663 ± 0.012), and the lowest MAE (0.526 ± 0.013), MSE (0.511 ± 0.014), and RMSE (0.693 ± 0.015). The GOOSE-XGBoost model performs second best, with a similar R2 value (0.642 ± 0.013) and error metrics (MAE = 0.531 ± 0.014, MSE = 0.521 ± 0.015, and RMSE = 0.722 ± 0.016) to IGOOSE-XGBoost. The other optimized models, although improved compared to the base model, are not as significantly improved as the IGOOSE and GOOSE models.
It is particularly noteworthy that in comparison with the original XGBoost model, the IGOOSE-optimized model achieves significant improvements in all evaluation metrics: the R2 value improves by 0.032 (from 0.631 to 0.663), the MAE decreases by 0.026 (from 0.552 to 0.526), the MSE decreases by 0.054 (from 0.565 to 0.511), and the RMSE decreases by 0.065 (from 0.758 to 0.693). These improvements are not only statistically significant (p < 0.05), but also valuable in practical applications. Furthermore, all the optimized models’ assessment metrics’ standard deviations are maintained at a low level (≤0.015), demonstrating the models’ strong stability and dependability. In particular, the IGOOSE-XGBoost model has the smallest standard deviation (≤0.014) for all the indicators, which further confirms that the model has the best stability and reliability.
In summary, our study created an IGOOSE-XGBoost-based model to forecast the subclinical mastitis of dairy cows, predicting whether cows were sick using their SCS. To predict whether cows had subclinical mastitis, feature selection was performed using six intelligent optimization algorithms, and XGBoost was used as a classifier. To further improve prediction accuracy, to improve the XGBoost parameters, each of these six algorithms was applied. According to the results, the IGOOSE-XGBoost classification model performed the best (ACC = 0.87; REC = 0.88; PRE = 0.89; F1 score = 0.88; fitness value = 0.14523). For predicting the SCS of dairy cows, the DHI data used started with 33 features, and after deleting irrelevant attributes and correlation analysis, the four most important features were selected. We trained and compared four machine learning models, and selected the model with the best prediction performance, XGBoost, to which five intelligent optimization algorithms were added to improve its parameters. The IGOOSE-XGBoost regression model produced the greatest results, judging by the results (RMSE = 0.693; MSE = 0.511; MAE = 0.526; R2 = 0.663). The integration of these approaches enhances prediction accuracy and comprehensiveness, offering valuable insights for targeted prevention and treatment strategies.

6. Conclusions and Future Work

Early identification and management of dairy cow mastitis are critically important for maintaining the health of herds, ensuring the quality of dairy products, increasing production efficiency, safeguarding animal welfare, and reducing economic losses in dairy operations. This study presents an IGOOSE-XGBoost predictive model for subclinical mastitis in dairy cows, which integrates the XGBoost algorithm with an enhanced GOOSE optimization algorithm.
Our work advances the field in several key aspects compared to previous studies. Mansour et al.’s [40] study, which utilized different machine learning models (Deep Learning, Naïve Bayes, Generalized Linear Model, Logistic Regression, Decision Tree, Gradient-Boosted Tree, and Random Forest) and a large dataset of 364,249 milking instances, found that GBT was the most accurate, with 84.9% accuracy, in predicting subclinical mastitis. Cavero et al. [41] evaluated different methods for machine learning (Naïve Bayes, Random Forest, and Extreme Gradient Boosting) for clinical mastitis prediction, reaching a 72% accuracy rate and accurately categorizing 85% of CM cows in their continuous model. In comparison, our model achieves higher accuracy (87%) while specifically addressing the more challenging task of subclinical mastitis detection. The experimental outcomes, scrutinized from both qualitative and quantitative standpoints, indicate that the IGOOSE-XGBoost model has higher accuracy in predicting subclinical mastitis (ACC = 0.87; REC = 0.88; PRE = 0.89; F1 score = 0.88), outperforming traditional methods. These results surpass those reported in the recent literature, in which typical accuracy rates range from 0.75 to 0.83. Furthermore, our regression model for SCS prediction achieves an R2 value of 0.663, demonstrating stronger predictive power compared to conventional approaches. In future work, we intend to utilize different CEC test functions to evaluate the efficiency of the improved algorithm and apply it to cow disease prediction, thereby expanding the scope and applicability of our prediction framework to the veterinary and dairy industry.

Author Contributions

Methodology, R.G. and Y.D.; writing—original draft preparation, R.G.; writing—review and editing, R.G.; visualization, Y.D.; supervision, Y.D.; funding acquisition, Y.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Basic research innovation group grant number [21JR7RA858] and Gansu University Innovation Fund Project “Research on Machine Learning Prediction Model of Subclinical Mastitis in Dairy Cows” grant number [2022B-107].

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Vargová, M.; Zigo, F.; Výrostková, J.; Farkašová, Z.; Rehan, I.F. Biofilm-Producing Ability of Staphylococcus Aureus Obtained from Surfaces and Milk of Mastitic Cows. Vet. Sci. 2023, 10, 386. [Google Scholar] [CrossRef]
  2. Kerro Dego, O.; Vidlund, J. Staphylococcal Mastitis in Dairy Cows. Front. Vet. Sci. 2024, 11, 1356259. [Google Scholar] [CrossRef] [PubMed]
  3. Sahu, C.; Manimaran, A.; Kumaresan, A.; Rajendran, D.; Sivaram, M. Role of Trisodium Citrate and Nanominerals in Mastitis Management in Dairy Animals: A Review. Agric. Rev. 2025, 46, 272–279. [Google Scholar] [CrossRef]
  4. Deshapriya, R.M.C.; Rahularaj, R.; Ranasinghe, R. Mastitis, Somatic Cell Count and Milk Quality: An Overview. Sri Lanka Vet. J. 2019, 66, 1–12. [Google Scholar] [CrossRef]
  5. Hisira, V.; Zigo, F.; Kadaši, M.; Klein, R.; Farkašová, Z.; Vargová, M.; Mudroň, P. Comparative Analysis of Methods for Somatic Cell Counting in Cow’s Milk and Relationship between Somatic Cell Count and Occurrence of Intramammary Bacteria. Vet. Sci. 2023, 10, 468. [Google Scholar] [CrossRef] [PubMed]
  6. Mammadova, N.; Keskin, İ. Application of the Support Vector Machine to Predict Subclinical Mastitis in Dairy Cattle. Sci. World J. 2013, 2013, 603897. [Google Scholar] [CrossRef]
  7. Sun, X.; Zhao, R.; Wang, N.; Zhang, J.; Xiao, B.; Huang, F.; Chen, A. Milk Somatic Cell Count: From Conventional Microscope Method to New Biosensor-Based Method. Trends Food Sci. Technol. 2023, 135, 102–114. [Google Scholar] [CrossRef]
  8. Bobbo, T.; Matera, R.; Pedota, G.; Manunza, A.; Cotticelli, A.; Neglia, G.; Biffani, S. Exploiting Machine Learning Methods with Monthly Routine Milk Recording Data and Climatic Information to Predict Subclinical Mastitis in Italian Mediterranean Buffaloes. J. Dairy Sci. 2023, 106, 1942–1952. [Google Scholar] [CrossRef]
  9. Wang, Z.; Dai, Y.; Liu, H. Feature Selection of Recessive Mastitis in Dairy Cows Based on Improved Moth-Flame Optimization Algorithm. Heilongjiang Anim. Husb. Vet. Med. 2024, 66, 8–16. [Google Scholar]
  10. Satoła, A.; Satoła, K. Performance Comparison of Machine Learning Models Used for Predicting Subclinical Mastitis in Dairy Cows: Bagging, Boosting, Stacking, and Super-Learner Ensembles versus Single Machine Learning Models. J. Dairy Sci. 2024, 107, 3959–3972. [Google Scholar] [CrossRef]
  11. Sheik, A.G.; Malla, M.A.; Srungavarapu, C.S.; Patan, A.K.; Kumari, S.; Bux, F. Prediction of Wastewater Quality Parameters Using Adaptive and Machine Learning Models: A South African Case Study. J. Water Process Eng. 2024, 67, 106185. [Google Scholar] [CrossRef]
  12. Khalil, M.; AlSayed, A.; Liu, Y.; Vanrolleghem, P.A. An Integrated Feature Selection and Hyperparameter Optimization Algorithm for Balanced Machine Learning Models Predicting N2O Emissions from Wastewater Treatment Plants. J. Water Process Eng. 2024, 63, 105512. [Google Scholar] [CrossRef]
  13. Wang, T.; Zhang, K.; Liu, Z.; Ma, T.; Luo, R.; Chen, H.; Wang, X.; Ge, W.; Sun, H. Prediction and Explanation of Debris Flow Velocity Based on Multi-Strategy Fusion Stacking Ensemble Learning Model. J. Hydrol. 2024, 638, 131347. [Google Scholar] [CrossRef]
  14. Kwakye, B.D.; Li, Y.; Mohamed, H.H.; Baidoo, E.; Asenso, T.Q. Particle Guided Metaheuristic Algorithm for Global Optimization and Feature Selection Problems. Expert Syst. Appl. 2024, 248, 123362. [Google Scholar] [CrossRef]
  15. Hamad, R.K.; Rashid, T.A. GOOSE Algorithm: A Powerful Optimization Tool for Real-World Engineering Challenges and Beyond. Evol. Syst. 2024, 15, 1249–1274. [Google Scholar] [CrossRef]
  16. Xue, J.; Shen, B. Dung Beetle Optimizer: A New Meta-Heuristic Algorithm for Global Optimization. J. Supercomput. 2023, 79, 7305–7336. [Google Scholar] [CrossRef]
  17. Hashim, F.A.; Houssein, E.H.; Hussain, K.; Mabrouk, M.S.; Al-Atabany, W. Honey Badger Algorithm: New Metaheuristic Algorithm for Solving Optimization Problems. Math. Comput. Simul. 2022, 192, 84–110. [Google Scholar] [CrossRef]
  18. Zhang, H.; Zhang, Y.; Niu, Y.; He, K.; Wang, Y. A Grey Wolf Optimizer Combined with Artificial Fish Swarm Algorithm for Engineering Design Problems. Ain Shams Eng. J. 2024, 15, 102797. [Google Scholar] [CrossRef]
  19. Heidari, A.A.; Mirjalili, S.; Faris, H.; Aljarah, I.; Mafarja, M.; Chen, H. Harris Hawks Optimization: Algorithm and Applications. Future Gener. Comput. Syst. 2019, 97, 849–872. [Google Scholar] [CrossRef]
  20. Sun, K.; Huo, J.; Jia, H.; Liu, Q.; Yang, J.; Cai, C. Nonlinear Optimization of Optical Camera Multiparameter via Triple Integrated Gradient-Based Optimizer Algorithm. Opt. Laser Technol. 2024, 179, 111294. [Google Scholar] [CrossRef]
  21. Costache, R.; Arabameri, A.; Moayedi, H.; Pham, Q.B.; Santosh, M.; Nguyen, H.; Pandey, M.; Pham, B.T. Flash-Flood Potential Index Estimation Using Fuzzy Logic Combined with Deep Learning Neural Network, Naïve Bayes, XGBoost and Classification and Regression Tree. Geocarto Int. 2022, 37, 6780–6807. [Google Scholar] [CrossRef]
  22. Joe, H.; Kim, H.-G. Multi-Label Classification with XGBoost for Metabolic Pathway Prediction. BMC Bioinform. 2024, 25, 52. [Google Scholar] [CrossRef]
  23. Meng, W.; Meng, X.; Wang, J.; Li, G.; Liu, B.; Kan, G.; Lu, J.; Zhao, L.; Zhi, P. Prediction of the Shear Wave Speed of Seafloor Sediments in the Northern South China Sea Based on an XGBoost Algorithm. Front. Mar. Sci. 2024, 11, 1307768. [Google Scholar] [CrossRef]
  24. Fu, J.; Wu, C.; Wang, J.; Haque, M.M.; Geng, L.; Meng, J. Lithium-Ion Battery SOH Prediction Based on VMD-PE and Improved DBO Optimized Temporal Convolutional Network Model. J. Energy Storage 2024, 87, 111392. [Google Scholar] [CrossRef]
  25. Han, X.; Gao, M.; Shen, W.; Liu, H.; Dai, B.; He, Y.; Liu, H. A Framework for Generating Anomaly Analysis Comments in DHI Interpretation Report. Comput. Electron. Agric. 2023, 214, 108331. [Google Scholar] [CrossRef]
  26. De Oliveira Padilha, D.A.; Evangelista, A.F.; Valloto, A.A.; Zadra, L.E.F.; De Almeida, R.; De Almeida Teixeira, R.; Dias, L.T. Genetic Association between Fat-to-Protein Ratio and Traits of Economic Interest in Early Lactation Holstein Cows in Brazil. Trop. Anim. Health Prod. 2024, 56, 90. [Google Scholar] [CrossRef]
  27. YE, W.; MA, Z.; YU, Y.; HAN, B. Incidence Status of Mastitis in Dairy Cows and Its Prevention and Treatment Measures in China. Chin. J. Anim. Sci. 2023, 59, 343–348. [Google Scholar]
  28. Chen, R.; Wang, Z.; Yang, Z.; Zhu, X.; Ji, D.; Mao, Y. Association of IL8 -105G/A with Mastitis Somatic Cell Score in Chinese Holstein Dairy Cows. Anim. Biotechnol. 2015, 26, 143–147. [Google Scholar] [CrossRef]
  29. Carvalho-Sombra, T.C.F.; Fernandes, D.D.; Bezerra, B.M.O.; Nunes-Pinheiro, D.C.S. Systemic Inflammatory Biomarkers and Somatic Cell Count in Dairy Cows with Subclinical Mastitis. Vet. Anim. Sci. 2021, 11, 100165. [Google Scholar] [CrossRef]
  30. Karthik, A.; Hamatta, H.S.A.; Patthi, S.; Krubakaran, C.; Kumar Pradhan, A.; Rachapudi, V.; Shuaib, M.; Rajaram, A. Ensemble-Based Multimodal Medical Imaging Fusion for Tumor Segmentation. Biomed. Signal Process. Control 2024, 96, 106550. [Google Scholar] [CrossRef]
  31. Amiri, M.H.; Mehrabi Hashjin, N.; Montazeri, M.; Mirjalili, S.; Khodadadi, N. Hippopotamus Optimization Algorithm: A Novel Nature-Inspired Optimization Algorithm. Sci. Rep. 2024, 14, 5032. [Google Scholar] [CrossRef]
  32. Shohag, M.J.I.; Tian, S.; Sriti, N.; Liu, G. Enhancing Bok Choy Growth through Synergistic Effects of Hydrogel and Different Nitrogen Fertilizer Forms. Sci. Hortic. 2024, 336, 113400. [Google Scholar] [CrossRef]
  33. Che, Z.; Peng, C. Improving Support Vector Regression for Predicting Mechanical Properties in Low-Alloy Steel and Comparative Analysis. Mathematics 2024, 12, 1153. [Google Scholar] [CrossRef]
  34. Yang, J.; Kuang, J.; Wang, G.; Zhang, Q.; Liu, Y.; Liu, Q.; Xia, D.; Li, S.; Wang, X.; Wu, D. Adaptive Three-Way KNN Classifier Using Density-Based Granular Balls. Inf. Sci. 2024, 678, 120858. [Google Scholar] [CrossRef]
  35. Han, R. Application of Inertial Navigation High Precision Positioning System Based on SVM Optimization. Syst. Soft Comput. 2024, 6, 200105. [Google Scholar] [CrossRef]
  36. Wang, L.; Chi, J.; Ding, Y.; Yao, H.; Guo, Q.; Yang, H. Transformer Fault Diagnosis Method Based on SMOTE and NGO-GBDT. Sci. Rep. 2024, 14, 7179. [Google Scholar] [CrossRef]
  37. Xue, J.; Shen, B. A Novel Swarm Intelligence Optimization Approach: Sparrow Search Algorithm. Syst. Sci. Control Eng. 2020, 8, 22–34. [Google Scholar] [CrossRef]
  38. Mirjalili, S.; Lewis, A. The Whale Optimization Algorithm. Adv. Eng. Softw. 2016, 95, 51–67. [Google Scholar] [CrossRef]
  39. Chen, Z.; Francis, A.; Li, S.; Liao, B.; Xiao, D.; Ha, T.; Li, J.; Ding, L.; Cao, X. Egret Swarm Optimization Algorithm: An Evolutionary Computation Approach for Model Free Optimization. Biomimetics 2022, 7, 144. [Google Scholar] [CrossRef]
  40. Ebrahimi, M.; Mohammadi-Dehcheshmeh, M.; Ebrahimie, E.; Petrovski, K.R. Comprehensive Analysis of Machine Learning Models for Prediction of Sub-Clinical Mastitis: Deep Learning and Gradient-Boosted Trees Outperform Other Models. Comput. Biol. Med. 2019, 114, 103456. [Google Scholar] [CrossRef]
  41. Fadul-Pacheco, L.; Delgado, H.; Cabrera, V.E. Exploring Machine Learning Algorithms for Early Prediction of Clinical Mastitis. Int. Dairy J. 2021, 119, 105051. [Google Scholar] [CrossRef]
Figure 1. Overall Flow Chart.
Figure 1. Overall Flow Chart.
Applsci 15 08763 g001
Figure 2. Algorithm flow chart.
Figure 2. Algorithm flow chart.
Applsci 15 08763 g002
Figure 3. Iterative curves.
Figure 3. Iterative curves.
Applsci 15 08763 g003
Figure 4. Correlation heat map.
Figure 4. Correlation heat map.
Applsci 15 08763 g004
Figure 5. Composite Flowchart.
Figure 5. Composite Flowchart.
Applsci 15 08763 g005
Table 1. CEC2022 benchmark functions.
Table 1. CEC2022 benchmark functions.
No.FunctionFmin
Unimodal Function1Shifted and full Rotated Zakharoy Function300
Basic Functions2Shifted and full Rotated Rosenbrock’s Function400
3Shifted and full Rotated Expanded Schaffer’s F6 Function600
4Shifted and full Rotated Non-Continuous Rastrigin’s Function800
5Shifted and full Rotated Levy Function900
Hybrid Functions6Hybrid Function 1 (N = 3)1800
7Hybrid Function 2 (N = 6)2000
8Hybrid Function 3 (N = 5)2200
Composition Functions9Composition Function 1 (N = 5)2300
10Composition Function 1 (N = 5)2400
11Composition Function 1 (N = 5)2600
12Composition Function 1 (N = 5)2700
Search range: [−100, 100] D
D means 10 dimensions.
Table 2. Optimization performance indicators of IGOOSE and comparison algorithms for different functions.
Table 2. Optimization performance indicators of IGOOSE and comparison algorithms for different functions.
FunctionEvaluation
Criterion
DBOHBAGWOHHOGOOSEIGOOSE
F1std3.23 × 1022.10 × 1061.57 × 1021.24 × 1015.70 × 10−58.45 × 10−5
avg4.49 × 1023.50 × 1023.60 × 1023.51 × 1023.45 × 1023.00 × 102
F2std3.17 × 1011.29 × 1012.41 × 1016.19 × 1011.32 × 1012.56 × 101
avg4.27 × 1024.07 × 1024.28 × 1024.58 × 1024.08 × 1024.17 × 102
F3std6.96 × 1011.05 × 1011.06 × 1011.06 × 1011.15 × 1011.90 × 101
avg6.09 × 1026.00 × 1026.01 × 1026.19 × 1026.62 × 1026.02 × 102
F4std1.03 × 1017.90 × 107.17 × 107.84 × 102.05 × 1013.56 × 101
avg8.31 × 1028.19 × 1028.17 × 1028.27 × 1028.48 × 1028.00 × 102
F5std1.19 × 1024.50 × 1012.69 × 1011.23 × 1025.14 × 1022.50 × 102
avg9.97 × 1029.23 × 1029.19 × 1021.38 × 1032.04 × 1031.27 × 103
F6std2.05 × 1032.16 × 1032.34 × 1032.68 × 1031.99 × 1031.82 × 103
avg5.10 × 1035.63 × 1035.11 × 1035.84 × 1035.72 × 1035.08 × 103
F7std1.19 × 1016.20 × 1012.35 × 1013.46 × 1015.92 × 1011.35 × 101
avg2.03 × 1032.02 × 1032.03 × 1032.07 × 1032.14 × 1032.03 × 103
F8std7.92 × 1013.03 × 1015.84 × 1011.24 × 1011.31 × 1021.09 × 101
avg2.23 × 1032.23 × 1032.22 × 1032.23 × 1032.43 × 1032.22 × 103
F9std1.03 × 1012.68 × 1014.32 × 1013.39 × 1014.62 × 1011.73 × 101
avg2.54 × 1032.54 × 1032.58 × 1032.57 × 1032.56 × 1032.44 × 103
F10std6.22 × 1015.71 × 1016.87 × 1011.18 × 1026.41 × 1021.60 × 101
avg2.40 × 1032.40 × 1032.50 × 1032.42 × 1032.51 × 1032.40 × 103
F11std1.21 × 1021.25 × 1021.18 × 1023.04 × 1023.46 × 1026.65 × 101
avg2.71 × 1032.67 × 1032.96 × 1032.93 × 1033.68 × 1032.65 × 103
F12std1.42 × 1013.13 × 1011.24 × 1014.42 × 1018.63 × 1012.88 × 101
avg2.87 × 1032.88 × 1032.91 × 1032.94 × 1032.91 × 1032.77 × 103
Table 3. Description of features.
Table 3. Description of features.
No.VariableMeanStandard Deviation
x1Parity1.10.37
x2Lactation Persistence101.3810.39
x3Days in milk138.8664.90
x4WHI99.9826.33
x5Milk yield1.160.16
x6Fore milk yield11.412.49
x7Milk Fat Percentage4.460.85
x8Peak Milk Yield0.270.90
x9Protein Percentage3.73760.3657
x10Peak Lactation Day100.889.48
x11Fat-to-Protein Ratio1.190.28
x12305-Day Milk Yield76961684
x13Urea Nitrogen8.5516.90
x14Total Milk Volume33.376.69
x15Milk Loss0.17890.6414
x16Total Milk Fat7720.511666.25
x17Economic Loss0.49150.7616
x18Total Protein206.3659.64
x19Corrected Milk166.4249.42
x20Adult equivalents8828.011863.72
x21SCS2.11.3
Table 4. Comparison of evaluation indicators of different classification models.
Table 4. Comparison of evaluation indicators of different classification models.
AlgorithmAverage AccuracyAverage RecallAverage PrecisionAverage F1 ScoreAverage
Fitness Value
Average
Number of Features
SSA0.83 ± 0.0160.80 ± 0.0180.75 ± 0.0170.77 ± 0.0150.170 ± 0.00249.12 ± 0.42
HBA0.81 ± 0.0140.83 ± 0.0160.77 ± 0.0140.79 ± 0.0140.161 ± 0.002110.08 ± 0.45
CPO0.83 ± 0.0150.85 ± 0.0170.71 ± 0.0160.75 ± 0.0150.163 ± 0.00236.05 ± 0.31
DBO0.80 ± 0.0170.78 ± 0.0190.73 ± 0.0180.77 ± 0.0160.163 ± 0.00226.07 ± 0.33
GOOSE0.84 ± 0.0150.84 ± 0.0170.74 ± 0.0160.79 ± 0.0140.163 ± 0.00217.10 ± 0.38
IGOOSE0.85 ± 0.0130.87 ± 0.0150.76 ± 0.0140.80 ± 0.0130.151 ± 0.00196.04 ± 0.28
Table 5. Comparison of evaluation indicators of different models with statistical measures.
Table 5. Comparison of evaluation indicators of different models with statistical measures.
AlgorithmAverage AccuracyAverage RecallAverage PrecisionAverage F1 ScoreAverage
Fitness Value
SSA0.83 ± 0.0150.81 ± 0.0170.80 ± 0.0160.79 ± 0.0150.158 ± 0.0023
HBA0.84 ± 0.0140.83 ± 0.0160.79 ± 0.0150.80 ± 0.0140.147 ± 0.0021
CPO0.84 ± 0.0150.87 ± 0.0160.78 ± 0.0150.85 ± 0.0140.148 ± 0.0022
DBO0.84 ± 0.0160.89 ± 0.0170.84 ± 0.0160.79 ± 0.0150.148 ± 0.0023
GOOSE0.85 ± 0.0140.84 ± 0.0160.78 ± 0.0150.81 ± 0.0140.146 ± 0.0020
IGOOSE0.87 ± 0.0120.88 ± 0.0140.89 ± 0.0130.88 ± 0.0120.145 ± 0.0018
Table 6. Comparison of evaluation indicators of different regression models.
Table 6. Comparison of evaluation indicators of different regression models.
Evaluation IndicatorsSVRGBDTKNNXGBoost
Average R20.578 ± 0.0160.611 ± 0.0150.485 ± 0.0180.631 ± 0.13
Average MAE0.646 ± 0.0210.565 ± 0.0210.727 ± 0.0230.552 ± 0.016
Average MSE0.753 ± 0.0240.571 ± 0.0190.934 ± 0.0260.565 ± 0.017
Average RMSE0.868 ± 0.0220.753 ± 0.0200.967 ± 0.0240.758 ± 0.018
Table 7. Comparison of evaluation indicators of different optimized models.
Table 7. Comparison of evaluation indicators of different optimized models.
Evaluation IndicatorsSSAWOAESOAGOOSEIGOOSE
Average R20.585 ± 0.0150.623 ± 0.0140.598 ± 0.0150.642 ± 0.0130.663 ± 0.012
Average MAE0.675 ± 0.0190.585 ± 0.0160.667 ± 0.0180.531 ± 0.0140.526 ± 0.013
Average MSE0.910 ± 0.0220.799 ± 0.0180.870 ± 0.0200.521 ± 0.0150.511 ± 0.014
Average RMSE0.954 ± 0.0210.848 ± 0.0190.932 ± 0.0200.722 ± 0.0160.693 ± 0.015
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Guo, R.; Dai, Y. Leveraging IGOOSE-XGBoost for the Early Detection of Subclinical Mastitis in Dairy Cows. Appl. Sci. 2025, 15, 8763. https://doi.org/10.3390/app15158763

AMA Style

Guo R, Dai Y. Leveraging IGOOSE-XGBoost for the Early Detection of Subclinical Mastitis in Dairy Cows. Applied Sciences. 2025; 15(15):8763. https://doi.org/10.3390/app15158763

Chicago/Turabian Style

Guo, Rui, and Yongqiang Dai. 2025. "Leveraging IGOOSE-XGBoost for the Early Detection of Subclinical Mastitis in Dairy Cows" Applied Sciences 15, no. 15: 8763. https://doi.org/10.3390/app15158763

APA Style

Guo, R., & Dai, Y. (2025). Leveraging IGOOSE-XGBoost for the Early Detection of Subclinical Mastitis in Dairy Cows. Applied Sciences, 15(15), 8763. https://doi.org/10.3390/app15158763

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop