| After the food quantity and safety is guaranteed,people pay more attention to the food quality and safety,and put forward higher requirements in food nutrition and hygiene.However,for the past few years,food safety accidents have continually appeared both here and abroad,such as the salmonellosis in the United States,the cadmium-contaminated rice in China,and the dioxin-contaminated chicken in Europe,which not only caused public panic,but also caused serious economic losses to various countries.Therefore,to guarantee the food quality and safety,reduce the food safety accidents,and prevent nutritional imbalance and environmental pollution risk in food from harming human health,the machine learning algorithms are taken as the core and the food safety detection data as the basis to study a highly reliable food safety risk early warning modeling method in this paper,and applies it to the food safety risk analysis and early waring of the dairy products and condiments.The main research contents are as follows:(1)Aiming at the problem that the qualified and unqualified status of a single detection index cannot reflect the comprehensive risk of food safety,a comprehensive evaluation method of food safety risk based on the improved analytic hierarchy process(AHP-SP)from the perspective of multi-indicator and multi-dimensional is proposed in this paper,which solves the shortcomings of strong subjective assumptions of the traditional AHP.The presented method firstly calculates the index weight based on the AHP-SP algorithm,then fuses the nutritional imbalance risk and the environmental pollution risk from the food safety detection data by the linear weighted synthesis method,and finally obtains the risk value that representing the risk size of the detection sample and carries out the risk classification,which provides a reliable data basis for building a food safety risk prediction and early warning model.(2)To improve the prediction accuracy and generalization ability of the food safety risk prediction model,a risk level prediction model of food safety based on grid search algorithm optimizing support vector machine(GS-SVM)is proposed,and the self-adaptive tuning of the SVM hyperparameters can be conducted by the GS algorithm.The risk classification results obtained by the AHP-SP based food safety risk evaluation method and the corresponding detection samples are used as historical statistical data to train the GS-SVM model to predict the risk level of a new batch of food safety detection samples and realize the food safety risk assessment.For foods whose risk assessment results do not contain high-risk samples,that is,foods with a higher level of quality and safety,it is not necessary to take further risk early warning measures.(3)For the food safety detection samples with high risk level assessed by the GS-SVM model,it is necessary to measure the implied risk and identify high-risk factors.Thus,to find out the development law of food safety risk and realize reliable food safety risk analysis and early warning,a food safety risk prediction model based on the improved adaptive particle swarm algorithm optimizing long short-term memory neural network(IAPSO-LSTM)is proposed.The proposed IAPSO algorithm can formulate personalized adaptive inertia weight according to the performance of different particles to update their speed and position,which overcomes the shortcomings that the traditional PSO algorithm converges to local optimum easily.Meanwhile,the high-risk factors in the detection samples can be identified by the correlation coefficient method,which provides decision-making basis for the development of targeted risk prevention and control work. |