Method for detecting quality of meals in student canteen

Through image understanding technology based on large language model, the problem of subjectivity and low efficiency of traditional manual detection methods is solved, and more accurate and economical food quality inspection is achieved, ensuring the food safety and health of the student canteen.

CN119294883APending Publication Date: 2025-01-10SHANGHAI YUYANG EDUCATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411270463.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Traditional food quality testing methods rely on artificial visual inspection, which have problems such as high subjectivity, low efficiency, limited accuracy, high cost and difficulty in standardization, making it difficult to ensure food safety and health.

Method used

Using image understanding technology based on large language model, through comparison module, recognition module and prediction module, canteen menus and student meal photos are obtained for comparison, foreign objects are detected and food taste is predicted, and image semantic feature extraction is used using deep learning model and large language model. Compared with dish information, reduce the subjectivity of human judgment.

Benefits of technology

It improves the fairness and accuracy of testing, ensures the safety and taste of students' meals, provides a healthier and satisfactory catering environment, reduces operating costs, and achieves effective monitoring and improvement of the quality of canteen food.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention relates to a student canteen meal quality detection method, which comprises a comparison module, an identification module and a prediction module, and is characterized in that the comparison module is used for obtaining a menu of a canteen on that day and a picture of taking meals of the canteen by a student, and comparing the menu published by the canteen with the taken meals of the canteen; the identification module is used for retrieving shot pictures of student meals and detecting whether foreign matters such as steel wire balls, crawlers and mice exist, the prediction module identifies semantic content of the pictures, the taste of the meals can be deduced by analyzing visual performance of the meals, the safety and taste of the student meals are further ensured, and the safety of the student meals is improved. The innovative detection method not only improves the fairness and accuracy of detection, but also provides a healthier and more satisfactory catering environment for students, at the same time, can effectively monitor and improve the overall quality of meals in a canteen, and ensures the diet safety and health of the students.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of canteen food detection, and in particular relates to a method for detecting food quality in a student canteen. Background Art

[0002] A school is a social activity undertaken by full-time personnel and specialized institutions in a purposeful, systematic, organized and planned manner with the direct goal of influencing the physical and mental development of the educated and ultimately achieving the predetermined goals of the educated's physical and mental development. School canteen food is also an issue that people are very concerned about. The school canteen has important responsibilities such as providing catering services, ensuring food safety, and promoting the physical health of students.

[0003] Traditional food quality inspection methods mainly rely on manual visual inspection and sensory evaluation, which have several shortcomings:

[0004] 1. High subjectivity: Manual evaluation is easily affected by the evaluator’s personal experience, emotions, and preferences, resulting in subjectivity and inconsistency in the evaluation results;

[0005] 2. Inefficiency: Manual inspections are usually time-consuming, especially in large-scale cafeteria environments, which limits the frequency and timeliness of testing;

[0006] 3. Limited accuracy: Visual inspections that rely on the human eye may not accurately identify all types of food defects or inconsistencies, especially in terms of subtle visual differences;

[0007] 4. High cost: Continuous manual evaluation requires a lot of human resources, which increases operating costs, especially when frequent testing is required;

[0008] 5. Difficulty in standardization: Due to the subjectivity of manual evaluation, it is difficult to establish a unified and standardized evaluation process, which may lead to differences in results between different evaluators;

[0009] 6. Unquantifiable: Traditional sensory evaluation is often difficult to quantify, which makes the results difficult to accurately compare and analyze, and difficult to use for continuous quality improvement;

[0010] Therefore, the use of image understanding technology based on a large language model for food quality detection can effectively overcome the shortcomings of these traditional methods and provide a more objective, efficient, accurate and economical solution. Summary of the invention

[0011] The purpose of the present invention is to provide a method for detecting the quality of food in a student cafeteria with a simple structure and reasonable design in order to solve the above problems.

[0012] The present invention achieves the above-mentioned purpose through the following technical solutions:

[0013] A method for detecting the quality of food in a student cafeteria, the detection method comprising: a comparison module, an identification module and a prediction module, the comparison module is used to obtain the cafeteria menu of the day and photos of students taking cafeteria meals, and compare the cafeteria's publicly displayed menu with the cafeteria meals taken, the identification module is used to retrieve photos of students' meals and detect whether there are foreign objects such as steel wool, reptiles, mice, etc., and the prediction module predicts the taste of meals based on photos of actual meals by identifying the semantic content of the photos.

[0014] As a further optimization scheme of the present invention, the specific comparison method of the comparison module includes the following steps:

[0015] S1. Get the canteen menu:

[0016] Obtain the canteen's public menu for the day through the API, obtain the corresponding picture of the menu, and combine the dish name and the menu picture into a corresponding relationship;

[0017] S2. Get photos of students’ meals in real time:

[0018] Use a camera to take real-time photos of students picking up their meals;

[0019] S3, image semantic feature extraction:

[0020] Extract image semantic features from the photo of taking food in S2 to obtain a feature vector;

[0021] S4. Large language model processing:

[0022] The feature vector is fed into the large language model, and the model is guided to describe the dish information through prompt words;

[0023] S5. Comparison of dish information:

[0024] The dish information generated by the large language model is compared with the cafeteria’s public menu through a comparison module;

[0025] S6. Result output:

[0026] Determine if there are missing or incorrect items, record and report discrepancies, and provide feedback to cafeteria management regarding inspection structure.

[0027] As a further optimization solution of the present invention, the comparison module adopts a defined difference function to measure the difference between the two, and uses Jaccard similarity to achieve comparison of the difference between the dish descriptions.

[0028] As a further optimization solution of the present invention, the identification method of the identification module includes the following steps:

[0029] S1. Image acquisition:

[0030] Use cameras to capture images of students’ meals;

[0031] S2. Image preprocessing:

[0032] Perform necessary preprocessing on the image;

[0033] S3. Model Reasoning:

[0034] The preprocessed image is input into the small object detection model, and the model output includes the prediction results of the object location and category;

[0035] S4. Result interpretation:

[0036] Extract object location coordinates and category information from the model output;

[0037] S5. Foreign matter detection:

[0038] Determine whether the object is a foreign body. If it is a foreign body, record its location coordinates.

[0039] S6. Result feedback:

[0040] If foreign matter is present, an alarm is sounded to notify the cafeteria management.

[0041] As a further optimization solution of the present invention, the prediction method of the prediction module includes the following steps:

[0042] S1. Image acquisition and preprocessing:

[0043] Use a high-resolution camera to shoot cafeteria dishes and pre-process the images, including denoising, adjusting brightness and contrast, to ensure image quality;

[0044] S2. Image feature extraction:

[0045] Use deep learning models to extract semantic features of images, including color, gloss, and saturation;

[0046] S3. Feature quantization and encoding:

[0047] Quantize the extracted features into numerical representations;

[0048] S4. Prompt word generation:

[0049] Generate prompt words based on the quantified features;

[0050] S5. Large language model input and processing:

[0051] Input the generated prompt words into the large language model;

[0052] S6. Output of taste inference results:

[0053] Based on the output of the large language model, we can infer the taste of the dish.

[0054] As a further optimization solution of the present invention, the detection model is PP-YOLO-E.

[0055] The beneficial effects of the present invention are: the present invention can infer the taste of food by analyzing its visual appearance, further ensuring the safety and taste of students' meals. This innovative detection method not only improves the fairness and accuracy of the detection, but also provides students with a healthier and more satisfactory dining environment. At the same time, it can effectively monitor and improve the overall quality of canteen meals, and ensure the food safety and health of students. The specific advantages are as follows:

[0056] Advantage 1: Deep image understanding capability: By leveraging the powerful image understanding capability of the large language model, the present invention can deeply analyze the details of objects in the image, not just the surface classification, but can understand the deep meaning of the image content. This capability is particularly important in food quality testing because it can more accurately identify and evaluate the appearance and quality of food;

[0057] Advantage 2: Using a large language model for image analysis can reduce the subjectivity of human judgment and improve the fairness and accuracy of detection, which is crucial to ensure a fair assessment of the quality of student cafeteria meals;

[0058] Advantage 3: The present invention not only evaluates the visual quality of food, but also can infer the taste of food through visual performance. This comprehensive evaluation capability can more comprehensively ensure the safety and taste satisfaction of students' meals;

[0059] Advantage 4: The large language model accumulates a lot of knowledge during the training process, which makes the model more efficient and accurate when dealing with complex food quality inspection tasks. The application of this knowledge can improve the intelligence level of the inspection system. DETAILED DESCRIPTION

[0060] The present application is described in further detail below. It is necessary to point out that the following specific implementation methods are only used to further illustrate the present application and cannot be understood as limiting the scope of protection of the present application. Technicians in this field can make some non-essential improvements and adjustments to the present application based on the above application content.

[0061] A method for detecting the quality of food in a student cafeteria comprises: a comparison module, a recognition module and a prediction module. The comparison module is used to obtain the cafeteria menu of the day and photos of students taking the cafeteria food, and compare the cafeteria menu with the cafeteria food taken. The recognition module is used to retrieve the photos of the students' food and detect whether there are foreign objects such as steel wool, reptiles and mice. The prediction module predicts the taste of the food according to the photos of the actual food by recognizing the semantic content of the photos.

[0062] The specific comparison method of the comparison module includes the following steps:

[0063] S1. Get the canteen public menu:

[0064] The canteen’s menu of the day is obtained through API, and the dish names and menu pictures are combined into a corresponding relationship. Let the dish set be C = {c1, c2, ..., c n}, where c i represents the i-th dish, and the corresponding image matrix set is P = {p1, p2, ..., p n}, where p i It is dish c i The picture matrix of

[0065] S2. Get photos of students’ meals in real time:

[0066] Use the camera to take photos of students taking food in real time, let the photo taken be l;

[0067] S3, image semantic feature extraction:

[0068] Extract semantic features from photo l and obtain feature vector F I This step is achieved through a pre-trained convolutional neural network (CNN), and the extracted feature vector is F I =CNN(l);

[0069] S4. Large language model processing:

[0070] The feature vector F I Input into the large language model, guide the model to describe the dish information in the image through prompt words, and assume that the prompt word set is T = {t1, t2, ..., t m , where t i is the jth prompt word, and the model outputs the dish description set D = {d1, d2, ..., d k , where (d l is the model’s description of the lth dish;

[0071] S5. Comparison of dish information:

[0072] Compare the set of dish descriptions output by the model with the set of dishes publicly displayed in the cafeteria, and define a difference function to measure the difference between the two. Here, Jaccard similarity is used to compare the differences in dish descriptions.

[0073] Assume D f (D, C) is the difference function, and its calculation formula is: Among them, |D∩C| represents the size of the intersection of D and C, and |D∪C| represents the size of the union of D and C;

[0074] S6. Result output:

[0075] According to the difference D f The value of (D, C) determines whether there are missing or incorrect dishes. If D f (D, C)<∈, where ∈ is 0.4, then it is considered that there is a difference.

[0076] The identification method of the identification module includes the following steps:

[0077] S1. Image acquisition:

[0078] Use a camera to take an image of a student’s meal. Let the image be (I) and its size be (W×H);

[0079] S2. Image preprocessing:

[0080] Perform necessary preprocessing on the image (I). This method uses image scaling and label normalization to adapt to the model input requirements. I′=Preprocess(I), where (Preprocess) represents the preprocessing function and (I′) is the preprocessed image.

[0081] S3. Model Reasoning:

[0082] The preprocessed image (I′) is input into the small object detection model PP-YOLO-E, and the model output includes the prediction results of the object location and category;

[0083] S4. Result interpretation:

[0084] Extract the object position coordinates and category information from the model output. Assume that the model output is (Y), which contains multiple detection boxes (B i ) and the corresponding confidence (S i ), Y = Model(I′), where (Model) represents the PP-YOLO-E model, and (Y) is the output of the model, including the detection box and confidence;

[0085] S5. Foreign matter detection:

[0086] Traverse each detection box (B in (Y)i ), determine whether its category is a foreign body, if it is a foreign body, record its position coordinates, B i =ExtractBoxes(Y), where (ExtractBoxes) is a function that extracts detection boxes from (Y). in, is an indicator function, if (B i ) returns 1 if it is a foreign object, otherwise returns 0;

[0087] S6. Result feedback:

[0088] The number of foreign body position coordinates recorded is counted and set as (N); if (N>0), a warning is issued; if (N=0), it means there is no foreign body in the food. Among them, (Warn) is a warning signal, 1 means issuing a warning, and 0 means not issuing a warning;

[0089] The prediction method of the prediction module includes the following steps:

[0090] S1. Image acquisition and preprocessing:

[0091] Use a high-resolution camera to shoot cafeteria dishes and pre-process the images, including denoising, adjusting brightness and contrast, to ensure image quality;

[0092] S2. Image feature extraction:

[0093] Use deep learning models to extract semantic features of images, including color, gloss, and saturation;

[0094] S3. Feature quantization and encoding:

[0095] The extracted features are quantized into numerical representations, and the feature quantization process is expressed using the formula: [F i =Q(I i )], where (F i ) is the quantized value of the (i)th feature, (Q) is the quantization function, (I i ) is the (i)th image feature;

[0096] S4. Prompt word generation:

[0097] Generate prompt words based on the quantized features. Prompt word generation can be expressed as: [P j =G(F j )], where (P j ) is the (j)th prompt word, (G) is the prompt word generation function, (F j ) is the corresponding feature quantization value;

[0098] S5. Large language model input and processing:

[0099] The generated prompt words are input into the large language model. The processing process of the large language model can be expressed as: k =L(P k )], where (R k ) is the dish taste inference result output by the model, (L) is the processing function of the large language model, (P k ) is the input prompt word;

[0100] S6. Output of taste inference results:

[0101] Based on the output of the large language model, the taste of the dish is inferred, and the output result can be expressed as: l =T(R l )], where (O l ) is the final taste inference result, (T) is the result conversion function, (R l ) is the inference result from the large language model.

[0102] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A method for detecting the quality of food in a student cafeteria, characterized in that: The detection method includes: a comparison module, an identification module and a prediction module. The comparison module is used to obtain the canteen's menu of the day and photos of students taking canteen meals, and compare the canteen's publicly displayed menu with the canteen meals taken. The identification module is used to retrieve the photos of students' meals and detect whether there are foreign objects such as steel wool, reptiles, and mice. The prediction module predicts the taste of the meal based on the actual meal photos by identifying the semantic content of the photos.

2. A method for detecting the quality of food in a student cafeteria according to claim 1, characterized in that: The specific comparison method of the comparison module includes the following steps: S1. Get the canteen menu: Obtain the canteen's public menu for the day through the API, obtain the corresponding picture of the menu, and combine the dish name and the menu picture into a corresponding relationship; S2. Get photos of students’ meals in real time: Use a camera to take real-time photos of students picking up their meals; S3, image semantic feature extraction: Extract image semantic features from the photo of taking food in S2 to obtain a feature vector; S4. Large language model processing: The feature vector is fed into the large language model, and the model is guided to describe the dish information through prompt words; S5. Comparison of dish information: The dish information generated by the large language model is compared with the cafeteria’s public menu through a comparison module; S6. Result output: Determine if there are missing or incorrect items, record and report discrepancies, and provide feedback to cafeteria management regarding inspection structure.

3. A method for detecting the quality of food in a student cafeteria according to claim 2, characterized in that: The comparison module adopts a defined difference function to measure the difference between the two, and uses Jaccard similarity to compare the difference between the dish descriptions.

4. A method for detecting the quality of food in a student cafeteria according to claim 1, characterized in that: The identification method of the identification module includes the following steps: S1. Image acquisition: Use cameras to capture images of students’ meals; S2. Image preprocessing: Perform necessary preprocessing on the image; S3. Model Reasoning: The preprocessed image is input into the small object detection model, and the model output includes the prediction results of the object location and category; S4. Result interpretation: Extract object location coordinates and category information from the model output; S5. Foreign matter detection: Determine whether the object is a foreign body. If it is a foreign body, record its location coordinates. S6. Result feedback: If foreign matter is present, an alarm is sounded to notify the cafeteria management.

5. A method for detecting the quality of food in a student cafeteria according to claim 1, characterized in that: The prediction method of the prediction module includes the following steps: S1. Image acquisition and preprocessing: Use a high-resolution camera to shoot cafeteria dishes and pre-process the images, including denoising, adjusting brightness and contrast, to ensure image quality; S2. Image feature extraction: Use deep learning models to extract semantic features of images, including color, gloss, and saturation; S3. Feature quantization and encoding: Quantize the extracted features into numerical representations; S4. Prompt word generation: Generate prompt words based on the quantified features; S5. Large language model input and processing: Input the generated prompt words into the large language model; S6. Output of taste inference results: Based on the output of the large language model, we can infer the taste of the dish.

6. A method for detecting the quality of food in a student cafeteria according to claim 4, characterized in that: The detection model is PP-YOLO-E.