Background: Dairy safety has caused widespread concern in society. Unsafe dairy
products have threatened people's health and lives. In order to improve the safety of dairy products
and effectively prevent the occurrence of dairy insecurity, countries have established different prevention
and control measures and safety warnings.
Objective: The purpose of this study is to establish a dairy safety prediction model based on machine
learning to determine whether the dairy products are qualified.
Methods: The 34 common items in the dairy sampling inspection were used as features in this
study. Feature selection was performed on the data to obtain a better subset of features, and different
algorithms were applied to construct the classification model.
Results: The results show that the prediction model constructed by using a subset of features including
“total plate”, “water” and “nitrate” is superior. The SN, SP and ACC of the model were
62.50%, 91.67% and 72.22%, respectively. It was found that the accuracy of the model established
by the integrated algorithm is higher than that by the non-integrated algorithm.
Conclusion: This study provides a new method for assessing dairy safety. It helps to improve the
quality of dairy products, ensure the safety of dairy products, and reduce the risk of dairy safety.