Method and device for predicting and evaluating health level of urban restaurant
Through multi-source data fusion and semantic mining image recognition technology, a city restaurant health level prediction model is constructed, which solves the problems of high evaluation cost and low efficiency in existing technologies, realizes the rapid and accurate evaluation of the health level of restaurants in the entire region, and supports the construction of healthy cities.
Patent Information
- Application Number
- CN202510920781.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-10-17
AI Technical Summary
In existing technologies, urban restaurant health assessment methods mostly focus on small samples or individual restaurants, which have high computational costs and low efficiency. It is difficult to conduct a comprehensive analysis of a large number of restaurants and cannot support large-scale city-scale restaurant health level assessments.
By acquiring multi-source data sets in the target area, including spatial vector data and health label data, data fusion processing is performed, multi-dimensional health evaluation feature vectors are extracted, a restaurant health grade prediction model is constructed, and semantic mining and image recognition are used for data completion to achieve health grade prediction at the full regional level.
It improves the comprehensiveness and accuracy of restaurant health assessments, reduces interference from human factors, enables rapid and objective assessment of urban restaurant health levels, supports large-scale urban dining environment analysis, and promotes the development of healthy cities.
Smart Images

Figure CN120806360A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of health assessment, and particularly relates to a city restaurant health level prediction and evaluation method and device. BACKGROUND
[0002] With the increasing frequency of urban residents going out to eat, the restaurant-based catering facilities constitute a rich and diverse urban dining environment, which significantly affects the dietary habits and health level of urban residents. Urban dietary health has become a core field in the construction of "healthy city", and optimizing the urban catering environment and improving the health service level are of great significance for improving the overall health of residents and promoting the development of healthy city. Accurate assessment of the health level of city restaurants is the key to understanding the health level of the urban dining environment.
[0003] However, the current method for evaluating the health of city-scale restaurants is still relatively scarce. The existing health level evaluation method of restaurants mainly focuses on the health analysis of small sample or individual restaurants, and usually evaluates the health level of the restaurant by detecting the nutritional components and calories of the representative dishes of the restaurant, but the calculation cost is high, the efficiency is low, and it is difficult to comprehensively analyze a large number of restaurants, so it is difficult to support the large-scale city-scale restaurant health level evaluation demand. SUMMARY
[0004] The purpose of the present application is to provide a city restaurant health level prediction and evaluation method and device to solve the problem that the health level evaluation method mainly focuses on the health analysis of small sample or individual restaurants, and usually evaluates the health level of the restaurant by detecting the nutritional components and calories of the representative dishes of the restaurant, but the calculation cost is high, the efficiency is low, and it is difficult to comprehensively analyze a large number of restaurants.
[0005] To achieve the above purpose, the present application provides the following technical scheme:
[0006] In a first aspect, the present application provides a city restaurant health level prediction and evaluation method, comprising:
[0007] S1: obtaining a multi-source data set of restaurants in a target area, wherein the multi-source data set comprises a spatial vector data set and a health label data set;
[0008] S2: performing fusion processing on the multi-source data to obtain a fusion data set, and constructing the fusion data set into a sample set and a to-be-predicted set according to a preset health label and a preset dish image quantity threshold;
[0009] S3: extracting a multi-dimensional health evaluation feature vector from the fusion data set based on semantic mining and image recognition;
[0010] S4: constructing a restaurant health level prediction model, based on the sample training set and optimizing the restaurant health level prediction model;
[0011] S5: based on the semantic similarity, the to-be-predicted set is completed to obtain a completed to-be-predicted set, the health evaluation feature vector is extracted from the completed to-be-predicted set, and the optimized restaurant health level prediction model is input, and the prediction data of the restaurant health level is output.
[0012] As a further scheme of the application: in step S1, the spatial vector data set is based on an online map platform to extract point of interest data, and the point of interest data includes the name of the restaurant, the cuisine, the average consumption price and the spatial position information;
[0013] The health label data set includes a restaurant menu image data set and a restaurant health evaluation data set, the restaurant menu image data set is based on an online review platform, and user restaurant evaluation data is obtained, the user restaurant evaluation data includes restaurant address, menu name set and corresponding image set, wherein the menu name set is the name of the menu with sales accounting for more than 20% of the total business volume,
[0014] The images in the image set are screened into an evaluation image set when the number of images is greater than or equal to a preset menu image number threshold, the evaluation image set is health scored based on a nutrition analysis and health monitoring platform, and is divided into several grades according to the health score and forms a restaurant health evaluation data set.
[0015] As a further scheme of the application: in step S2, based on the multi-source data set, the spatial vector data set, the restaurant menu image data set and the restaurant health evaluation data set are data fused according to the name of the restaurant and the restaurant address, including;
[0016] The preset health label is that the restaurant menu image data set of the restaurant includes the restaurant health evaluation data set;
[0017] Based on the field set, the combination processing relationship of the precise matching and the fuzzy matching of the spatial vector data set and the restaurant menu image data set is obtained to obtain associated data:
[0018] The data with missing spatial position information in the associated data is supplemented with spatial position information based on geographic coding to obtain the supplemented associated data;
[0019] The supplemented associated data is subjected to spatial deduplication processing, wherein the spatial deduplication processing retains one piece of data in the supplemented associated data with a spatial distance less than a preset distance value, that is, the corresponding supplemented associated data, to obtain a fusion data set;
[0020] According to whether the health label exists in the multi-source data set, it is divided into a sample set and a to-be-predicted set;
[0021] The greater than or equal to a preset dish image quantity threshold in the to-be-predicted set is divided into an image complete subset, otherwise, an image missing subset.
[0022] As a further scheme of the present application: in step S3, the cuisine in the interest point data is extracted as a cuisine feature based on semantic mining, and the cuisine categories are enumerated and numbered, and the serial number coding is used to convert them into classification variables, wherein the classification variables are used for model input data; the average consumption price in the interest point data is extracted as an average consumption price feature based on semantic mining;
[0023] The images in the restaurant dish image-text data set are identified as a food material feature based on image recognition; the visual information of the dishes in the images in the restaurant dish image-text data set is extracted as an image physical feature based on image recognition;
[0024] The image physical feature includes color, complexity, brightness change, brightness, and contrast, wherein the image physical feature is used to present the visual information of the dishes in the restaurant;
[0025] The cuisine feature, the average consumption price feature, the food material feature, and the image physical feature constitute a multi-dimensional health evaluation feature vector.
[0026] As a further scheme of the present application: in step S4, the health evaluation feature vectors extracted in the sample set are preprocessed, including,
[0027] A restaurant health grade prediction model is constructed.
[0028] The health evaluation feature vectors extracted in the sample set are normalized to obtain numerical variable data that can be used for machine learning.
[0029] The health evaluation feature vectors extracted in the sample set are divided into a training set and a validation set, wherein the training set accounts for 80% of the sample set, and the validation set accounts for 20% of the sample set.
[0030] The training set is input into the restaurant health grade prediction model for training, and the restaurant health grade prediction model is verified and optimized through the validation set to obtain an optimized restaurant health grade prediction model.
[0031] As a further scheme of the present application: the restaurant health grade prediction model further includes a feature importance ranking, which is used to evaluate and screen all input variables of the restaurant health grade prediction model to enhance the interpretability and running efficiency of the restaurant health grade prediction model.
[0032] As a further aspect of the present application: in step S5, the image missing subset in the to-be-predicted set is obtained, the menu name set in the image missing subset is obtained, the menu name set in the image missing subset is segmented based on natural language processing, and a first word vector representation data is generated;
[0033] The menu name set in the restaurant menu image data set is segmented based on natural language processing, and a second word vector representation data is generated. The first word vector representation data and the second word vector representation data are matched based on cosine similarity;
[0034] Pictures with a semantic similarity higher than a preset threshold in the first word vector representation data and the second word vector representation data are screened out to form a candidate image set, and pictures of dishes greater than or equal to a threshold are randomly extracted as a representative image set of the restaurant;
[0035] Based on the representative image set of the restaurant, the image physical features and the material features of the restaurant image set are extracted using the method of step S3, and the existing structured cuisine features and the per capita consumption price features are combined to construct a corresponding health evaluation feature vector;
[0036] The image complete subset and the image missing subset in the to-be-predicted set are used to predict the health level using the optimized restaurant health level prediction model in step S4, and prediction data of the health level of restaurants in the whole city target area is output.
[0037] In a second aspect, the present application provides a city restaurant health level prediction and evaluation device, which comprises:
[0038] A data acquisition module is configured to acquire a multi-source data set of restaurants in a target area;
[0039] A data fusion module is configured to fuse the multi-source data to obtain a fusion data set, and construct a sample set and a to-be-predicted set based on a preset health label and a preset dish image quantity threshold;
[0040] A feature extraction module is configured to extract a multi-dimensional health evaluation feature vector from the fusion data set based on semantic mining and image recognition;
[0041] A model training module is configured to construct a restaurant health level prediction model, and optimize the restaurant health level prediction model based on the sample training set;
[0042] A prediction and evaluation module is configured to complete the to-be-predicted set based on semantic similarity to obtain a completed to-be-predicted set, extract a health evaluation feature vector from the completed to-be-predicted set, and input the optimized restaurant health level prediction model to output prediction data of the health level of the restaurant.
[0043] In a third aspect, the present application provides a computer readable storage medium having computer readable instructions stored therein, which when executed on a communication device, cause the method to be performed.
[0044] Compared with the prior art, the present application has the following beneficial effects:
[0045] 1、In the present application, by fusing spatial vector data, dish image data and corresponding text data, a large-scale city-scale restaurant health rating prediction model is established through a machine learning model, by fusing multiple source data sets, the spatial information and health information of the restaurant are fully utilized, the comprehensiveness and accuracy of the prediction evaluation are improved, at the same time, based on semantic mining and image recognition, a multi-dimensional health evaluation feature vector is extracted, which provides more rich input information for the prediction model, through semantic similarity completion of the to-be-predicted set, the problem of data missing and incompleteness is effectively solved, and the health rating prediction of the whole region can be completed under the condition that the input restaurant health rating prediction model data is insufficient, which provides technical data basis for further analyzing the regional diet environment and health diet fairness, and has important significance for improving the overall health status of residents and promoting the development of healthy city.
[0046] 2、In the present application, the multi-source information of the restaurant is acquired through the multi-source data set, including the geographical position, the operating type, the dish picture and the description of the restaurant, etc., these data sets are integrated into a unified framework through specific data processing technology, which provides a comprehensive information basis for subsequent health rating prediction, through multi-source information processing, it is ensured that each piece of data can truly reflect the health status of the restaurant, through the automatic data collection and processing process, we can quickly acquire the multi-source information of the restaurant, and complete the preliminary evaluation of the health rating in a short time, which not only greatly improves the evaluation efficiency, but also makes the evaluation process more objective and fair, and reduces the interference of human factors. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 It is a method flow structure schematic diagram of the present application;
[0048] Figure 2 It is a restaurant distribution schematic diagram of four health ratings in a certain city land range provided in embodiment one of the present application. DETAILED DESCRIPTION
[0049] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0050] Embodiments:
[0051] Please refer to Figure 1 In the embodiments of the present application, a city restaurant health grade prediction and evaluation method comprises:
[0052] S1: Obtain a multi-source data set of restaurants in a target area, wherein the multi-source data set comprises a spatial vector data set and a health label data set;
[0053] S2: Fuse the multi-source data to obtain a fused data set, and construct the fused data set into a sample set and a to-be-predicted set according to a preset health label and a preset dish image quantity threshold;
[0054] S3: Extract a multi-dimensional health evaluation feature vector in the fused data set based on semantic mining and image recognition;
[0055] S4: Construct a restaurant health grade prediction model, and optimize the restaurant health grade prediction model based on a sample training set;
[0056] S5: Complete the to-be-predicted set based on semantic similarity to obtain a completed to-be-predicted set, extract a health evaluation feature vector from the completed to-be-predicted set, and input the optimized restaurant health grade prediction model to output prediction data of the restaurant health grade.
[0057] Specifically, the present application fuses spatial vector data, dish image data and corresponding text data, establishes a large-scale city-scale restaurant health grade prediction model through a machine learning model, fully utilizes the spatial information and health information of the restaurant by fusing the multi-source data set, improves the comprehensiveness and accuracy of the prediction and evaluation, extracts a multi-dimensional health evaluation feature vector based on semantic mining and image recognition, provides more abundant input information for the prediction model, effectively solves the problem of data loss and incompleteness by completing the to-be-predicted set based on semantic similarity, can complete the health grade prediction of the whole area level under the condition of insufficient input restaurant health grade prediction model data, provides technical data basis for further analyzing the regional diet environment and health diet fairness, and has important significance for improving the overall health status of residents and promoting the development of healthy cities.
[0058] Further, the multi-source data set obtains the multi-source information of the restaurant, including the geographical position, business type, dish picture and description, etc. of the restaurant. These data sets are integrated into a unified framework through specific data processing technology, providing a comprehensive information base for subsequent health level prediction. Through multi-source information processing, it is ensured that each piece of data can truly reflect the health status of the restaurant. Through the automatic data collection and processing process, we can quickly obtain the multi-source information of the restaurant and complete the preliminary assessment of the health level in a short time. Not only does it greatly improve the assessment efficiency, but also makes the assessment process more objective and fair, reducing the interference of human factors. The integration and utilization of multi-source data set is of great significance to realize the rapid and accurate assessment of the health level of the restaurant.
[0059] Preferably, in step S1, the multi-source data set related to the restaurant health assessment in the target area of study is collected, and the multi-source data set D1={D s ,D p ,D h} is constructed. s Based on the online map platform, the point of interest (POI) data is extracted, including the name of the restaurant, the cuisine X t , the average consumption price X p and the spatial position information (lon, lat) and other structured attributes.
[0060] Among them, the restaurant can register on the online map platform and fill in the detailed information, including the name, cuisine, average consumption price, etc. At the same time, relevant pictures, business hours, etc. are uploaded. The platform will audit these information, and after the audit is passed, it will be displayed to the user; data cooperation: the online map platform will cooperate with third-party data providers to obtain the relevant information of the restaurant. These third-party data providers may collect data through various channels, such as offline research, industry database, data integration of other platforms, etc.; user contribution: users can evaluate and feedback the restaurant in the process of using the online map platform, including the name of the restaurant, the cuisine, the consumption price, etc. The platform will supplement and update the restaurant information according to the feedback and evaluation of a large number of users; crawler technology: the platform may also use web crawler technology to grab the relevant information of the restaurant from other websites (such as food review websites, restaurant official websites, etc.). The online map platform includes Gaode Map, Baidu Map and Tencent Map, etc.
[0061] The health label data set includes the restaurant menu picture text data set D p and the restaurant health evaluation data set D h, the restaurant menu text data set is based on an online review platform, and the online review platform is an Internet-based service platform that allows users to evaluate and share experiences of various businesses, products, services or activities. These platforms cover a wide range of fields such as catering, hotels, tourism, shopping, education, medical care, etc., including Dianping, Meituan, and Huibao, and the user restaurant review data obtained includes restaurant address, menu name set N = {n1, n2,..., n k} and its corresponding image set I = {I1, I2,..., I k}, wherein the menu name set is the name of the menu with sales accounting for more than 20% of the total turnover of the restaurant, that is, the restaurant menu text data set D p includes hot-selling dishes;
[0062] The images in the image set are filtered into an evaluation image set when the number of images is greater than or equal to a preset menu image number threshold (the preset menu image number threshold m is 5-15, preferably 10). The evaluation image set is scored based on a nutrition analysis and health monitoring platform, and is divided into several grades based on the health score and forms a restaurant health evaluation data set.
[0063] Restaurants with at least a preset number of menu pictures are screened and scored based on a nutrition analysis and health monitoring platform, and their image set I is scored and recorded as H□.
[0064] According to the distribution of H□, it is divided into four grades: healthy (4), sub-healthy (3), sub-healthy (2), and unhealthy (1), to form a restaurant health evaluation data set: L = {l i};
[0065] Among them, H□ is divided into four grades, specifically, first, the data is analyzed for density distribution to understand the distribution characteristics of the data, then according to the analysis results, the data is classified using the natural breakpoint method, 5-4 (not including 4) is healthy (4), 4-3 (not including 3) is sub-healthy (3), 3-2 (not including 2) is sub-healthy (2), and less than or equal to 2 is unhealthy (1);
[0066] Among them, the nutrition analysis and health monitoring platform can analyze the content of various nutrients such as protein, fat, carbohydrate, vitamin and mineral contained in these foods according to the user input diet information such as food type and quantity, and compare it with the daily nutritional needs of the human body, provide nutrition intake assessment for the user, point out whether there is a problem of excessive, insufficient or unbalanced nutrition, and may also give targeted dietary adjustment suggestions. Nutrition analysis and health monitoring platforms include Xiaojing health app, eat right app, pocket physical examination app, love burning official version, life app, etc.
[0067] Preferably, in step S2, based on the multi-source data set, the spatial vector data set D s , the restaurant menu text data set D p and the restaurant health evaluation data set D h are fused and processed, including;
[0068] The pre-set health label is the restaurant menu text data set D p including the restaurant health evaluation data set D h ; that is, the health label restaurant set is defined as:
[0069]
[0070] D h is a subset of D p with a health score label; based on the unique identification of the name of the restaurant R i , the records in D p that completely match the name of the restaurant in D h are supplemented with the health score label l i ∈{1,2,3,4}:
[0071] D ' p =D p ∪{(R i ,l i )|R i ∈D h};
[0072] Based on the field set {name, address}, the combination processing relationship of the accurate matching and fuzzy matching of the spatial vector data set D s and the restaurant menu text data set D p is constructed to obtain the associated data D link :
[0073] That is, D link =Match{D s ,Dp}
[0074] where Match represents the combination of exact match and fuzzy match (e.g. Levenshtein distance greater than a preset distance threshold 85%), and the preset distance threshold is 20-50 meters;
[0075] The associated data D link with missing spatial location information is supplemented with spatial location information based on geocoding to obtain the supplemented associated data D link ; that is, the data with missing spatial location information in D link is supplemented with spatial location information using a geocoding service:
[0076] wherein Ri is the data with missing spatial location information in the associated data D link , and geocode is a geocoding process that converts geographic information (such as address, place name, etc.) into geographic coordinates (such as longitude and latitude);
[0077] The supplemented associated data D link is subjected to spatial deduplication processing, wherein the spatial deduplication processing removes the data with a spatial distance less than a preset distance value in the supplemented associated data D link , that is, one of the supplemented associated data D link is retained to obtain a fusion data set; that is, the spatial deduplication processing is performed on the duplicate records in D link , and two records R i and R j are considered to be duplicates if they satisfy:
[0078] name i = name j and dist((lon i , lat i ), (lon j , lat j )) < 25m
[0079] and only one record is retained, and the fusion data set is formed after deduplication:
[0080] D = Clean(D link )
[0081] According to whether there is a health label in the multi-source data set, it is divided into a sample set and a to-be-predicted set;
[0082] That is, whether there is a health score label l i is used as the first layer of division basis to divide the multi-source data set D1 into two categories:
[0083] Sample set (labeled):
[0084] D r = {R i ∈ D | I i exists}
[0085] To-be-predicted set (unlabeled):
[0086] D R = D \ D r
[0087] The preset dish image quantity threshold is a preset value (the preset dish image quantity threshold m is 5-15, preferably 10);
[0088] The to-be-predicted set is divided into an image complete subset if the number of images is greater than or equal to the preset dish image quantity threshold, and is divided into an image missing subset otherwise. That is, the to-be-predicted set D R is further subdivided into:
[0089] Image complete subset:
[0090] D R1 = {R i ∈ D R | I i ≥ m}
[0091] Image missing subset:
[0092] D R2 = D R \ D R1
[0093] The above sample set division ensures that the restaurant health level prediction model uses only the sample set D r with complete supervision labels in the training stage, and can use D R1 and D R2 respectively according to the image completeness in the inference stage, thereby improving the model generalization ability, fault tolerance and prediction coverage.
[0094] Preferably, in step S3, the cuisine in the point of interest data is extracted as a cuisine feature based on semantic mining, and the cuisine categories are enumerated and numbered, and the serial number coding method is used to convert them into classification variables, wherein the classification variables are used for model input data; that is, the cuisine feature X t : extracted from the “belonging cuisine” in the restaurant structured field, the cuisine categories are enumerated and numbered, and the serial number coding method is used to convert them into classification variables as model inputs, and the cuisine category group includes Lu cuisine, Sichuan cuisine, Cantonese cuisine, Huaiyang cuisine, Fujian cuisine, Zhejiang cuisine, Hunan cuisine, Anhui cuisine, Beijing cuisine and Hubei cuisine;
[0095] The average consumption price in the point of interest data is extracted as the average consumption price feature based on semantic mining, that is, the average consumption price feature X p : The average consumption price is extracted as a continuous variable;
[0096] The image in the restaurant menu image-text data set is identified as a food material feature based on image recognition, that is, the food material feature X i : The food material words are extracted from the image recognition results. Based on the hot-selling dish names, the food material components of the hot-selling menu pictures of the restaurant are identified based on the food image recognition model, and the online image recognition open interface platform recognition results are supplemented. The final food material feature set X is formed by fusing and deduplicating the multi-source recognition results. i
[0097] The visual information of the dish in the image in the restaurant menu image-text data set is extracted as an image physical feature based on image recognition.
[0098] The image physical feature includes color X col , complexity X com , brightness change X sf , brightness X b , contrast X con , wherein the image physical feature is used to present the visual information of the dish in the restaurant.
[0099] The cuisine feature, the average consumption price feature, the food material feature, and the image physical feature constitute a multi-dimensional health evaluation feature vector.
[0100] Specifically, the feature vector is composed as follows: X = {X t , X p , X i , X f}
[0101] Which includes:
[0102] X t : The cuisine feature reflects the type of dishes operated by the restaurant;
[0103] X p : The average consumption price feature reflects the consumption level of the restaurant;
[0104] X i : The food material feature is analyzed by a text semantic and image recognition dual channel;
[0105] X f : The image physical feature reflects the visual structure and cooking method of the dish
[0106] The image physical feature X f : presents the visual information of the representative dish in the restaurant, which can reflect the cooking method of the dish.f Color X col , complexity X com , brightness variation X sf , brightness X b , contrast X con .
[0107] Color X col Calculation: Calculate the average proportion of red, green, and blue channels on non-white pixels in the top ten best-selling dishes pictures of the restaurant as the color feature X of the restaurant col ;
[0108] For the jth best-selling dish picture of the ith restaurant: let the number of all non-white pixels in the image be P ij , and the red, green, and blue channel values of the kth non-white pixel be R ij , G ij , and B ij .
[0109] The average proportion of R, G, and B of each image is defined as follows:
[0110]
[0111] The restaurant-level color feature is a vector composed of the average values of the three channels in the top ten pictures:
[0112]
[0113] That is, the restaurant color feature is a three-element tuple of the average proportion of non-white area brightness of RGB three channels.
[0114] Complexity X com Calculation: Calculate the ratio of the number of different object contour-related pixels to the total number of non-white pixels in each of the top ten best-selling dishes pictures of the restaurant, and the average value of the complexity of the ten best-selling dishes pictures as the complexity feature X of the restaurant com ;
[0115] For the jth best-selling dish picture of the ith restaurant: let the number of object contour pixels in the image be C ij , and the total number of non-white pixels be P ij ;
[0116] The complexity of a single image is
[0117]
[0118] Take the average of the top ten pictures to get the restaurant-level complexity feature:
[0119]
[0120] Brightness variation Xsf Calculate: Calculate the radial average of the two-dimensional power spectrum of the two-dimensional fast Fourier transform of the grayscale image of the top ten best-selling dishes in the restaurant picture; the average of the radial average of the 10 best-selling dish pictures as the brightness variation feature X of the restaurant sf ;
[0121] For the jth best-selling dish picture of the ith restaurant: convert it to a grayscale image, perform a two-dimensional fast Fourier transform (FFT) to get a frequency domain image; Calculate the radial average of its power spectrum density, denoted as F ij ;
[0122] The restaurant-level brightness variation feature is:
[0123]
[0124] Brightness X b Calculate: Calculate the difference between the average brightness of all non-white pixels in the top ten best-selling dish picture grayscale image of the restaurant and the white background; The average of the difference values of the 10 best-selling dish pictures as the brightness X of the restaurant b ;
[0125] For the jth best-selling dish picture of the ith restaurant: the brightness values of all non-white pixels in the grayscale image are denoted as the set Where k represents the kth pixel;
[0126] Calculate the average brightness of each picture:
[0127]
[0128] The white background brightness value is set to 255, and the brightness difference value is:
[0129] D ij = 255-μ ij
[0130] The restaurant-level brightness feature is:
[0131]
[0132] Contrast X con Calculate: Calculate the standard deviation of the brightness of all non-white pixels in the top ten best-selling dish picture grayscale image of the restaurant; The average of the standard deviations of the 10 best-selling dish pictures as the contrast X of the restaurant con ;
[0133] For the jth best-selling dish picture of the ith restaurant: the brightness values of all non-white pixels in the grayscale image are denoted as the set Where k represents the kth pixel;
[0134] The standard deviation of the brightness of non-white pixels is denoted as Then:
[0135] The contrast ratio of restaurant-level images is:
[0136]
[0137] Preferably, in step S4, the sample set D r The extracted health evaluation feature vector is preprocessed, including:
[0138] Based on the sample set D constructed in step S2 r , taking the restaurant health evaluation dataset l i ∈{1,2,3,4} as the dependent variable, and the health evaluation feature vector X extracted in step S3 i ={X t ,X p ,X i ,X f} as independent variables to construct a restaurant health rating prediction model;
[0139] The sample set D r The health evaluation feature vector extracted from the dataset is normalized to obtain numerical variable data that can be used for machine learning; that is, the health evaluation feature vector (such as per capita consumption price X p , image physical features X f etc.) Min-Max normalization is used to eliminate the dimension effect;
[0140]
[0141] For categorical features (such as cuisine X t ) Use One-Hot encoding to convert it into a numerical variable form that can be used for machine learning;
[0142] The sample set D r The extracted health evaluation feature vectors are divided into a training set and a validation set, where the training set accounts for 80% of the sample set and the validation set accounts for 20% of the sample set;
[0143] The training set is input into the restaurant health grade prediction model for training, and the restaurant health grade prediction model is verified and optimized through the validation set to obtain the optimized restaurant health grade prediction model; the sample set D r The extracted health evaluation feature vectors are divided into a training set (80%) and a validation set (20%), which are used for model fitting and performance evaluation respectively. The present invention adopts the Random Forest Classifier as the basic modeling method, and adjusts the parameters by combining Grid Search with Cross-Validation technology. The key parameters include: the number of decision trees ntrees , maximum depth d max , minimum split sample number n min .
[0144] Further, during the parameter adjustment process, attention is paid to the multiple evaluation indicators of the model on the validation set, mainly including accuracy (Accuracy), recall (Recall) and F1 value (F1-score).
[0145]
[0146] Taking recall rate as the core optimization goal, it is ensured that the model has high sensitivity and recognition ability when identifying healthy (4), sub-healthy (3), under-healthy (2), and unhealthy (1) class labels;
[0147] In order to further improve the stability and generalization ability of the model, a feature importance sorting mechanism is introduced during the training process to screen the feature variables.
[0148]
[0149] At the same time, combined with the regularization strategy, the interference of redundant information is effectively inhibited, and overfitting of the model is avoided. Finally, based on the comprehensive performance of each evaluation indicator in the cross-validation process, the parameter combination with the best performance is determined, and the final restaurant health grade prediction model M0 is obtained.
[0150] Preferably, in step S5, the image missing subset in the to-be-predicted set is obtained, the dish name set in the image missing subset is obtained, the dish name in the image missing subset is segmented based on natural language processing, and the first word vector representation data is generated;
[0151] The restaurant dish image-text data set D p The dish name set N = {n1, n2,..., n k} in the restaurant dish image-text data set D f is segmented based on natural language processing, and the second word vector representation data is generated. The first word vector representation data and the second word vector representation data are matched in cosine similarity;
[0152] The pictures with semantic similarity higher than a preset threshold in the first word vector representation data and the second word vector representation data are screened out to form a candidate image set P0, and the pictures of dishes greater than or equal to the threshold are randomly extracted as a representative image set of the restaurant;
[0153] Based on the representative image set of the restaurant, the image physical features X f and the material features X i of the restaurant image set are extracted using the method of step S3, and the existing structured cuisine features X t and the per capita consumption price features X p, and construct a corresponding health evaluation feature vector;
[0154] The image complete subset and the image missing subset in the to-be-predicted set are subjected to health level prediction using the restaurant health level prediction model M0 optimized in step S4, and prediction data L of the health level of the restaurants in the whole city target region are output. R .
[0155] The application provides a city restaurant health level prediction and evaluation device, and the device comprises:
[0156] A data acquisition module is configured to acquire a multi-source data set of the restaurants in the target region.
[0157] A data fusion module is configured to fuse the multi-source data to obtain a fused data set, and construct the fused data set into a sample set and a to-be-predicted set according to a preset health label and a preset dish image quantity threshold.
[0158] A feature extraction module is configured to extract a multi-dimensional health evaluation feature vector in the fused data set based on semantic mining and image recognition.
[0159] A model training module is configured to construct a restaurant health level prediction model, and train the restaurant health level prediction model based on the sample training set.
[0160] A prediction and evaluation module is configured to complete the to-be-predicted set based on semantic similarity to obtain a completed to-be-predicted set, extract a health evaluation feature vector from the completed to-be-predicted set, and input the health evaluation feature vector into the optimized restaurant health level prediction model, and output prediction data of the health level of the restaurant.
[0161] The application provides a computer readable storage medium, wherein the computer readable storage medium stores computer readable instructions, and when the computer readable instructions are executed on a communication device, the above-mentioned method is executed.
[0162] Embodiment one:
[0163] The health degree of 110,000 restaurants in a city is evaluated.
[0164] Specifically, the steps are as follows:
[0165] S1, collect multi-source heterogeneous data related to restaurant health evaluation in the research city range, and construct a data set group
[0166] D 1={D s ,D p ,D h}
[0167] The data set group includes structured spatial information, user-generated content information, and artificial health evaluation labels.
[0168] Spatial vector dataset D s POI data interface from online map platform (Gaode map). Extract all valid restaurant records in the city range with "catering" category as the keyword. The research range in this embodiment is the land part of Shanghai city, and a total of 103,482 initial records are collected. After cleaning by structured query language (SQL), the entries with "suspended business" status or no user evaluation record are removed, and the remaining fields include:
[0169] The name of the restaurant (such as "Shuxiangge");
[0170] The cuisine it belongs to X t (such as "Sichuan cuisine", "Banhang cuisine");
[0171] The average consumption price per person X p (such as 78.5 yuan);
[0172] Spatial position coordinates (lon, lat) (lon, lat) (lon, lat) (such as 121.4863, 31.2347).
[0173] The above data is stored in shapefile format, and the geographic reference coordinate system is set to WGS1984.
[0174] Hot restaurant menu text and image dataset D p Collected from platforms such as Dianping and others through web crawlers, including the set of popular menu names of each restaurant N = {n1, n2, …, n k}, and the corresponding image set I = {I1, I2, …, I k}. The popular menu ranking is automatically updated by the platform based on user evaluation likes and hotness index, with significant timeliness.
[0175] For example, the restaurant "Chuanweilou" contains popular dishes such as "Maoxu Wang" and "Suanla Fen" in D p , with 12 user-uploaded dish images. Some restaurant records have missing images or insufficient number of images, which will be handled differently in subsequent sample selection and model prediction.
[0176] Statistics show that among the total of 16,894 restaurants, there are 15,843 restaurants with at least one picture (image coverage rate about 37.93%), of which 1,051 samples with ≥10 hot-selling menu images are used as important data basis for subsequent modeling.
[0177] Restaurant health evaluation dataset D h Based on image crowdsourcing scoring. The health score of restaurant i is H i .
[0178] Score set H = {H1, H2,..., H n} is divided into 4 health grades by natural break method after density distribution analysis, and a health grade label set L = {1, 2, 3, 4} is constructed.
[0179] Corresponding to “unhealthy”, “less healthy”, “sub-healthy”, and “healthy” respectively.
[0180] For example, the average score of the hot-selling picture in the restaurant “Nanxiang Steamed Bun Restaurant” is 3.72, corresponding to the health grade “sub-healthy” (3); while the average score of the image in “Crispy Chicken Restaurant” is 2.15, corresponding to the “less healthy” (2) grade.
[0181] The above data set D s , D p , and D h provide basic input for subsequent image feature extraction (S3), classification modeling (S4), prediction completion (S5), and other modules. Among them:
[0182] D s is used to provide structured attributes and spatial information;
[0183] D p is used to provide image and text semantic features;
[0184] D h is used to provide health labels required for supervised learning;
[0185] After data fusion processing, the three constitute a complete modeling sample system D.
[0186] S2, based on the multi-source data collected in step S1, the restaurant POI spatial data set D s , the hot-selling restaurant menu image and text data set D p , and the restaurant health evaluation data set D h are fused and processed, and training sample sets and prediction sample sets are constructed according to label availability and image completeness.
[0187] S2-1, health label supplement. The restaurant health evaluation data set D h is regarded as a subset of the image and text data set D p , and the name field R i of the restaurant is used as the primary key for exact matching operation. For successfully matched records, a health grade label field l i is added in D p to represent the health score grade of the restaurant (value range is 1-4). For example, restaurant A “Shuxiangge” has 12 hot-selling menu images in D p , and in D hIf there exists its health label information in D i .
[0188] S2-2, structured field fusion. Using the field of "name of restaurant + address" to match D s and D p , and build the preliminary association table D link . The matching process uses a double strategy:
[0189] Exact match: two fields are completely consistent and merged;
[0190] Fuzzy comparison: when the string similarity (Levenshtein distance) exceeds the 85% threshold, it is considered as a record that can be merged.
[0191] For example, the restaurant "Xiaoguan Sushi" has an address of "Xiaoqu Xxhao Road, District" in D s , and is recorded as "Xiaoqu Xxhao Road Xiaoguan Sushi" in D p . The system confirms the matching success and completes the field merging based on the fuzzy matching algorithm.
[0192] S2-3, geocoding completion. For restaurant samples that only exist in D p but lack spatial coordinate information (i.e. lack of longitude and latitude fields), use Python to call the geocoding API of Gaode Map or Baidu Map, and complete the longitude and latitude fields through address resolution, to ensure that all samples have spatial attributes for subsequent spatial analysis.
[0193] S2-4, deduplication and cleaning. Perform spatial deduplication on the fusion results in D link . The judgment criteria are as follows:
[0194] The name of the restaurant is completely consistent;
[0195] The spatial distance is less than 25 meters.
[0196] Records that meet the above conditions are considered to be the same restaurant, and only one record with higher information integrity is retained.
[0197] For example, the restaurant "Chuanwei Building" has two records in the two platforms, with a spatial distance of only 17.2 meters. The system automatically identifies it as a duplicate and retains the one with higher ratings.
[0198] Finally, the deduplicated fusion dataset is formed, denoted as D.
[0199] S2-5, training set and prediction set division. According to whether the health score label field l i is included, the fusion dataset D is divided into the first layer:
[0200] Sample restaurant dataset D r : with label l i , for supervised model training;
[0201] Restaurant dataset D R to be predicted r : lack of label, as model extrapolation object.
[0202] For example, the restaurant "Old Street Noodle Shop" has 12 images in D but no health label, so it is included in D R .
[0203] S2-6, prediction set subdivision. The samples in D R are divided into two layers according to whether the number of images is greater than or equal to 10:
[0204] Image complete subset D R1 : with at least 10 images of best-selling dishes, sufficient image information, which can be directly used for inference;
[0205] Image missing subset D R2 : less than 10 images, which needs to be processed by image completion strategy.
[0206] For example, the restaurant "E·Hui State Family" has 11 images of best-selling dishes and no label, and is included in D R1 ; while "F·Jinxiang Building" contains only 4 images, and is included in D R2 .
[0207] Through the above two-level division, it is ensured that:
[0208] Model training stage only uses high-quality, complete sample dataset D r , to improve classification accuracy; inference stage processes D R1 and D R2 according to the data completeness, to improve the robustness, scalability and generalization ability of the model.
[0209] S3, in this embodiment, to construct the health level classification model of urban restaurants, multi-source heterogeneous feature variables are extracted from the dataset D. The extraction process is performed according to the following steps:
[0210] S3-1, cuisine feature extraction: extracted from the "belonging to the cuisine" field in each restaurant record, through the construction of a mapping dictionary of cuisine and number, the text type category (such as "Sichuan cuisine" "Hubei cuisine" etc.) is converted into a numerical variable that can be used for modeling. According to the model requirements, the code is further converted into One-Hot encoding vector form, and the mapping dictionary is uniformly constructed in the data preprocessing stage to ensure that the cuisine dimension of all sample restaurants is consistent.
[0211] S3-2, Extracting the price per capita: Using Pandas to extract the structured field "price per capita"; truncating outliers (0 yuan or extremely high values); and keeping it as a continuous variable, which is then processed in the normalization module.
[0212] S3-3, Food material feature extraction: The top 10 best-selling dishes of each restaurant are sent to the image recognition engine one by one, and the convolutional neural network trained on the dataset of VireoFood-172 is called to perform multi-label classification. At the same time, the online image recognition API of Clarifai platform is called to perform redundant recognition on the image content. The two results are output in the form of keyword sets, which are merged and de-duplicated to form a fixed-dimensional food material word vector, indicating whether a certain food material is included. The feature is finally encoded in 0-1 to form a high-dimensional sparse vector, with a dimension equal to the size of the set of all possible food material keywords.
[0213] S3-4, Image physical feature extraction: For the top 10 best-selling dishes of each restaurant, the following five features are extracted in turn:
[0214] Color feature: Using OpenCV and NumPy in Python, first convert each image to an RGB channel matrix and filter out white background pixels. Then calculate the average R / G / B channel value of all non-white pixels and keep the three-dimensional channel vector. Finally, take the average of all image color vectors as the restaurant color feature.
[0215] Complexity feature: Using Canny edge detection and binary image processing, after grayscale conversion, the cv2.Canny algorithm of OpenCV is applied to extract the edge profile. Calculate the ratio of edge pixel number to total number of non-white pixels, and take the average of the 10 images to get the complexity score.
[0216] Brightness variation feature: Using FFT frequency spectrum analysis, convert the image to a grayscale matrix and perform two-dimensional fast Fourier transform np.fft.fft2. After centering the spectrum, calculate the radial energy distribution and output the radial average. Take the average of the 10 images as the restaurant's brightness frequency domain feature.
[0217] Average brightness feature: First, exclude the white pixel area close to 255 based on the grayscale image, then calculate the average grayscale value of the remaining pixels, use 255-average to represent the brightness intensity, and finally calculate the brightness difference of the average 10 images to get the overall brightness feature of the restaurant.
[0218] Contrast feature: Calculate the fluctuation degree of the brightness of all non-white pixels using the standard deviation method to reflect the visual tension of the image grayscale. Finally, take the average of the standard deviations of all images to output the restaurant contrast score.
[0219] After the calculation of each image feature in each picture, the arithmetic mean of the ten pictures is calculated to form the five-dimensional image feature vector of the restaurant. After feature processing, all continuous variables enter the standardization process, and the category variables are converted into a model-readable encoding format, which constitutes the input data set of the restaurant health grade prediction model.
[0220] S4, in this embodiment, for the sample restaurant data set D r The system realizes the automatic identification of the health grade of the restaurant by building a multi-classification prediction model. This process includes three stages: feature preprocessing, model training and optimization, and feature importance screening.
[0221] S4-1, feature preprocessing:
[0222] Before modeling, the health evaluation feature vector extracted from the sample set is first standardized and converted. Numerical features include the average consumption price and the multi-dimensional physical properties extracted from the image. In order to eliminate the dimensional difference, interval normalization (Min-Max Normalization) is used to compress it to the range of [0, 1]. The normalization operation is completed by batch calculation in the feature engineering module, and the scaling coefficient is recorded simultaneously to maintain the standard in the subsequent inference stage.
[0223] For category variables such as restaurant cuisine, a one-hot encoding method is used to build a classification variable matrix, each category corresponds to a binary vector, ensuring the distinguishability and semantic independence of the model input. During the encoding process, a cuisine index table for the whole sample is established to ensure consistency of encoding between the training set and the prediction set.
[0224] S4-2, model construction and parameter optimization:
[0225] In the restaurant health grade prediction model construction stage, the system divides the data set D r into training set and validation set with a default ratio of 80% and 20%. The random forest method in ensemble learning is selected as the classifier, which has strong non-linear expression ability and robustness, and is suitable for processing data structures with high feature dimension and mixed variable types.
[0226] To further improve the model accuracy and adaptability, the system introduces a hyperparameter search mechanism to systematically optimize multiple structural parameters. The main adjustment items include: the number of decision trees (selected from 100 to 300), the maximum depth of each tree (set to 10, 20 or unlimited), and the minimum sample size when dividing tree nodes (set to 2, 5 or 10). The combination of hyperparameters is evaluated by cross-validation technology to ensure the robustness and generalization ability of the search results.
[0227] Model performance evaluation metrics include overall accuracy, recall for each label, and weighted F1 score. Recall was set as the primary optimization objective, with a focus on improving the sensitivity of low-health categories (such as "underhealthy" and "unhealthy"). A macro-averaging strategy was used to uniformly process all label metrics, ensuring that the classifier maintains balanced predictions despite uneven sample distribution.
[0228] S4-3, Feature Screening and Model Confirmation:
[0229] To enhance the interpretability and operational efficiency of the restaurant health rating prediction model, a feature importance ranking mechanism was introduced after the model was fitted to evaluate and screen all input variables. This mechanism quantifies the contribution of each feature to the prediction task based on the information gain generated by the decision tree node split. The system automatically generates an importance score table and removes redundant variables with extremely low weights based on a set threshold, retaining a subset of features with a cumulative contribution exceeding 90%.
[0230] In addition, to prevent the restaurant health grade prediction model from overfitting the training samples, a series of regularization control strategies are introduced into the entire modeling process, including limiting the tree depth, controlling the number of leaf node samples, and enabling sample sampling ratios, to ensure the moderate simplification of the restaurant health grade prediction model structure and the improvement of generalization performance.
[0231] Finally, combining the various evaluation results from the cross-validation process, the system selects the optimal model parameter combination and outputs the restaurant health rating prediction model M0. This model serves as the core computational unit in the subsequent inference phase and is suitable for predicting the health rating of unlabeled restaurants within a city.
[0232] S5, in this embodiment, in order to realize the health level prediction and evaluation of restaurants in the whole city, for the dataset to be predicted D R In the case of a large number of samples but incomplete information, D R1 With D R2 Different processing schemes are formulated for the two types of data. Especially for the subset D with missing image information R2 , the feature dimensions are completed by semantic graph complementation, so that the feature space remains consistent with the training set, ensuring the accuracy and generalization ability of the model reasoning process.
[0233] S5-1, semantic modeling and dish vector construction: For D R2In the case of a restaurant lacking sufficient hot-selling dish images, first extract the dish name field, and use natural language processing techniques to clean and Chinese word segmentation the dish name text. After word segmentation, use the BERT-based Chinese word vector model to convert each dish name into a vector representation. This step calls a custom word vector mapping library in the system, and the output is a fixed-dimensional semantic vector set of dishes, which is the first word vector representation data.
[0234] S5-2, dish similarity matching and image retrieval: After obtaining the vector representation of the target dish, the system searches the complete text-image dataset D p in the target restaurant for dish name vectors, i.e., the second word vector representation data, and performs semantic similarity calculation with the target restaurant dish vector. The similarity measure method uses the standard cosine similarity, and only those with a similarity higher than the threshold of 0.85 are retained in the candidate set P0, where the candidate set P0 is the image set P0.
[0235] S5-3, candidate image screening and image generation: The same image processing procedure as in S3 is performed on the above-mentioned completed images to extract image physical features X f , and at the same time, the image recognition model is used to identify the ingredients in the image content, generating ingredient features X i . The two sets of image-related features output by this process are combined with the cuisine features X t and the per capita consumption price features X p in the restaurant structured field to finally construct a unified format of health evaluation feature vector.
[0236] S5-5, model inference and global evaluation: For D R1 and D R2 , the original or completed feature vectors are input, respectively, and the classification model M0 trained in step S4 is called to perform health level prediction. The prediction label takes values in {1, 2, 3, 4}, corresponding to "unhealthy", "less healthy", "sub-healthy", and "healthy" respectively. By inputting the corresponding data of a certain place into the restaurant health level prediction model, the prediction data of the global level of restaurant health level in a certain place can be obtained, and according to the address of the corresponding restaurant, the distribution map of the four health levels of restaurants in a certain place can be obtained, as shown in Figure 2 . The model output is completed through a batch inference interface, supporting one-time evaluation of global level data.
[0237] Through the above steps, even in the case of incomplete hot-selling dish images, most restaurants in a city can still be modeled and judged with high consistency of health features, significantly improving the adaptability, universality, and robustness of the system in large-scale restaurant health analysis tasks.
[0238] Table 1 Health evaluation feature vector of a restaurant
[0239]
[0240]
[0241] The above description is merely preferred embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art, according to the technical range disclosed by the present application and the inventive concept thereof, can make equivalent replacements or changes, which should be encompassed in the protection scope of the present application.
Claims
1. A method for predicting and evaluating the health level of urban restaurants, characterized in that: include: S1: Obtain a multi-source dataset of restaurants in a target area, where the multi-source dataset includes a spatial vector dataset and a health label dataset; S2: fusing the multi-source data to obtain a fused data set, and constructing the fused data set into a sample set and a set to be predicted based on a preset health label and a preset threshold of the number of dish images; S3: extracting multi-dimensional health evaluation feature vectors from the fused data set based on semantic mining and image recognition; S4: Constructing a restaurant health grade prediction model based on the sample training set and optimizing the restaurant health grade prediction model; S5: The set to be predicted is completed based on semantic similarity to obtain a completed set to be predicted, the health evaluation feature vector is extracted from the completed set to be predicted, and the optimized restaurant health grade prediction model is input to output the prediction data of the restaurant health grade at the global level.
2. The method for predicting and evaluating the health rating of urban restaurants according to claim 1, characterized in that: In step S1, the spatial vector dataset extracts point of interest data based on an online map platform, wherein the point of interest data includes the name of the restaurant, the cuisine, the average price per person, and the spatial location information; The health label dataset includes a restaurant dish image and text dataset and a restaurant health evaluation dataset. The restaurant dish image and text dataset is based on user restaurant evaluation data obtained from an online review platform. The user restaurant evaluation data includes the restaurant address, a set of dish names and their corresponding image sets. The dish name set is the names of dishes whose sales account for more than 20% of the restaurant's total turnover. The image set whose number of images is greater than or equal to a preset dish image number threshold is filtered to form an evaluation image set, and the evaluation image set is scored for health based on a nutritional analysis and health monitoring platform, and is divided into several levels according to the health score to form a restaurant health evaluation dataset.
3. The method for predicting and evaluating the health rating of urban restaurants according to claim 2, characterized in that: In the step S2, based on the multi-source dataset, data fusion processing is performed on the spatial vector dataset, the restaurant dish image and text dataset, and the restaurant health evaluation dataset according to the restaurant name and restaurant address, including: The preset health label is a restaurant dish image and text dataset of the restaurant including a restaurant health evaluation dataset; Based on the field set, we construct a combined processing relationship between the exact match and fuzzy match of the spatial vector dataset and the restaurant menu image and text dataset to obtain the associated data: Completing the spatial location information of the data missing from the associated data based on geocoding to obtain the completed associated data; Performing spatial deduplication processing on the completed associated data, wherein the spatial deduplication processing retains one piece of data corresponding to the completed associated data if the spatial distance in the completed associated data is less than a preset distance value, thereby obtaining a fused data set; Divide the multi-source dataset into a sample set and a set to be predicted based on whether a health label exists in the dataset; The food images in the set to be predicted that have a number greater than or equal to a preset threshold are divided into a complete image subset, otherwise they are divided into an image missing subset.
4. The method for predicting and evaluating the health rating of urban restaurants according to claim 3, characterized in that: In step S3, based on semantic mining, the cuisines in the POI data are extracted as cuisine features, and the cuisine categories are enumerated and numbered, and converted into categorical variables using a serial number encoding method, wherein the categorical variables are used as model input data; based on semantic mining, the per capita consumption price in the POI data is extracted as a per capita consumption price feature; based on image recognition, the ingredients of the images in the restaurant dish image and text dataset are identified as ingredient features; based on image recognition, the visual information of the dishes in the images in the restaurant dish image and text dataset is extracted as image physical features; The image physical characteristics include color, complexity, brightness variation, luminance, and contrast, wherein the image physical characteristics are used to present visual information of restaurant dishes; The cuisine characteristics, per capita consumption price characteristics, food material characteristics and image physical characteristics constitute a multi-dimensional health evaluation feature vector.
5. The method for predicting and evaluating the health rating of urban restaurants according to claim 4, characterized in that: In step S4, the health assessment feature vector extracted from the sample set is preprocessed, including: Build a restaurant health rating prediction model; Normalizing the health evaluation feature vectors extracted from the sample set to obtain numerical variable data that can be used for machine learning; Dividing the health assessment feature vectors extracted from the sample set into a training set and a validation set, wherein the training set accounts for 80% of the sample set and the validation set accounts for 20% of the sample set; The training set is input into the restaurant health grade prediction model for training, and the restaurant health grade prediction model is verified and optimized using the verification set to obtain an optimized restaurant health grade prediction model.
6. The method for predicting and evaluating the health rating of urban restaurants according to claim 5, characterized in that: The restaurant health grade prediction model also includes feature importance ranking, which is used to evaluate and screen all input variables of the restaurant health grade prediction model to enhance the interpretability and operating efficiency of the restaurant health grade prediction model.
7. The method for predicting and evaluating the health rating of urban restaurants according to claim 6, characterized in that: In the step S5, the image missing subset in the to-be-predicted set is used to obtain a set of dish names in the image missing subset, the dish names in the image missing subset are segmented based on natural language processing, and a first word vector representation data is generated; Segmenting the dish names in the restaurant dish image and text dataset based on natural language processing, and generating second word vector representation data, and performing cosine similarity matching between the first word vector representation data and the second word vector representation data; Screening out images whose semantic similarity between the first word vector representation data and the second word vector representation data is higher than a preset threshold to form a candidate image set, and randomly selecting images of dishes whose semantic similarity is greater than or equal to the threshold as the representative image set of the restaurant; Based on the representative image set of the restaurant, the method described in step S3 is used to extract the image physical features and food features of the restaurant image set, and combined with the existing structured cuisine features and per capita consumption price features to construct a corresponding health evaluation feature vector; The complete subset of images and the missing subset of images in the set to be predicted are used to predict the health grades of restaurants using the restaurant health grade prediction model optimized in step S4, and the predicted data of the health grades of restaurants in the entire target area of the city are output.
8. A device for predicting and evaluating the health level of urban restaurants, applied to the method according to any one of claims 1 to 7, characterized in that: The device comprises: Data collection module, used to obtain multi-source datasets of restaurants in the target area; A data fusion module is used to fuse the multi-source data to obtain a fused data set, and construct the fused data set into a sample set and a set to be predicted based on a preset health label and a preset threshold of the number of dish images; A feature extraction module, configured to extract a multi-dimensional health evaluation feature vector from the fused data set based on semantic mining and image recognition; a model training module for constructing a restaurant health grade prediction model based on the sample training set and optimizing the restaurant health grade prediction model; The prediction and evaluation module is used to complete the set to be predicted based on semantic similarity to obtain a completed set to be predicted, extract the health evaluation feature vector from the completed set to be predicted, input the optimized restaurant health grade prediction model, and output the predicted data of the restaurant health grade.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed on the communication device, the method according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Restaurant grade prediction method based on multivariable linear regression model
CN106776868A
Restaurant recommendation method, device and apparatus and readable storage medium
CN110119479A
Catering health analysis method based on image semantic deep learning
CN112650866A
Intelligent diet recommendation method based on patient case reasoning and food image segmentation
CN117352131A
Image-driven restaurant health assessment method
CN119539884A