3.1. The Effect of Pulsation Ratio and Removal Flow on Milking Characteristics
The use of the mixed model to predict the variables of AMT, milk yield, total low flow, peak time, peak flow, and removal flow allowed us to achieve interesting insights into the studied herd. The results with statistical differences for Trial 1 (puls 60:40 vs. puls 65:35) and Trial 2 (detach 600 vs. detach 800) are reported in
Table 1 and
Table 2, respectively.
Regarding the trial performed for the pulsation ratio (Trial 1), from the results it was found that there was no statistically significant difference in the milk yield, peak flow, or removal flow when the pulsation ratio was 60:40 compared to 65:35 (
p > 0.05). Instead, milking time (AMT) was significantly reduced, from 8.42 min to 7.97 min (
p < 0.0001); the peak time was significantly reduced, with a decrease of 7%, and the total low flow increased significantly, from 1.10 to 1.40 min. Milk yield increased slightly but not significantly in this sample (from 18.8 to 19.2 kg per session). Therefore, with the modification of the pulsation ratio from 60:40 to 65:35, the goal of reducing milking time was achieved. These results concur with studies on milking operations which concluded that the pulsation ratio needs to be varied so as to reduce the milking time [
17,
25,
26]. However, as suggested by Kaskous [
26], the reduction in milking time while increasing the pulsation ratio may compromise the udder health. Therefore, every change in the machine settings needs to be investigated in detail.
In Trial 2, the two different detachment flows were tested, which resulted in the differences shown in
Table 2. No statistically significant difference was found in the AMT, peak time or peak flow between the experimental group with a detachment equal to 800 g/min and the control group with a detachment of 600 g/min (
p > 0.05). Milk yield was statistically significantly lower (
p < 0.05) (18.5 and 17.8 kg in detach600 and detach800, respectively), as well as the total low flow (0.76 and 0.64 min in detach600 and detach800, respectively). The removal flow significantly improved (
p < 0.001) from 1.0 kg/min to 1.2 kg/min. Stauffer et al. [
36] found no differences in milk production when the cluster detachment flow changed, similarly to the findings of this study. This similarity was achieved even if Stauffer et al. [
36] used different detachment thresholds than in this experiment. Moreover, Besier and Bruckmaier [
37] stated that the earlier cluster detachment can slightly reduce milk yield with the benefit of milking time and teat health. Their study concluded that the best removal flow would be at least 600 g/min, which is consistent with this experiment.
Furthermore, in the literature, many researchers highlight the relevance of the vacuum pressure, showing that values around 43 kPa are optimal for both milk ejection and teat health. However, in this study the vacuum pressure was not changed.
3.2. The Effect of Pulsation Ratio and Removal Flow on SCC, Mastitis Incidences, and TS
To evaluate if the tested parameters influenced the udders’ health, the somatic cell count (SCC), expressed as a linear score, and the teat-end score (TS) were measured, and the statistical difference for each group was established. As reported in Atakan et al. [
38], it is important to monitor the TS because hyperkeratosis on the teat end is caused mainly by errors, high vacuum pressure of the milking machine, increased milk yield, prolongation of milking, dirtiness of the animals, and insufficient bedding. Therefore, reducing the milking time may help to reduce the TS of cows with a high average milking time. However, the higher vacuum pressure and other characteristics that were not monitored in this experiment (e.g., dirtiness and bedding) could also affect this result. Additionally, the TS is also important due to its relationship with a higher risk for mastitis and high SCC [
39]. However, as stated by Sharma et al. [
39] there are several reasons for a high concentration of SCC.
As a first consideration, the SCC was calculated as a linear score, so that values above 4 mean that the SCC was excessively high (>300,000 cells/mL). SCCs were also measured before the start of the trial, with the SCC-0 measurement referring to the measurement of SCC before the start of the trial. SCC-1, SCC-2, and SCC-3 refer to the three measurements taken during the experiment.
In the statistical analysis carried out with the GLIMMIX procedure, SCC-0 was included in the model, and SCC-1, SCC-2, and SCC-3 were predicted. From the model outcomes, the results shown in
Table 3 and
Table 4 were achieved. In particular, in Trial 1 (shown in
Table 3), SCCs were always higher when the pulsation ratio was set to 60:40; only in the second measurement was this difference not significant (
p > 0.05). In the three observations, the LSMs were below the threshold of 4, meaning somatic cells were <300,000/mL.
Running the same model for Trial 2, the SCC of detach600 was always significantly different from detach800. In SCC-1, the linear score was lower for detach600, while in SCC-2 and SCC-3 it was significantly higher (p < 0.0001). Furthermore, in this case, it must be highlighted that the SCC_3 was above 4, which corresponded to an SCC > 300,000/mL.
Considering the TS, five measurements were carried out in the experimental period, from September (TS-1) to December (TS-5). According to the classification by Mein et al. [
32], a teat-end score from 1 to 4 was given to each teat of the udder based on its hyperkeratosis level. Each TS was averaged for the front teats and for the back teats of each cow.
Table 5 shows the teats’ scores, averaged for front and back teats, for the experimental and control groups in the two separate trials. The mean TS was higher in the experimental group than in the control group in both trials. Teats showed a general increase in the hyperkeratosis with the progress of the experiment. Moreover, the TS of the back teats showed less damage than the front ones. However, fluctuations were observed. According to the data and the incidences of clinical mastitis, the reason for the fluctuations was due to some cows having developed serious mastitis in the period of the previous TS test, and after the antibiotics treatment, cows had a lower score.
Considering that the cows in Trail 1 were randomly selected from a herd with an average milking time higher than 8 min, it could be inferred that the longer milking time negatively influenced teat health, as also suggested by Odorčić et al. [
1].
In order to understand the statistical significance of these differences, the GLIMMIX model was carried out for the different TS. The results are reported in
Table 6 for Trial 1, and in
Table 7 for Trial 2.
In Trial 1, differences between the puls60:40 and puls65:35 were all significant. In all cases, the TS was higher in puls65:35 than puls60:40.
Regarding Trial 2, in all cases statistical differences were present between detach600 and detach800, with a better TS achieved when detaching the cluster at 600 g/min instead of 800 g/min.
Concerning the clinical mastitis,
Figure 1 shows the frequency of incidence of clinical mastitis during the tested trials. In all the cases, most of the cows were not infected during the experimental period. In Trial 1, 9–10% of cows had one case of clinical mastitis; in Trial 2, between 11 and 16% of cows encountered one case of clinical mastitis, with the control trial showing a higher frequency. Only 2% of cows had >2 cases of clinical mastitis, all in Trial 2.
3.3. Prediction of AMT and Removal Flow Based on SSA-LSSVM
The test environment for this study was CPU core i5-1135G7, 2.4 GHz, 16 G RAM, programmed with MATLAB R2019a (The MathWorks Inc., Natick, MA, USA). To compare the prediction performance of SSA-LSSVM with other machine learning models, i.e., the K-nearest neighbor (KNN), naive Bayes, decision tree, and linear discriminant analysis (LDA) were trained. Based on the above model, binary predictions were made for AMT (≥8 min and <8 min) and for removal flow (≥600 g/min and <600 g/min).
One thousand randomly selected samples were used to test the prediction performance of each model.
Table 8 and
Table 9 show the evaluation metrics of each model for the AMT prediction model and the removal flow prediction model, respectively. As shown in
Table 8, it can be observed that SSA-LSSVM achieved an accuracy equal to 92% and had the highest F1 score of 0.95, which makes it the best predictor of AMT. Additionally,
Table 9 presents that the removal flow prediction test results of SSA-LSSVM had the best performance, with the highest prediction accuracy (78%) and the highest F1 score (0.88). Based on the evaluation metrics of the model, it can be concluded that the prediction model developed is satisfactory for AMT and acceptable for removal flow. In addition, the same model had different predictive abilities for different objects. For example, LDA, which is only second to SSA-LSSVM in predicting AMT, was the worst among several models in predicting removal flow. From both
Table 8 and
Table 9, it can be observed that the LSSVM model optimized by SSA had a better accuracy, precision, recall, and F1 score than the unoptimized model (with no SSA). Therefore, the optimization of the LSSVM using the SSA algorithm was valid and effective.