Method and device for measuring the proportion of dishes in a kitchen

By collecting and preprocessing images of ingredients and identifying them, the types and weights of ingredients are determined. Combined with the amount of seasonings used, the nutrient content of the dishes is calculated. This solves the problems of inaccurate nutrient measurement and uncontrollable seasoning dosage in existing technologies, and achieves precise nutrient management and personalized dietary guidance for dishes.

CN122392047APending Publication Date: 2026-07-14BEIJING YIXINGMING TECH DEV CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING YIXINGMING TECH DEV CO LTD
Filing Date
2026-04-15
Publication Date
2026-07-14

Smart Images

  • Figure CN122392047A_ABST
    Figure CN122392047A_ABST
Patent Text Reader

Abstract

The application discloses a dish proportioning and metering method and device for a canteen kitchen, and relates to the technical field of intelligent metering and health management. The method comprises the following steps: collecting a food material image, pre-processing the food material image to obtain a standardized image, identifying the standardized image to obtain a food material category, determining the weight of the food material corresponding to the food material category and the weight of a seasoning used in a cooking process, and obtaining the nutrient content of a dish according to the weight of the food material, the weight of the seasoning used and preset nutritional parameters. In the foregoing manner, the technical problems of inaccurate nutrient metering and uncontrollable seasoning dosage in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent metering and health management technology, and in particular to a method and device for measuring the proportion of dishes in a canteen kitchen. Background Technology

[0002] With the increasing trend of chronic diseases affecting younger people, the need for employee health management is becoming increasingly urgent. As the main place for employees to eat, the cafeteria lacks a precise measurement and real-time feedback system for the nutritional data of food ingredients, resulting in a lack of scientific basis for dietary guidance. Traditional methods rely on manual estimation of ingredient and seasoning amounts, which is prone to error and makes it difficult to track nutrient intake.

[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of this application is to provide a method and device for measuring the proportion of dishes in a canteen kitchen, aiming to solve the technical problems of inaccurate nutrient measurement and uncontrollable seasoning dosage in the prior art.

[0005] To achieve the above objectives, this application provides a method for measuring and proportioning food ingredients in a canteen kitchen, the method comprising: Collect food ingredient images, preprocess the food ingredient images to obtain standardized images; The standardized images are then identified to determine the food categories. Determine the weight of the ingredients corresponding to the ingredient categories, and the weight of seasonings used during the cooking process; The nutrient content of the dish is obtained based on the weight of the ingredients, the weight of the seasonings used, and the preset nutritional parameters.

[0006] In one embodiment, the steps of acquiring food ingredient images and preprocessing the food ingredient images to obtain standardized images include: Capture images of the food items placed in the food weighing area; The food image is denoised using the OpenCV library to obtain a denoised image. The denoised image is then processed to eliminate reflections and frost effects, resulting in an enhanced image. The enhanced image is cropped to obtain a cropped image containing the main food ingredient. The cropped image is normalized to obtain a standardized image.

[0007] In one embodiment, the step of performing reflection and frost effect removal processing on the denoised image to obtain an enhanced image includes: The denoised image is converted from the RGB color space to the HSV color space; Based on the luminance component, the K-means clustering algorithm is used to segment the reflective and frost regions in the denoised image; Using a guided filtering algorithm, guided by the saturation component of the denoised image, texture details are restored in the reflective and frost areas to generate a repaired area; The repaired area is adjusted to the brightness component, and the denoised image is converted back to the RGB color space to obtain the enhanced image.

[0008] In one embodiment, the step of identifying the standardized image to obtain the food category includes: A convolutional neural network model based on the ResNet-50 architecture was constructed, and a single dish feature enhancement layer was introduced into the fully connected layer of the convolutional neural network model. Feature extraction is performed on the standardized image to obtain the food characteristics; The food ingredient features are input into the convolutional neural network model to obtain the food ingredient categories.

[0009] In one embodiment, the step of constructing a convolutional neural network model based on the ResNet-50 architecture and introducing a single-dish feature enhancement layer into the fully connected layer of the convolutional neural network model includes: Construct a training dataset covering various lighting conditions and food morphologies, including image samples of fresh, frost-covered, and pre-cut food. Based on the training dataset, the initial convolutional neural network is trained using the cross-entropy loss function and the stochastic gradient descent optimizer, and the learning rate is adjusted in stages to obtain the convergence efficiency of the initial convolutional neural network. When the convergence efficiency is greater than the preset convergence efficiency, the initial convolutional neural network is used as the convolutional neural network model; A single dish ingredient feature is generated based on a preset list of dish ingredients, and a single dish feature enhancement layer is constructed using the single dish ingredient feature; The single-dish feature enhancement layer is inserted into the fully connected layer of the convolutional neural network model.

[0010] In one embodiment, the steps of determining the weight of the food item corresponding to the food item category and the weight of seasonings used during the cooking process include: The weight of each of the food items is obtained by at least one independent food weighing unit, wherein the food weight is obtained by analog-to-digital conversion of the pressure sensor signal of the food weighing unit; The weight reduction of each seasoning during the cooking process is monitored in real time using a differential weighing method through multiple independent seasoning weighing units, and the weight reduction is used as the weight of the seasoning.

[0011] In one embodiment, the step of obtaining the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters includes: The system queries a pre-defined database based on the food category to obtain the edible portion coefficient and raw-to-cooking ratio conversion parameters for the corresponding food. Calculate the net weight of the edible portion and the weight after cooking based on the weight of the ingredients, the edible portion coefficient, and the raw-to-cook ratio conversion parameter. The nutrient content of the dish is calculated by using a weighted summation method based on the weight of the seasonings used, the net weight of the edible portion, the weight after cooking, and preset nutritional parameters.

[0012] In one embodiment, after the step of obtaining the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters, the method further includes: Upload the nutrient content of the dishes to the server; The receiving server generates a personalized dish recommendation list based on preset dietary guidance rules, user health records, and the nutrient content of the dishes. The personalized menu recommendation list will be pushed to you.

[0013] In one embodiment, the method for measuring and proportioning ingredients in the canteen kitchen further includes: Real-time monitoring of the weight of the seasoning used; When the weight of any seasoning is detected to exceed a preset threshold set for the dish or the user, an audible and visual warning is triggered.

[0014] Furthermore, to achieve the above objectives, this application also proposes a food proportioning and measuring device for a canteen kitchen, which includes: The image acquisition module is used to acquire food images and preprocess the food images to obtain standardized images; The food ingredient recognition module is used to identify the standardized image to obtain the food ingredient category; The precision weighing module is used to determine the weight of the ingredients corresponding to the ingredient category, as well as the weight of seasonings used during the cooking process; The nutrition measurement module is used to obtain the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters.

[0015] In addition, to achieve the above objectives, this application also proposes a food proportioning and measuring device for a canteen kitchen. The food proportioning and measuring device for a canteen kitchen includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program is configured to implement the steps of the food proportioning and measuring method for a canteen kitchen as described above.

[0016] In addition, to achieve the above objectives, the present invention also proposes a storage medium, which is a computer-readable storage medium, and stores a computer program on the storage medium. When the computer program is executed by a processor, it implements the steps of the above-described method for measuring the proportion of dishes in a canteen kitchen.

[0017] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the above-described method for measuring the proportions of food ingredients in a canteen kitchen.

[0018] This application provides a method for measuring and proportioning ingredients in a canteen kitchen. The method involves acquiring images of ingredients, preprocessing these images to obtain standardized images, identifying the ingredient categories from the standardized images, determining the weight of each ingredient category, and calculating the weight of seasonings used during cooking. Based on the ingredient weights, seasoning weights, and preset nutritional parameters, the nutrient content of the dish is calculated. This method solves the technical problems of inaccurate nutrient measurement and uncontrollable seasoning usage in existing technologies. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating an embodiment of the food proportioning and measurement method for the canteen kitchen of this application. Figure 2 This is a simplified flowchart illustrating an embodiment of the food proportioning and measurement method in the canteen kitchen of this application. Figure 3 This is a schematic diagram of the overall structure of the apparatus for an embodiment of the food proportioning and measurement method in the canteen kitchen of this application. Figure 4 This is a schematic diagram of the modular structure of the food proportioning and measuring device in the canteen kitchen according to an embodiment of this application; Figure 5 This is a schematic diagram of the equipment structure of the hardware operating environment involved in the food proportioning and measurement method in the canteen kitchen of this application embodiment.

[0022] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0023] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0024] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0025] The main solution of this application embodiment is: to acquire food ingredient images, preprocess the food ingredient images to obtain standardized images, identify the standardized images to obtain food ingredient categories, determine the weight of the food ingredient corresponding to the food ingredient category, and the weight of seasonings used in the cooking process, and obtain the nutrient content of the dish based on the weight of the food ingredient, the weight of the seasonings used, and preset nutritional parameters.

[0026] Currently, with the increasing trend of chronic diseases affecting younger people, the need for employee health management is becoming increasingly urgent. As the main place for employees to eat, the cafeteria lacks a precise measurement and real-time feedback system for the nutritional data of food ingredients, resulting in a lack of scientific basis for dietary guidance. Traditional methods rely on manual estimation of ingredient and seasoning amounts, which is prone to error and makes it difficult to track nutrient intake.

[0027] This application provides a solution that involves acquiring food ingredient images, preprocessing the images to obtain standardized images, identifying the food ingredient categories from the standardized images, determining the weight of the corresponding ingredients and the weight of seasonings used during cooking, and then calculating the nutrient content of the dish based on the ingredient weights, the seasoning weights, and preset nutritional parameters. This method solves the technical problems of inaccurate nutrient measurement and uncontrollable seasoning dosage in existing technologies.

[0028] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions, such as a food proportioning and measuring device in a canteen kitchen. This embodiment does not specifically limit this. The following uses a food proportioning and measuring device in a canteen kitchen as an example to describe this embodiment and the following embodiments.

[0029] All actions involving the acquisition of signals, information, or data in this application are carried out in accordance with the relevant data protection laws and policies of the country where the application is located, and with the authorization of the owner of the relevant device.

[0030] This application provides a method for measuring and proportioning ingredients in a canteen kitchen, referring to... Figure 1 , Figure 1This is a flowchart illustrating the first embodiment of the food proportioning and measurement method for the canteen kitchen of this application.

[0031] In this embodiment, the method for measuring and proportioning the ingredients in the canteen kitchen includes steps S10 to S40: Step S10: Acquire food ingredient images and preprocess the food ingredient images to obtain standardized images.

[0032] It should be noted that food images refer to high-definition images captured by cameras, while standardized images refer to images obtained after processing by the OpenCV library and CNN convolutional neural network models. Preprocessing includes, but is not limited to, image denoising, deglare / frost removal, region cropping, and size normalization. Compared to food images, standardized images eliminate interference from the kitchen environment.

[0033] Understandably, the food images are acquired through an image acquisition module on the food measuring device vehicle, specifically through a high-definition camera. Image preprocessing is then performed using the OpenCV library, and the CNN model is trained on a ResNet-50 architecture, achieving a recognition response time of <0.5 seconds.

[0034] In the specific implementation, a 1080P camera is used, along with the OpenCV library for image preprocessing. This includes image denoising, deglare / frost removal, region cropping, and size normalization to eliminate interference from the kitchen environment and output standardized images. The CNN model is trained based on a lightweight, improved ResNet-50 architecture. The core improvement is the addition of logic to enhance the weights of features within a limited range for each dish. This is tailored to the characteristic of ≤10 ingredients per dish in the canteen, increasing the weights for extracting multi-morphological features of the bound ingredients and compressing the feature matching dimension. The model uses the original visual features of ingredients such as color, texture, outline, and shape as the basis for recognition, covering the differences in features across various forms, including fresh, frozen with frost, and processed items. After secondary fine-tuning using samples from actual kitchen scenarios, it achieves localized real-time feature extraction and matching with a recognition response time of <0.5 seconds and a directional recognition accuracy of ≥99% within a limited range for each dish.

[0035] In one feasible implementation, the steps of acquiring food images and preprocessing the food images to obtain standardized images include: Capture images of the food items placed in the food weighing area; The food image is denoised using the OpenCV library to obtain a denoised image. The denoised image is then processed to eliminate reflections and frost effects, resulting in an enhanced image. The enhanced image is cropped to obtain a cropped image containing the main food ingredient. The cropped image is normalized to obtain a standardized image.

[0036] It should be noted that the food weighing area refers to the specific physical location on the food weighing module where the food to be weighed is placed. Image denoising processing refers to the process of using algorithms to reduce random noise in an image to improve the signal-to-noise ratio. Reflection and frost effect elimination processing is a technique for correcting optical interference caused by specular reflection or frost on the surface of the food. Effective region cropping is an operation that selects only the main body of the food in the image based on a preset coordinate frame to eliminate background interference. Normalization processing is the process of scaling the image pixel values ​​or size to a standard range or uniform scale.

[0037] In practical implementations, image denoising typically employs a Gaussian filtering algorithm. This algorithm uses a Gaussian function to generate a convolution kernel, performing a convolution operation on the image to smooth out noise. Its two-dimensional Gaussian function formula is:

[0038] in, and These are the coordinates of a pixel relative to the center of the convolution kernel. The standard deviation determines the smoothness of the filter. A larger standard deviation... The value will produce a more significant blurring effect, which can effectively suppress noise but may lose some details.

[0039] To eliminate reflections and frost effects, image inpainting or homomorphic filtering methods can be used. For example, homomorphic filtering treats the image as the product of illumination and reflection components, and differentially enhances and suppresses high-frequency and low-frequency components in the frequency domain. Its basic form is as follows:

[0040] Among them, among them, It is the filter transfer function. It is a frequency point Distance to the center of the frequency It is the cutoff frequency. and Control the gain of low frequency and high frequency separately. It is a constant used to control the transition slope.

[0041] By improving It can enhance the high-frequency components representing details and reflections, while also by setting... This suppresses the low-frequency components that represent illumination, thereby compressing the dynamic range and reducing glare.

[0042] Effective region cropping is performed by extracting the Region of Interest (ROI) using preset weighing cell boundary coordinates. Then, bilinear interpolation is used to normalize the size of the cropped image. The interpolation formula is as follows:

[0043] in, , , , Given the coordinates and pixel values ​​of the four neighboring pixels around the target point, the pixel value of the target point is calculated by weighted averaging, thus achieving image scaling and obtaining a standardized image.

[0044] In one feasible implementation, the step of performing reflection and frost effect removal processing on the denoised image to obtain an enhanced image includes: The denoised image is converted from the RGB color space to the HSV color space; Based on the luminance component, the K-means clustering algorithm is used to segment the reflective and frost regions in the denoised image; Using a guided filtering algorithm, guided by the saturation component of the denoised image, texture details are restored in the reflective and frost areas to generate a repaired area; The repaired area is adjusted to the brightness component, and the denoised image is converted back to the RGB color space to obtain the enhanced image.

[0045] It should be noted that the RGB color space is an additive color model composed of the three primary color components of red, green, and blue, and is widely used in image acquisition and display. The HSV color space is a model that describes color using hue, saturation, and lightness components, and is more in line with human color perception.

[0046] It should be understood that K-means clustering is an unsupervised machine learning method that divides data points into K clusters through iterative computation, with each cluster represented by its centroid. Guided filtering is a filter that uses a guide image to smooth the edges of an input image, effectively transmitting the structural information of the guide image.

[0047] In the specific implementation, the image is first converted from RGB space to HSV space because the luminance component V is separated from color information, which can more directly reflect the characteristics of reflection (high brightness) and frost (high brightness and special texture). Then, the K-means clustering algorithm is applied to the luminance component V. Its objective function is to minimize the sum of squared distances from all pixels to the centroid of their respective clusters, as shown in the formula:

[0048] in, It is the total number of pixels. This is the preset number of clusters (usually) Or 3 to distinguish between normal areas and reflective / frosty areas). It is the brightness value of the i-th pixel. It is the first The centroid of a cluster, It is an indicator function (when pixel) Belongs to cluster (If it is 1, then it is 0).

[0049] By iteratively updating the centroid and pixel assignments, the mask for areas suspected of being reflective and frost-like was finally segmented.

[0050] Then, using the saturation component S of the original image as the guide image, guided filtering is applied to the segmented highlight regions to restore the textures masked by the highlights. Guided filtering assumes that the filter output is a linear transformation of the guide image within a local window, i.e.:

[0051] in, The output pixel value to be determined. The guide image (here, the saturation component S) is in The value of the point, It is based on pixels A local window centered on the center. and These are the linear coefficients within that window.

[0052] By minimizing the output Compared with the original damaged brightness area By identifying the differences between them and introducing a regularization term, the coefficients can be solved. and The calculation formula is as follows:

[0053]

[0054] in, and Is the guide image I in the window Mean and variance within, It is the number of pixels within the window. It is the input image In the window The mean within, It is the regularization parameter that prevents Too large.

[0055] Finally, the obtained coefficients are used to calculate the restoration area for each pixel, and the brightness value is adjusted back to the original V component and converted back to RGB space to obtain the enhanced image.

[0056] Step S20: Recognize the standardized image to obtain the food category.

[0057] It should be noted that food category refers to the category to which the food belongs, such as vegetables, fruits, meats, or more specific subcategories, such as tomatoes, apples, and beef.

[0058] Understandably, the identification of food categories typically uses a convolutional neural network pre-trained on a large image dataset as the base model, such as ResNet or EfficientNet, and utilizes a dataset containing images of various food items for transfer learning and fine-tuning. The model receives a standardized image as input, automatically extracts deep features through its multi-layer convolution and pooling operations, and finally outputs the probability distribution of the image belonging to each preset food category by a Softmax classifier, and determines the category with the highest probability as the final identification result.

[0059] In one feasible implementation, the step of identifying the standardized image to obtain the food category includes: A convolutional neural network model based on the ResNet-50 architecture was constructed, and a single dish feature enhancement layer was introduced into the fully connected layer of the convolutional neural network model. Feature extraction is performed on the standardized image to obtain the food characteristics; The food ingredient features are input into the convolutional neural network model to obtain the food ingredient categories.

[0060] It should be noted that ResNet-50 is a classic convolutional neural network architecture with 50 layers, which effectively solves the vanishing gradient problem in deep networks by introducing residual block structures. Fully connected layers are located at the ends of the convolutional neural network and map the learned distributed features to the sample label space. The single-dish feature enhancement layer is an additional network layer designed for single-subject ingredient recognition tasks to enhance the discriminative features of the category.

[0061] In the implementation, a ResNet-50 model pre-trained on large datasets such as ImageNet is used as the backbone network for feature extraction. The core of ResNet is the residual learning unit, whose basic structure can be represented as follows:

[0062] Where x is the original value input to the residual block. It is a residual mapping learned by stacking convolutional layers, batch normalization layers, and activation functions. This represents the weight parameters of each layer within the residual block. This is the final expected output. This structure allows the network to transmit directly via fast connections. This allows the network to easily learn identity mappings, thereby effectively training very deep networks to extract rich and hierarchical food features from standardized images.

[0063] After obtaining the global feature map through the convolutional and pooling layers of ResNet-50, a classifier is needed. The traditional approach is to directly use fully connected layers. However, this embodiment introduces a single-dish feature enhancement layer before the final fully connected layer. This is typically an additional fully connected layer with a bottleneck structure, designed to compress and refocus the features. The operation of this layer can be represented as follows:

[0064] Where y is the global feature vector from the ResNet backbone network. This is the weight matrix of the enhancement layer. It is a bias term. It is an activation function (such as ReLU). By... The layer projects the feature vector z into a lower dimension for reconstruction. This layer strengthens the most crucial features for distinguishing different food categories and suppresses irrelevant noise. Finally, the strengthened feature vector z is fed into the final fully connected layer and the Softmax function, which outputs the probability distribution of each food category, thus determining the food category.

[0065] In one feasible implementation, the step of constructing a convolutional neural network model based on the ResNet-50 architecture and introducing a single-dish feature enhancement layer into the fully connected layer of the convolutional neural network model includes: Construct a training dataset covering various lighting conditions and food morphologies, including image samples of fresh, frost-covered, and pre-cut food. Based on the training dataset, the initial convolutional neural network is trained using the cross-entropy loss function and the stochastic gradient descent optimizer, and the learning rate is adjusted in stages to obtain the convergence efficiency of the initial convolutional neural network. When the convergence efficiency is greater than the preset convergence efficiency, the initial convolutional neural network is used as the convolutional neural network model; A single dish ingredient feature is generated based on a preset list of dish ingredients, and a single dish feature enhancement layer is constructed using the single dish ingredient feature; The single-dish feature enhancement layer is inserted into the fully connected layer of the convolutional neural network model.

[0066] It should be noted that the training dataset is a collection of data containing input data and their corresponding labels, prepared for training machine learning models. Convergence efficiency is a metric that measures how quickly a model approaches the optimal solution during training, and is usually related to the rate of decrease in the loss function value. The preset list of dish ingredients is a predefined list containing all categories of ingredients to be identified. Single dish ingredient features refer to discriminative feature vectors extracted from the data using specific methods that can represent a particular ingredient category.

[0067] In practical implementation, constructing a training dataset covering various real-world scenarios (such as different lighting conditions, fresh / frozen conditions, and cutting / preparation methods) is crucial, as it enhances the model's generalization ability. The cross-entropy loss function is used to measure the difference between the model's predicted probability distribution and the true label distribution; its formula is:

[0068] in, It represents the total number of food items. It is a binary indicator (if the sample) The true category equals (The value is 1 if it is 1, otherwise it is 0). The model predicts the sample. Category The probability of this is determined by using a stochastic gradient descent optimizer and adjusting the learning rate in stages (e.g., halving the learning rate when training stalls) to minimize the loss. This allows for efficient updates to network weights. When the loss value no longer decreases significantly on the validation set or reaches a predetermined number of rounds, the model is considered to have converged, and its efficiency can be evaluated through the loss decline curve.

[0069] Once the model's convergence efficiency (e.g., the number of training epochs required to achieve a specific accuracy) meets the preset requirements, a single-dish feature enhancement layer is constructed. First, based on a preset list, for all samples of each dish category in the training set, the feature vectors output by the last convolutional layer of the convergent model (before inserting the enhancement layer) are extracted. Then, the average of all feature vectors for each category is calculated, or principal component analysis is used to extract the main feature directions, forming single-dish ingredient features representing that category. Finally, a fully connected layer is constructed as the enhancement layer, with its weight matrix initialized or constrained by these preset category feature vectors, and inserted before the fully connected layer of the original model. This operation aims to make the model more inclined to match the input features with these preset, pure category feature templates during final classification, thereby improving recognition accuracy.

[0070] Step S30: Determine the weight of the ingredients corresponding to the ingredient category and the weight of seasonings used during the cooking process.

[0071] It should be noted that the ingredient weight refers to the mass corresponding to the specific ingredient category being identified, usually expressed in grams or kilograms. The seasoning usage weight refers to the actual mass of salt, sugar, soy sauce, and other seasonings used when cooking the ingredient. Both the ingredient and seasoning weights are obtained through actual weighing by a weighing unit.

[0072] Understandably, physical weight data is acquired through integrated weighing sensors or electronic scale modules. When a user places ingredients or seasonings on the weighing unit, the sensor converts the detected pressure signal into an electrical signal, which is then converted into a digital reading via an analog-to-digital converter. This weight data is transmitted to the main processing system via communication protocols such as serial port or Bluetooth, and is bound to the ingredient category determined by image recognition or the seasoning type manually selected by the user, thereby recording and outputting the ingredient weight and the seasoning usage weight respectively.

[0073] In one feasible implementation, the steps of determining the weight of the food item corresponding to the food item category and the weight of seasonings used during the cooking process include: The weight of each of the food items is obtained by at least one independent food weighing unit, wherein the food weight is obtained by analog-to-digital conversion of the pressure sensor signal of the food weighing unit; The weight reduction of each seasoning during the cooking process is monitored in real time using a differential weighing method through multiple independent seasoning weighing units, and the weight reduction is used as the weight of the seasoning.

[0074] It should be noted that the food weighing units are made of stainless steel, with a maximum load capacity of 60kg per unit and an accuracy of ±1g. The pressure sensor signal is transmitted to the data processing module after AD conversion. The seasoning weighing units are also made of stainless steel, with a differential sensor accuracy of ±0.1g and support for automatic zeroing.

[0075] In its implementation, the system obtains the weight of the ingredients through independent weighing units. Each unit contains a pressure sensor that outputs a voltage signal. It is directly proportional to the pressure F applied (caused by the weight of the food in mg), and the relationship is as follows:

[0076] Where S is the sensor's sensitivity (unit: V / N), and F is the pressure applied to the sensor (unit: N). It is the zero-point offset voltage (unit: V).

[0077] The analog voltage signal is sampled and quantized by an analog-to-digital converter (ADC) to obtain a digital value D. This is then compared to a known calibration curve (i.e., the relationship between weight m and digital value D). ,in For calibration coefficients, (To calibrate the zero point), the weight of the ingredients can be calculated. .

[0078] To obtain the weight of seasonings used, the system employs multiple independent seasoning weighing units combined with differential weighing. Each seasoning container (such as a salt shaker or oil bottle) is placed on a dedicated weighing unit. Before cooking begins, the system records the initial total weight of each container. When the user adds seasonings to the pot, the system monitors and records the instantaneous weight of the container in real time. The weight of the seasonings used The formula is obtained by calculating the difference between the two weights:

[0079] This effectively eliminates the influence of container tare weight, directly yielding the net usage of the seasonings. High-frequency data sampling allows for the detection of minute weight variations, enabling precise monitoring of the usage of each seasoning.

[0080] Step S40: Obtain the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and the preset nutritional parameters.

[0081] It should be noted that preset nutritional parameters refer to the pre-stored data in a database of the content of various nutrients (such as protein, fat, carbohydrates, sodium, etc.) per unit mass (e.g., per 100 grams) of a specific ingredient or seasoning. This data is usually derived from authoritative food composition tables. The nutrient content of a dish refers to the total mass of various nutrients in the final cooked dish, calculated through a process of differentiation.

[0082] Understandably, by querying a pre-set nutritional parameter database, the weight of each identified ingredient is multiplied by its corresponding nutrient content per unit mass to obtain the amount of each nutrient contributed by that ingredient; similarly, the weight of each seasoning is multiplied by its nutrient content per unit mass to obtain the amount of nutrients contributed by the seasoning; finally, the amounts of the same type of nutrients contributed by all ingredients and seasonings are added together to obtain the total nutrient content of the entire dish.

[0083] In one feasible implementation, the step of obtaining the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters includes: The system queries a pre-defined database based on the food category to obtain the edible portion coefficient and raw-to-cooking ratio conversion parameters for the corresponding food. Calculate the net weight of the edible portion and the weight after cooking based on the weight of the ingredients, the edible portion coefficient, and the raw-to-cook ratio conversion parameter. Calculate the content of each nutrient in the dish by using the weight of the condiment used, the net weight of the edible part, the weight after cooking, and the preset nutritional parameters, and obtain the nutrient content of the dish by weighted summation.

[0084] It should be noted that the edible part coefficient refers to the proportion of the actually edible part in the original total weight of the food material, and is used to exclude the inedible parts such as fruit skins, fruit cores, and bones. The raw-to-cooked ratio conversion parameter refers to the weight ratio of the same food material before and after cooking, which reflects the weight change caused by water loss or absorption.

[0085] In a specific implementation, query the nutrition database according to the identified food material category to obtain the corresponding edible part coefficient (EP) and raw-to-cooked ratio conversion parameter (CR). The net weight of the edible part ( ) is obtained by multiplying the total weight of the food material by the edible part coefficient, and the calculation formula is:

[0086] where, is the original total weight of the food material measured by the weighing unit, and EP is the edible part coefficient (0 < EP ≤ 1). Then, calculate the weight of the edible part after cooking according to the target cooking state (raw or cooked), and the formula is:

[0087] where, CR is the raw-to-cooked ratio conversion parameter (CR > 0). If the nutritional parameter is based on the raw weight, then is used for calculation; if it is based on the cooked weight, then is used.

[0088] Then, the system calculates the total content of each nutrient (such as protein) in the dish by weighted summation. The calculation formula is:

[0089] where, is the total content of a certain nutrient in the dish, is the net weight of the edible part (or the weight after cooking, selected according to the nutritional parameter benchmark) of the th food material, is the content per unit mass of this nutrient corresponding to the th food material in the database, is the weight of the th condiment used, is the content per unit mass of this nutrient corresponding to the th condiment in the database. The system calculates each nutrient separately, and finally obtains a complete nutrient content report of the dish.

[0090] In one feasible implementation, after the step of obtaining the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters, the method further includes: Upload the nutrient content of the dishes to the server; The receiving server generates a personalized dish recommendation list based on preset dietary guidance rules, user health records, and the nutrient content of the dishes. The personalized menu recommendation list will be pushed to you.

[0091] It should be noted that the preset dietary guidance rules are a series of rules and algorithms based on nutritional standards, used to guide an individual's daily or per-meal nutrient intake (such as the upper limit of calories, protein, and fat). The user's health profile is an electronic data set stored on the server, containing the user's basic information (such as age, gender, and weight), health status (such as medical history), dietary preferences, and nutritional goals (such as weight loss and blood sugar control). The personalized menu recommendation list is a list of subsequent menu suggestions generated by the server after analyzing the match between the user's current food intake and their long-term nutritional goals, and recommending dishes that meet their health needs.

[0092] In practice, the local device encapsulates the calculated nutrient content data of the dishes into a specific format (such as JSON) and uploads it to the cloud server via a network interface (such as HTTP API). After receiving the data, the recommendation engine on the server side calls the user's health record and preset dietary guidance rules, compares and analyzes the nutritional data of the current dishes with the user's long-term goals, and calculates complementary dishes that can help the user achieve balanced nutrition or specific goals through rule matching, collaborative filtering or machine learning models. It then generates a recommendation list and sends it to the local device, which is finally pushed to the user through the device's user interface (such as an app or screen).

[0093] In one feasible implementation, the method for measuring and proportioning the ingredients in the canteen kitchen further includes: Real-time monitoring of the weight of the seasoning used; When the weight of any seasoning is detected to exceed a preset threshold set for the dish or the user, an audible and visual warning is triggered.

[0094] It should be noted that a preset threshold refers to the maximum permissible weight of a certain seasoning (such as salt or oil) pre-set for a specific dish or a specific user (such as a user who needs a low-sodium diet). This threshold is usually set based on healthy dietary guidelines or personalized nutritional needs. Audible and visual warnings refer to transmitting an alarm signal to the operator by emitting sound (such as a buzzer) and illuminating light (such as an LED indicator).

[0095] In practice, the weight sensor connected to the smart seasoning container acquires the weight data of seasoning usage in real time, and compares this data with the preset threshold set in the database for the dish or the current diner. When the cumulative usage of a certain seasoning exceeds its corresponding threshold, the system will immediately trigger a combination of sound and light alarm by controlling the speaker and alarm light connected to the host to remind the chef to stop or reduce the addition of the seasoning.

[0096] For example, to help understand the implementation process of the canteen kitchen food proportioning and measurement method obtained by combining this embodiment with the above embodiments, please refer to... Figure 2 , Figure 2 This document provides a simplified flowchart of a method for measuring and proportioning ingredients in a canteen kitchen. Specifically: First, the chef places various ingredients and seasonings in an orderly manner in the designated work area. Then, an image acquisition module is activated, automatically identifying and classifying the ingredients based on their type, color, and freshness using visual recognition technology. Simultaneously, an ingredient weighing module accurately collects the weight data of each ingredient, while a seasoning weighing module monitors the usage of oil, salt, soy sauce, vinegar, and other seasonings in real time, ensuring accuracy down to the gram level. All collected image information, weight data, and seasoning usage are transmitted in real time to a data processing module. This module is responsible for cleaning, aligning, and integrating the multi-source data, and calculating the nutrient content (protein, fat, carbohydrates, vitamins, and minerals) of each dish based on a built-in nutritional database. After calculation, the data is securely uploaded to a cloud server via a communication module (such as Wi-Fi, 4G, or Ethernet). The server generates standardized nutrition labels and stores them persistently for subsequent traceability and analysis. Ultimately, the app on the user's phone will proactively receive nutritional recommendations for the dish (such as suggested intake and dietary balance assessment) as well as potential health warnings (such as high sodium and high fat alerts), thereby achieving full-process nutritional monitoring and intelligent guidance from kitchen preparation to the user's table.

[0097] Exemplary, this embodiment describes the structure of a food proportioning and measuring device in a canteen kitchen, in order to aid in understanding. (Refer to...) Figure 3 , Figure 3This is a schematic diagram of the overall device structure, including a food weighing module (A), a seasoning weighing module (B), an image acquisition module (C), and a touch screen (D). Food Weighing Module: The square weighing pan is made of stainless steel. Each weighing unit has a maximum load capacity of 60kg and an accuracy of ±1g. The pressure sensor signal is transmitted to the data processing module after AD conversion. Seasoning Weighing Module: The square weighing pan is made of stainless steel. The differential sensor has an accuracy of ±0.1g and supports automatic zeroing. Image Acquisition Module: It uses a 1080P camera, with image preprocessing using the OpenCV library. The CNN model is trained based on the ResNet-50 architecture, and the recognition response time is <0.5 seconds. First, image denoising, deglare / frost removal, region cropping, and size normalization are performed to eliminate interference from the kitchen environment and output standardized images. The CNN model is trained based on a lightweight improved ResNet-50 architecture. The core improvement is the addition of feature weight enhancement logic for single dishes within a limited range. This enhances the weighting of multi-morphological feature extraction for ingredients, addressing the characteristic of ≤10 ingredients per dish in the canteen, and compressing the feature matching dimension. The model uses the original visual features of ingredients such as color, texture, outline, and shape as the basis for recognition, covering the differences in multi-morphological features such as fresh, frozen with frost, and processed. After secondary fine-tuning with samples from actual kitchen scenarios, it achieves localized real-time feature extraction and matching with a recognition response time of <0.5 seconds and a directional recognition accuracy of ≥99% within the limited range of a single dish. The data processing module is equipped with an ARM Cortex-A53 processor and a built-in SQLite database, storing nutritional parameters of over 500 ingredients. The calculation algorithm is based on the "Chinese Food Composition Table" standard.

[0098] An example is illustrated using a workflow: The chef places tomatoes, eggs, green peppers, and pork into the four units of the food weighing module, and the system automatically identifies and records the weights (e.g., tomatoes 200g, eggs 150g).

[0099] During the cooking process, the amount of seasonings such as cooking oil, salt, and soy sauce used is calculated in real time by differential weighing (e.g., if the amount of cooking oil is reduced by 20g, the amount of salt is reduced by 5g).

[0100] The data processing module calculates the total nutrients of "scrambled eggs with tomatoes": 320kcal, 18g protein, and 15g fat, and synchronizes them to the user's APP via API.

[0101] If the amount of salt consumed exceeds the recommended value per person (<3g), the touch screen will display a red warning and indicate "Excessive sodium intake".

[0102] For example, a system linkage is used to illustrate this: This device establishes a three-tiered data linkage system with the server and user-end APP through a communication module. Based on standardized nutritional data calculation rules across all platforms, and using personal health indicator grading, precise nutritional label matching for dishes, and personalized dietary constraint rules as its core strategies, it achieves personalized recipe recommendations, as detailed below: 1. Core Data Foundation The device generates and uploads standardized nutritional labels for dishes based on a raw-to-cooked ratio of 0.9, an edible portion coefficient, and specific statistical rules for oil, salt, and sugar. The server contains a library of dietary guidelines, sub-indicator dietary restriction rules, and a user health record database. The user's APP is a terminal for inputting health indicators / dietary preferences, displaying recommendation results, and providing dining feedback.

[0103] 2. Recommended Implementation Steps A. Users enter / synchronize their body indicators and dietary preferences in the APP, and upload them after verification; B. The server classifies the indicators and matches the corresponding prohibited / restricted / recommended nutrient intake thresholds. The rules can be configured on demand by the canteen. C. The server retrieves the nutritional labels of the dishes, processes them according to the logic of filtering → screening → sorting, removes conflicting dishes, screens compliant dishes, and sorts them according to nutritional relevance, etc. D. The server pushes recommended recipes (including name, nutritional data, and recommended serving size) to the user's APP, generates a nutrition matching report to the kitchen management system, incorporates user feedback into model optimization, and the kitchen can generate consumption reports and optimize procurement based on seasoning data.

[0104] 3. Core Recommendation Logic Based on individual health index classification, using precise nutritional data from a unified algorithm at the device end, and following dietary guidelines, personalized recommendations are achieved through a triple matching of indicators, rules, and nutrition labels, adhering to the principles of prioritizing health constraints, then nutritional balance, and finally aligning with individual preferences and canteen offerings.

[0105] 4. Real-world examples The 35-year-old male employee entered his BMI as 28.5 (moderate obesity) and fasting blood glucose as 6.8 mmol / L (impaired glucose tolerance) on the app. He has no dietary restrictions, prefers home-style cooking and dislikes fried food. Nutrition labels have been uploaded for all 10 dishes in the cafeteria.

[0106] Server matching rules: Fried foods and foods with added sugar ≥5g / 100g are prohibited; fat ≤8g / 100g, carbohydrates ≤20g / 100g, sodium ≤600mg / 100g are limited; high-quality protein ≥10g / 100g and high dietary fiber foods are recommended. After screening and eliminating 5 non-compliant dishes, the remaining 5 dishes were ranked according to their high-quality protein content, nutritional balance, and dietary preferences. The final recommended dishes are Steamed Sea Bass (200g) + Stir-fried Chicken Breast with Broccoli (200g) + Winter Melon and Kelp Soup (300g), with the suggestion of "keeping the total calories of three meals within 1500kcal and reducing staple food at dinner". The user's app receives recommendations and allows reservations. The cafeteria synchronizes the reservation information, and the kitchen optimizes the cooking methods for the next day's dishes based on the nutrition fit report (changing deep-frying to stir-frying, reducing sugar and salt).

[0107] This embodiment provides a method for measuring and proportioning ingredients in a canteen kitchen. It involves acquiring images of ingredients, preprocessing these images to obtain standardized images, identifying the ingredient categories from the standardized images, determining the weight of each ingredient category, and calculating the weight of seasonings used during cooking. Based on the ingredient weights, seasoning weights, and preset nutritional parameters, the nutrient content of the dish is calculated. This method solves the technical problems of inaccurate nutrient measurement and uncontrollable seasoning usage in existing technologies.

[0108] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the food proportioning and measurement method of the canteen kitchen of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0109] This application also provides a food proportioning and measuring device for a canteen kitchen; please refer to [reference needed]. Figure 4 The food proportioning and measuring devices in the canteen kitchen include: Image acquisition module 10 is used to acquire food images and preprocess the food images to obtain standardized images; The food ingredient recognition module 20 is used to recognize the standardized image to obtain the food ingredient category; The precision weighing module 30 is used to determine the weight of the ingredients corresponding to the ingredient category, as well as the weight of seasonings used during the cooking process; The nutrition measurement module 40 is used to obtain the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters.

[0110] In one feasible implementation, the image acquisition module 10 is also used to acquire images of food placed in the food weighing area; The food image is denoised using the OpenCV library to obtain a denoised image. The denoised image is then processed to eliminate reflections and frost effects, resulting in an enhanced image. The enhanced image is cropped to obtain a cropped image containing the main food ingredient. The cropped image is normalized to obtain a standardized image.

[0111] In one feasible implementation, the image acquisition module 10 is further configured to convert the denoised image from the RGB color space to the HSV color space; Based on the luminance component, the K-means clustering algorithm is used to segment the reflective and frost regions in the denoised image; Using a guided filtering algorithm, guided by the saturation component of the denoised image, texture details are restored in the reflective and frost areas to generate a repaired area; The repaired area is adjusted to the brightness component, and the denoised image is converted back to the RGB color space to obtain the enhanced image.

[0112] In one feasible implementation, the food ingredient recognition module 20 is also used to construct a convolutional neural network model based on the ResNet-50 architecture, and to introduce a single dish feature enhancement layer into the fully connected layer of the convolutional neural network model. Feature extraction is performed on the standardized image to obtain the food characteristics; The food ingredient features are input into the convolutional neural network model to obtain the food ingredient categories.

[0113] In one feasible implementation, the food identification module 20 is further used to construct a training dataset covering various lighting conditions and food morphologies, the training dataset including image samples of fresh, frost-covered, and cut food. Based on the training dataset, the initial convolutional neural network is trained using the cross-entropy loss function and the stochastic gradient descent optimizer, and the learning rate is adjusted in stages to obtain the convergence efficiency of the initial convolutional neural network. When the convergence efficiency is greater than the preset convergence efficiency, the initial convolutional neural network is used as the convolutional neural network model; A single dish ingredient feature is generated based on a preset list of dish ingredients, and a single dish feature enhancement layer is constructed using the single dish ingredient feature; The single-dish feature enhancement layer is inserted into the fully connected layer of the convolutional neural network model.

[0114] In one feasible implementation, the precision weighing module 30 is further configured to obtain the weight of each of the food categories through at least one independent food weighing unit, wherein the food weight is obtained by analog-to-digital conversion of the pressure sensor signal of the food weighing unit. The weight reduction of each seasoning during the cooking process is monitored in real time using a differential weighing method through multiple independent seasoning weighing units, and the weight reduction is used as the weight of the seasoning.

[0115] In one feasible implementation, the nutrition measurement module 40 is also used to query a preset database according to the food category to obtain the edible part coefficient and raw-to-cooking ratio conversion parameters of the corresponding food. Calculate the net weight of the edible portion and the weight after cooking based on the weight of the ingredients, the edible portion coefficient, and the raw-to-cook ratio conversion parameter. The nutrient content of the dish is calculated by using a weighted summation method based on the weight of the seasonings used, the net weight of the edible portion, the weight after cooking, and preset nutritional parameters.

[0116] In one feasible implementation, the recipe push module 50 is further configured to, after the step of obtaining the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters, include: Upload the nutrient content of the dishes to the server; The receiving server generates a personalized dish recommendation list based on preset dietary guidance rules, user health records, and the nutrient content of the dishes. The personalized menu recommendation list will be pushed to you.

[0117] In one feasible implementation, the over-limit alarm module 60 is also used in the food proportioning and measurement method of the canteen kitchen, and further includes: Real-time monitoring of the weight of the seasoning used; When the weight of any seasoning is detected to exceed a preset threshold set for the dish or the user, an audible and visual warning is triggered.

[0118] The food proportioning and metering device for canteen kitchens provided in this application adopts the food proportioning and metering method for canteen kitchens in the above embodiments, which can solve the technical problems of inaccurate nutrient measurement and uncontrollable seasoning dosage. Compared with the prior art, the beneficial effects of the food proportioning and metering device for canteen kitchens provided in this application are the same as the beneficial effects of the food proportioning and metering method for canteen kitchens provided in the above embodiments, and other technical features in the food proportioning and metering device for canteen kitchens are the same as the features disclosed in the methods of the above embodiments, and will not be repeated here.

[0119] This application provides a food proportioning and measuring device for a canteen kitchen. The food proportioning and measuring device for a canteen kitchen includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the food proportioning and measuring method for a canteen kitchen in the above embodiment 1.

[0120] The following is for reference. Figure 5The diagram illustrates a structural schematic of a food proportioning and measuring device suitable for implementing the embodiments of this application in a canteen kitchen. The food proportioning and measuring device in the canteen kitchen of this application embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 5 The food proportioning and measuring equipment shown in the canteen kitchen is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0121] like Figure 5 As shown, the food proportioning and measuring device in the canteen kitchen may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in ROM (Read Only Memory) 1002 or the program loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the canteen kitchen's food proportioning and measuring device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the canteen kitchen's food proportioning and measuring equipment to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows canteen kitchen food proportioning and measuring equipment with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented alternatively.

[0122] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0123] The food proportioning and measuring device for a canteen kitchen provided in this application adopts the food proportioning and measuring method for a canteen kitchen in the above embodiments, which can solve the technical problem of food proportioning and measuring in a canteen kitchen. Compared with the prior art, the beneficial effects of the food proportioning and measuring device for a canteen kitchen provided in this application are the same as the beneficial effects of the food proportioning and measuring method for a canteen kitchen provided in the above embodiments, and other technical features of the food proportioning and measuring device for a canteen kitchen are the same as the features disclosed in the method of the previous embodiment, and will not be repeated here.

[0124] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0125] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0126] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the food proportioning and measurement method in the canteen kitchen of the above embodiments.

[0127] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory or Flash Memory), optical fibers, CD-ROM (CD-Read Only Memory), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0128] The aforementioned computer-readable storage medium may be included in the food proportioning and measuring equipment in the canteen kitchen; or it may exist independently and not be installed in the food proportioning and measuring equipment in the canteen kitchen.

[0129] The aforementioned computer-readable storage medium carries one or more programs that, when executed by the canteen kitchen's food proportioning and measuring equipment, cause the canteen kitchen's food proportioning and measuring equipment to: Collect food ingredient images, preprocess the food ingredient images to obtain standardized images; The standardized images are then identified to determine the food categories. Determine the weight of the ingredients corresponding to the ingredient categories, and the weight of seasonings used during the cooking process; The nutrient content of the dish is obtained based on the weight of the ingredients, the weight of the seasonings used, and the preset nutritional parameters.

[0130] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LAN (Local Area Network) or WAN (Wide Area Network)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0131] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0132] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0133] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described method for measuring the proportion of food ingredients in a canteen kitchen, thereby solving the technical problem of measuring the proportion of food ingredients in a canteen kitchen. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the method for measuring the proportion of food ingredients in a canteen kitchen provided in the above embodiments, and will not be repeated here.

[0134] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method for measuring the proportions of food ingredients in a canteen kitchen.

[0135] The computer program product provided in this application can solve the technical problems of inaccurate nutrient measurement and uncontrollable seasoning dosage. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the food proportioning and measurement method in the canteen kitchen provided in the above embodiments, and will not be repeated here.

[0136] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for measuring and proportioning ingredients in a canteen kitchen, characterized in that, The food preparation and measurement methods in the canteen kitchen include: Collect food ingredient images, preprocess the food ingredient images to obtain standardized images; The standardized images are then identified to determine the food categories. Determine the weight of the ingredients corresponding to the ingredient categories, and the weight of seasonings used during the cooking process; The nutrient content of the dish is obtained based on the weight of the ingredients, the weight of the seasonings used, and the preset nutritional parameters.

2. The method as described in claim 1, characterized in that, The steps of acquiring food ingredient images and preprocessing the food ingredient images to obtain standardized images include: Capture images of the food items placed in the food weighing area; The food image is denoised using the OpenCV library to obtain a denoised image. The denoised image is then processed to eliminate reflections and frost effects, resulting in an enhanced image. The enhanced image is cropped to obtain a cropped image containing the main food ingredient. The cropped image is normalized to obtain a standardized image.

3. The method as described in claim 2, characterized in that, The step of performing reflection and frost effect removal processing on the denoised image to obtain an enhanced image includes: The denoised image is converted from the RGB color space to the HSV color space; Based on the luminance component, the K-means clustering algorithm is used to segment the reflective and frost regions in the denoised image; Using a guided filtering algorithm, guided by the saturation component of the denoised image, texture details are restored in the reflective and frost areas to generate a repaired area; The repaired area is adjusted to the brightness component, and the denoised image is converted back to the RGB color space to obtain the enhanced image.

4. The method as described in claim 1, characterized in that, The step of identifying the standardized image to obtain the food category includes: A convolutional neural network model based on the ResNet-50 architecture was constructed, and a single dish feature enhancement layer was introduced into the fully connected layer of the convolutional neural network model. Feature extraction is performed on the standardized image to obtain the food characteristics; The food ingredient features are input into the convolutional neural network model to obtain the food ingredient categories.

5. The method as described in claim 4, characterized in that, The steps of constructing a convolutional neural network model based on the ResNet-50 architecture and introducing a single-dish feature enhancement layer into the fully connected layer of the convolutional neural network model include: Construct a training dataset covering various lighting conditions and food morphologies, including image samples of fresh, frost-covered, and pre-cut food. Based on the training dataset, the initial convolutional neural network is trained using the cross-entropy loss function and the stochastic gradient descent optimizer, and the learning rate is adjusted in stages to obtain the convergence efficiency of the initial convolutional neural network. When the convergence efficiency is greater than the preset convergence efficiency, the initial convolutional neural network is used as the convolutional neural network model; A single dish ingredient feature is generated based on a preset list of dish ingredients, and a single dish feature enhancement layer is constructed using the single dish ingredient feature; The single-dish feature enhancement layer is inserted into the fully connected layer of the convolutional neural network model.

6. The method as described in claim 1, characterized in that, The steps of determining the weight of the ingredients corresponding to the ingredient category and the weight of seasonings used during the cooking process include: The weight of each of the food items is obtained by at least one independent food weighing unit, wherein the food weight is obtained by analog-to-digital conversion of the pressure sensor signal of the food weighing unit; The weight reduction of each seasoning during the cooking process is monitored in real time using a differential weighing method through multiple independent seasoning weighing units, and the weight reduction is used as the weight of the seasoning.

7. The method as described in claim 1, characterized in that, The step of obtaining the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters includes: The system queries a pre-defined database based on the food category to obtain the edible portion coefficient and raw-to-cooking ratio conversion parameters for the corresponding food. Calculate the net weight of the edible portion and the weight after cooking based on the weight of the ingredients, the edible portion coefficient, and the raw-to-cook ratio conversion parameter. The nutrient content of the dish is calculated by using a weighted summation method based on the weight of the seasonings used, the net weight of the edible portion, the weight after cooking, and preset nutritional parameters.

8. The method as described in claim 1, characterized in that, After the step of obtaining the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters, the method further includes: Upload the nutrient content of the dishes to the server; The receiving server generates a personalized dish recommendation list based on preset dietary guidance rules, user health records, and the nutrient content of the dishes. The personalized menu recommendation list will be pushed to you.

9. The method as described in claim 1, characterized in that, The method for measuring and proportioning ingredients in the canteen kitchen also includes: Real-time monitoring of the weight of the seasoning used; When the weight of any seasoning is detected to exceed a preset threshold set for the dish or the user, an audible and visual warning is triggered.

10. A food proportioning and measuring device for a canteen kitchen, characterized in that, The food proportioning and measuring device in the canteen kitchen includes: The image acquisition module is used to acquire food images and preprocess the food images to obtain standardized images; The food ingredient recognition module is used to identify the standardized image to obtain the food ingredient category; The precision weighing module is used to determine the weight of the ingredients corresponding to the ingredient category, as well as the weight of seasonings used during the cooking process; The nutrition measurement module is used to obtain the nutrient content of the dish based on the weight of the ingredients, the weight of the seasonings used, and preset nutritional parameters.