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.

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

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.