Abstract

Ensuring food quality and safety is essential after ensuring the quantity of food. Therefore, an improved adaptive particle swarm optimization algorithm (IAPSO) for optimizing the long short-term memory (LSTM) neural network (IAPSO-LSTM) is proposed to develop a food safety risk early warning model in this paper. The proposed IAPSO algorithm is verified by comparing with the traditional PSO (TPSO), the classic PSO (CPSO), the adaptive PSO (APSO) and the deterministic and adaptive PSO (DAPSO) based on five common benchmark functions in terms of the convergence speed and precision. Results show that the IAPSO algorithm has the best convergence speed and precision. Then, the analytic hierarchy process based on the sum product is used to obtain the risk value of food safety detection data, which is used as the desired output of the LSTM. And the root mean square error of the predicted risk value and the real food risk value is used as the objective function of the IAPSO algorithm to optimize the hyperparameters of the LSTM. Finally, the food safety risk early warning model based on the IAPSO-LSTM is evaluated using the composite seasoning detection data from a food testing agency in Guizhou Province, China. The proposed model effectively identifies high-risk factors affecting the risk value, with sodium cyclamate being the primary high-risk factor. The overall performance of the IAPSO-LSTM model is superior to that of the TPSO-based LSTM, the CPSO-based LSTM, the APSO-based LSTM, the DAPSO-based LSTM and the IAPSO-BP, with the prediction error of 0.474, R2 value of 0.998 and the absolute error less than 5. Moreover, the proposed model can help the relevant government departments effectively warn the potential food safety risks to ensure the food safety.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call