In recent years,people’s dietary concept has changed from food and clothing to nutritious diet.In the process of transformation,due to the unreasonable diet leading to human health problems,the number of patients and deaths of chronic diseases is increasing year by year.The general healthy population should pay attention to their health,eat healthily,and prevent chronic diseases in the future.Based on the linear user model and the advantages of particle swarm optimization(PSO),this paper proposes a dynamic inertia weight based on the discrete degree of particle aggregation to quantify dietary recommendation.A KMSBCF combination recommendation algorithm is proposed to recommend preferential ingredients for users.The combination algorithm combines clustering,Slope One,user-based collaborative filtering and preference weights,in which preference weights integrate the time factor,probability and frequency related to the user’s diet.The purpose of this paper is to carry out a personalized dietary recommendation system for the diet of the general healthy population,so as to meet the needs of users’ dietary preferences and dietary diversity.Firstly,this paper calculates the daily calorie requirement of users according to their gender,weight,physical activity level and other factors.According to the calorie ratio provided by nutrients,it calculates the daily nutrient requirements of users.A simplified user nutrition model was used to quantify the recommended food from the perspective of deviation.The problem of solving user nutrition model is transformed into deviation problem,and then the improved particle swarm optimization algorithm is used to find the optimal value and solve the problem indirectly to ensure the diversity of recommendation results.The particle swarm optimization algorithm is improved by using the dynamic inertia weight based on the change of the degree of dispersion of particle aggregation.The simulation results show that the improved algorithm reduces the error from 5% to 1% compared with the ordinary particle swarm optimization algorithm,reduces the number of iterations to the optimal value by 200 times,and improves the accuracy and efficiency of the improved algorithm.Secondly,the collaborative filtering algorithm is improved and a KMSBCF combined recommendation algorithm is proposed.The algorithm combines clustering algorithm,Slope one,user-based collaborative filtering and preference weights.The preference weight combines the time factor,probability and frequency related to the user’s diet.The combination algorithm is validated by Movie Lens data set and compared with the recommendation results of user-based Collaborative filtering and Item-based Collaborative filtering.By comparing the average absolute error of the three algorithms,the average absolute error of KMSBCF algorithm is at least 0.6 lower than that of the other two algorithms.The combination recommendation algorithm has more accurate recommendation effect and can better reflect the user’s recent preference.Finally,we build a diet recommendation system,including front-end display,backstage and database.The platform adopts the popular technology framework at the present stage.The front end uses the Vue framework,the backstage Express framework and the database to use mongoose to realize the recommended daily preference diet for the users.Based on the study of the nutrition diet recommendation system,this study not only meets the nutritional needs of ordinary healthy users,but also provides users with diversified solutions,satisfying users’ recent preferences and providing users with suitable dietary recommendations. |