Food waste detection method, device and system
Through image processing and deep neural network technology, food waste behavior is automatically identified, which solves the problem of low food waste identification efficiency in the existing technology and achieves high-precision, human-free intelligent monitoring.
Patent Information
- Application Number
- CN202310146854.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-17
- Publication Date
- 2024-08-20
AI Technical Summary
The identification efficiency of food waste behavior in the existing technology is low and relies on human labor for edible area measurement and food waste behavior identification, which cannot meet the needs of high-precision and long-term monitoring.
By obtaining the image to be detected, the target edible area is determined, the food category and waste volume are identified, and the preset correspondence between food category, volume and quality is used to automatically identify food waste behavior, using deep neural networks and three-dimensional point cloud data processing. Reduce human intervention.
It realizes human-free intelligent identification of food waste behaviors, improves identification efficiency, and can monitor food waste in real time at the food recycling station, reducing human errors and improving monitoring accuracy and efficiency.
Smart Images

Figure CN118521950A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of food detection and identification, and in particular to a food waste detection method, device and system. Background Art
[0002] With the development of society and the gradual improvement of living standards, food waste is becoming more and more common. At present, the investigation, analysis and measurement methods of food waste behavior are mostly concentrated in the field of manpower, such as accounting method, visual method, weighing method, etc. These methods are designed for specific scientific research goals and are not suitable for high-precision and long-term monitoring applications.
[0003] In the prior art, the edible areas in the discarded food images are manually marked, the food waste index is estimated based on the proportion of the edible area, and the amount of food waste is obtained by combining the amount of kitchen waste. This method relies on manpower to complete sample collection and data processing, and cannot meet the needs of associating food waste behavior with diners. It can be seen that the prior art often relies on manpower to determine whether there is food waste behavior, which leads to low recognition efficiency.
[0004] Application Contents
[0005] The purpose of the embodiments of the present application is to provide an edible area detection method, device and system to solve the problem in the prior art that it is impossible to intelligently determine whether there is food waste behavior without relying on manpower. The specific technical solution is as follows:
[0006] In a first aspect of an embodiment of the present application, a food waste detection method is provided, wherein the method comprises:
[0007] Acquire an image to be inspected including a container;
[0008] Determine a target edible area from the image to be detected; the target edible area is the area where the edible part of the image to be detected is located;
[0009] identifying actual food categories and food waste volumes for each of the target edible areas;
[0010] The mass of food waste in the edible part of the target edible area in the image to be detected is determined according to the preset correspondence between food category, volume and mass; the correspondence is predetermined based on the standard food category, standard volume and standard mass of the sample food for standard meal delivery.
[0011] In a possible embodiment, the corresponding relationship is established in advance in the following manner, including:
[0012] Acquire a standard image containing sample food; wherein the sample food is a standard serving food;
[0013] Identifying a standard edible area from the standard image; the standard edible area is the area where the edible part in the standard image is located;
[0014] Identify the standard food category and standard volume of each standard edible area, and obtain the standard mass of the edible portion of the sample food;
[0015] The corresponding relationship is established based on the standard food category, the standard volume and the standard mass.
[0016] In a possible embodiment, the standard mass is obtained based on statistics of sample food that has been weighed multiple times and served in a standard manner.
[0017] In a possible embodiment, the image to be detected is an RGB image and a depth image taken at a top-down angle perpendicular to a horizontal plane; and the step of identifying the food waste volume of each target edible area includes:
[0018] For each of the target edible areas, establishing three-dimensional point cloud data of the target edible area according to the RGB image and the depth image;
[0019] Dividing the three-dimensional point cloud data into a plurality of cubic elements along a plane perpendicular to the horizontal plane;
[0020] For each cubic element, the top surface of each cubic element is obtained by fitting;
[0021] Calculating the volume of the cubic element according to the external curved surface;
[0022] According to the volume of each of the cubic elements, the volume corresponding to the target edible area is obtained.
[0023] Actual food category Actual food category Actual food category Actual food category In a possible embodiment, the method further includes:
[0024] Acquire the person information in the image to be detected;
[0025] According to the food waste quality in the image to be detected, the food waste information corresponding to the personnel information is updated.
[0026] In a second aspect of an embodiment of the present application, a food waste detection device is provided, wherein the device comprises:
[0027] An acquisition module, used for acquiring an image to be inspected including the container;
[0028] A determination module, used to determine a target edible area from the image to be detected; the target edible area is the area where the edible part in the image to be detected is located;
[0029] An identification module, used for identifying the actual food category and food waste volume of each target edible area;
[0030] The food waste determination module is used to determine the food waste mass of the edible part in the target edible area in the image to be detected according to the preset correspondence between food category, volume and mass; the correspondence is predetermined based on the standard food category, standard volume and standard mass of the sample food of the standard meal.
[0031] In a possible embodiment, the correspondence is established in advance in the following manner, including: obtaining a standard image containing sample food; wherein the sample food is a standard serving food; identifying a standard edible area from the standard image; the standard edible area is an area where an edible part is located in the standard image; identifying a standard food category and a standard volume of each standard edible area, and obtaining a standard mass of the edible part of the sample food; and establishing the correspondence based on the standard food category, the standard volume, and the standard mass.
[0032] The standard quality is obtained based on the statistics of sample food that has been weighed multiple times and served in a standard manner;
[0033] The image to be detected is an RGB image and a depth image taken at a top-down angle perpendicular to the horizontal plane; the recognition module is specifically used to establish, for each of the target edible areas, three-dimensional point cloud data of the target edible area according to the RGB image and the depth image; divide the three-dimensional point cloud data into a plurality of cubic elements along a plane perpendicular to the horizontal plane; for each cubic element, fit the top surface of each cubic element; calculate the volume of the cubic element according to the external surface; and obtain the volume corresponding to the target edible area according to the volume of each cubic element;
[0034] The device also includes a personnel information acquisition module, which is used to acquire personnel information in the image to be detected; and update the food waste information corresponding to the personnel information according to the food waste quality in the image to be detected.
[0035] In a third aspect of the embodiments of the present application, an electronic device is provided, including:
[0036] Memory, used to store computer programs;
[0037] The processor is used to implement any method step described in the first aspect when executing the program stored in the memory.
[0038] In a fourth aspect of the embodiments of the present application, a food waste detection system is provided, characterized in that, as well as the electronic device as described in the second aspect above, wherein:
[0039] The camera device is used to obtain the image of the food to be inspected that is taken at the food recovery station and includes the container.
[0040] In a fifth aspect of the embodiments of the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0041] Beneficial effects of the embodiments of the present application:
[0042] A food waste detection method, device and system provided in the embodiments of the present application can first determine the edible area through the image to be detected that includes the container taken at the food recovery station, and then determine the food waste quality of the edible part of the edible area in the edible area in the image to be detected through the preset correspondence between the food category, volume and mass. In the present application, the image to be detected can be directly acquired through the existing image acquisition equipment, and the edible area in the image to be detected can be determined according to the pre-established correspondence between the food category, volume and mass, and the food waste quality can be determined based on the determined food category and volume, and then the food waste behavior in the image to be detected can be determined through the food waste quality, and then the food waste behavior in the image to be detected can be intelligently identified without manpower, thereby improving the recognition efficiency.
[0043] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0045] Figure 1-1 A schematic diagram of a food waste detection method provided in an embodiment of the present application;
[0046] Figure 1-2 A schematic diagram of a process flow of camera installation angle provided in an embodiment of the present application;
[0047] Figure 1-3 A schematic diagram of a process for training a target detection model provided in an embodiment of the present application;
[0048] Figure 1-4 A process framework diagram of a target detection model training provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of a process for determining food waste behavior provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of a process of another food waste detection method provided in an embodiment of the present application;
[0051] Figure 4 A schematic diagram of a process for establishing a corresponding relationship provided in an embodiment of the present application;
[0052] Figure 5-1 A schematic diagram of a process for calculating food waste volume provided in an embodiment of the present application;
[0053] Figure 5-2 , Figure 5-3 A schematic diagram of a split cubic element provided in an embodiment of the present application;
[0054] Figure 6 A flow chart of a food waste detection system provided in an embodiment of the present application;
[0055] Figure 7 A schematic diagram of a food waste detection device provided in an embodiment of the present application;
[0056] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0058] In existing research, the implementation of investigation, analysis and measurement methods for food waste behavior is mostly concentrated in the scope of strong reliance on manpower, such as accounting method, archaeological method, visual method, reasoning method, weighing method, etc. In general, these methods are designed for specific scientific research goals and are not suitable for large-scale, high-precision, and long-time monitoring applications. In the existing technology, since the measurement of edible areas and food waste behavior often rely on human identification, the identification efficiency is low.
[0059] Based on this, the present application provides an edible area detection method, such as Figure 1-1 As shown, including:
[0060] S101, obtaining an image to be inspected including a container.
[0061] S102, determining a target edible region from the image to be detected; the target edible region is a region where the edible part of the image to be detected is located.
[0062] S103, identifying the actual food category and food waste volume of each target edible area.
[0063] S104. Determine the mass of food waste in the edible part of the target edible area in the image to be detected according to the preset correspondence between food category, volume and mass; the correspondence is predetermined based on the standard food category, standard volume and standard mass of the sample food for standard meal delivery.
[0064] In an embodiment of the present application, the image to be detected that includes the container taken at the food recovery station is first used to determine the edible area from multiple candidate areas, and finally the food waste mass of the edible part of the edible area in the image to be detected is determined by the preset correspondence between the food category, volume and mass. In the present application, the image to be detected can be directly acquired through the existing image acquisition equipment, and the food waste mass of the edible area in the image to be detected can be determined according to the pre-established correspondence between the food category, volume and mass, and then the food waste behavior in the image to be detected can be determined by the food waste quality, so that the food waste behavior in the image to be detected can be intelligently identified without manpower, thereby improving the recognition efficiency.
[0065] The above steps S101-S104 are described in detail below:
[0066] In S101, the method of acquiring the image to be detected may be to install a camera device at the food collection station, and use the camera device to capture an image of the container being delivered to the food collection station as the image to be detected. The image to be detected needs to include the container. In order to facilitate the identification of the target edible area in the image to be detected, the camera device can be installed at an angle such as Figure 1-2 The installation includes a camera device 110 , a shooting angle 120 , and a container 130 , and the final result is that the shooting needs to be performed from directly above the container 130 .
[0067] In this embodiment, the image to be detected obtained by shooting from a vertical and horizontal plane bird's-eye view can more completely capture the remaining food in the container, so as to facilitate the identification and processing of all edible areas in the container and improve the recognition accuracy.
[0068] In S102, the target edible area may be identified based on a deep neural network model, and the target edible area may also be identified using a recognition algorithm module.
[0069] In another possible embodiment, multiple candidate areas can be determined from the image to be detected first, and then the target edible area can be determined from the multiple candidate areas. Specifically, the image to be detected can be marked by a target detection model, multiple candidate areas can be marked, and the target edible area can be determined from the multiple candidate areas. The target detection model can first convert the image to be detected into a feature map, and then mark all possible areas in the image to be detected to obtain a large number of initial areas. When marking, all possible target areas in the image to be detected are marked. At this time, indifferent marking is used, that is, all areas in the image to be detected are marked. Finally, the initial area is screened, and the foreground image and the background image are screened out, thereby obtaining multiple candidate areas.
[0070] For example, taking the image to be detected as RGB-D data, the color image RGB and the depth image Depth to be detected are aligned and fused to obtain point cloud data with color information (CombineImg). Under the condition that the camera intrinsic parameters are fixed, the spatial position and pixel coordinates of each point can be described as the following matrix model:
[0071]
[0072] Where R is the rotation matrix, t is the displacement vector, and s is the scaling factor of the depth map, which is the ratio of the data in the depth map to the actual distance, usually 1000 (in mm).
[0073] Get the point cloud data fusion image to construct the mathematical model of point cloud:
[0074]
[0075] where f x ,f y is the focal length of the camera on the x and y axes, c x ,c y The center of the camera's aperture.
[0076] Among them, x, y, and z are the characteristic values of each pixel point. The characteristic values of all pixels of the image to be detected are obtained by calculation, and then the feature map of the image to be detected can be obtained.
[0077] In this embodiment, each area in the image to be detected can be preliminarily screened to obtain multiple candidate areas, so that the target edible area can be subsequently determined from the results of the preliminary screening, thereby reducing the amount of data for subsequent determination of the target edible area and improving the efficiency of determining the target edible area.
[0078] The target detection model can be obtained by training a convolutional neural network model with sample images labeled with target edible areas. The specific training process will be described in detail later and will not be described in detail here.
[0079] In a feasible embodiment, the framework diagram of the target detection model is as follows: Figure 1-3 As shown in Figure 2, the training process of the target detection model is as follows: Figure 1-4 As shown in the figure, the image to be detected is input, multiple feature maps are obtained through feature conversion, and then the region of interest is aligned. The category and the bounding box containing the target edible area are obtained through the classification module. The non-interest area is masked through the mask module, which includes:
[0080] S1031. Determine multiple candidate regions in the sample image through the region recommendation module of the original detection model.
[0081] In this step, the sample images can be a large number of historical images containing dinner plates collected by a camera device, and the original detection model is constructed in advance based on actual needs. MASK R-CNN (instance segmentation model) can be constructed as the original detection model, and the model skeleton network can use ResNet101-FPN (a residual-based feature pyramid network).
[0082] For example, it is assumed that the original detection model is a MASK R-CNN model.
[0083] The specific steps include:
[0084] 1) Input the sample image into the original detection model and convert the sample image into the original feature map.
[0085] 2) Set a fixed number of initial ROIs (regions of interest) for each pixel position in the feature map.
[0086] 3) The initial ROI is sent to the RPN (region proposal network) network of the original detection model for binary classification (foreground and background) and coordinate regression to obtain the refined ROI area as the candidate region.
[0087] S1032. Determine a target region from multiple candidate regions as a prediction region through a classification module of the original detection model.
[0088] In this step, the target area is determined from multiple candidate areas. After the above steps, the sizes of the candidate areas obtained are inconsistent, so the efficiency is not high during recognition.
[0089] In a feasible embodiment, in order to improve recognition efficiency, multiple candidate regions may be aligned first.
[0090] Still taking the aforementioned MASK R-CNN model as an example, after obtaining the refined ROI region, the refined ROI region is subjected to the ROI Align operation to obtain the aligned ROI region. Then, the classification module is used to determine the target region from multiple aligned ROI regions as the prediction region.
[0091] S1033. According to the difference between the predicted area and the target edible area annotated in the sample image, the model parameters of the original detection model are adjusted to obtain a target detection model.
[0092] In this step, the sample image can be annotated manually or by using the Labelme tool. Any method that can be used for annotation can be applied to the embodiments of the present application. The present application does not limit the method of annotating the edible area of the sample image. When adjusting the model parameters of the original detection model according to the difference between the predicted area and the target edible area annotated by the sample image, a preset threshold can be set in advance. When the difference between the predicted area and the target edible area annotated by the sample image is less than the preset threshold, it means that the parameters of the original detection model have been trained, and the original detection model can be used as the target detection model. The preset threshold is set by those skilled in the art based on actual experience.
[0093] In this embodiment, the original detection model is trained by sample images, and the model parameters of the original detection model are continuously adjusted according to the difference between the predicted area and the target edible area annotated with the sample image to obtain the target detection model. Since the model parameters are adjusted using the real annotated target edible area as a reference, the network performance of the target detection model can be improved.
[0094] In S103, the food category of each target edible area is identified, and the identification can be performed through a recognition model. For example, the food category can be identified based on a deep neural network model or a traditional algorithm model. Any method that can be used for food category identification can be applied to the embodiments of the present application. The present application does not limit the method for identifying the food category of each edible area. How to identify the volume of the target edible area will be described in detail below, and no further details will be given here.
[0095] In S104, the preset correspondence between the food category, volume and quality is predetermined based on the standard food category, standard volume and standard quality of the sample food of the standard meal. The standard image of the sample food of the standard meal can be obtained by shooting, and then the food category and the volume of the food are identified based on the sample food, and the quality of the food is obtained to establish the correspondence between the food category, volume and quality. The method of identifying the volume of the food here is the same as the method of S103 above, which will be described in detail below. In addition, the specific steps for establishing the correspondence will be described in detail below, and will not be repeated here.
[0096] In a possible embodiment, Figure 2 As shown, the food waste behavior in the image to be detected can be determined by the following methods, including:
[0097] S201. Determine the food waste volume corresponding to the target edible area and the actual food category of the edible part in the target edible area.
[0098] In this step, the food waste volume of the target edible area can be obtained by scanning, or by using a 3D point cloud for 3D reconstruction and then calculating the food waste volume of the target edible area based on a finite element integration method. The actual food category can be identified by a recognition model, or by manual recognition.
[0099] S202. Determine the food waste volume and the mass corresponding to the actual food category according to the preset correspondence between volume, food category and mass, as the food waste mass.
[0100] In this step, since the ratio between the volume and mass of the same type of food can be considered to be certain, that is, there is a corresponding relationship, the food mass and food volume can be determined by the corresponding relationship. Therefore, after the food waste volume is known, the remaining mass can be calculated using the corresponding relationship. The relationship between the remaining mass, food waste volume, and the standard mass and standard volume of each type of food is as follows:
[0101]
[0102] Where m is the remaining mass of the target edible area, M is the standard mass of the standard edible area, and V e is the food waste volume of the target edible area, and V is the standard volume of the standard edible area.
[0103] According to the above relationship, the remaining mass of the target edible area can be calculated as the remaining mass.
[0104] S203: Determine the food waste behavior in the image to be detected according to the food waste quality.
[0105] In this step, a preset threshold may be set. When the mass of food waste is greater than the preset threshold, it indicates that food waste behavior exists in the image to be detected.
[0106] In this embodiment, by determining the food waste volume and actual food category corresponding to the target edible area, then based on the preset correspondence between volume, food category and quality, the food waste volume in the target edible area and the food waste mass corresponding to the actual food category are determined, and then based on the food waste mass, the food waste behavior in the image to be detected is determined. Based on the food waste information determined by the food waste quality, the waste behavior of diners can be accurately quantified. In addition, waste behavior can be stopped in a targeted manner, and people's awareness of saving food can be improved.
[0107] In another feasible embodiment, the food waste behavior in the image to be detected can also be determined by the difference between the preset volume and preset mass corresponding to the food category of the target edible area and the volume and food waste mass of the food in the edible area, wherein the preset volume and preset mass are the standard volume and standard mass corresponding to the standard serving of each food category. Specifically, it can be: when the difference between the volume of the food in the target edible area and the preset volume is less than a preset threshold and / or the difference between the food waste mass of the target edible area and the preset mass is less than a preset threshold, it can be determined that there is food waste behavior in the image to be detected. How to calculate the volume and mass of food will be described in detail in subsequent embodiments, and will not be elaborated on here.
[0108] Exemplarily, assuming that the food category of the target edible area in the image A to be detected is a, the volume of the food in the target edible area is calculated to be V1, and the mass of food waste is M1. According to the corresponding relationship, the preset volume of food category a is V, the instruction is M, the preset threshold for quality is g1, and the preset threshold for volume is g2. When V-V1<g1 and / or M-M1 is less than g2, it means that food waste behavior exists in the image A to be detected.
[0109] In another feasible embodiment, the above-mentioned preset threshold value related to food quality can be set to 0. When the preset threshold value is 0, it can be considered that once there is food waste quality, it can be considered that there is food waste behavior.
[0110] After determining the target edible area, in order to further understand how much food is wasted in the target edible area and who is wasting it, so as to stop the wasteful behavior of the person who wastes it, and educate the wasteful person, so as to improve the person's awareness of saving food. Figure 3 As shown, the method also includes:
[0111] S301: Obtaining information about a person in an image to be detected.
[0112] In this step, any method that can obtain personnel information can be applied to the embodiments of the present application.
[0113] In a feasible embodiment, the person information in the image to be detected can be obtained through a user recognition model.
[0114] For example, assuming that an image A of a diner A holding a dish to be detected is captured at a food recovery counter, basic information of person A can be identified through image recognition technology.
[0115] In another feasible embodiment, personnel information can be obtained through a card swiping device at the food recovery station.
[0116] For example, if a card reader (for identifying student cards or internal cards) is set up at the food recycling station, when dining person A takes the tableware to recycle, he needs to swipe the card every time to enter the food recycling station. In this way, the information of the person who swipes the card at the card reader when the image to be detected is captured can be identified.
[0117] S302. Update the food waste information corresponding to the personnel information according to the food waste quality in the image to be detected.
[0118] In this step, the food waste information can be the quality of food waste and / or the number of times food is wasted. The food waste information corresponding to the personnel information is stored in the system database. Every time the tableware is recycled at the food recycling station, the camera will capture the image of the person holding the utensils to be detected, and determine whether food waste behavior occurs based on the analysis of the image to be detected. If the person has food waste behavior, the food waste information in the system is updated. Every time waste behavior is detected, the system will remind the person to cherish food. A warning preset threshold can also be set. When the accumulated remaining mass of the diner is greater than the warning preset threshold, it means that the food waste behavior of the diner is very serious and needs warning education. The number of waste times of the diner can also be recorded. When the number of waste times exceeds the preset number, the diner will be educated in and out. The food waste behavior of the diner can also be measured in combination with the remaining mass and the number of waste times each time to carry out relevant education work for the diner.
[0119] In a possible embodiment, Figure 4 As shown, the corresponding relationship can be established in advance through the following steps, which include:
[0120] S401. Acquire a standard image containing sample food; wherein the sample food is standard food for serving.
[0121] In this step, a standard image may be taken in advance for sample food of each standard food category.
[0122] S402, identifying a standard edible region from a standard image; the standard edible region is a region where an edible part in the standard image is located.
[0123] S403, identifying the standard food category and standard volume of each standard edible area, and obtaining the standard mass of the edible part of the sample food.
[0124] S404: Establish a corresponding relationship based on the standard food category, standard volume and standard mass.
[0125] The calculation process of the above steps S402-S404 is similar to that of the above steps S102-S104. The specific execution steps can refer to the above description and will not be described in detail here.
[0126] In another feasible embodiment, in order to reduce the error of the standard mass, the standard mass may be obtained based on statistics of sample food that has been weighed and served multiple times.
[0127] In the embodiment, the standard mass is obtained by sampling the food mass of the samples multiple times, and is obtained by mathematical calculation, rather than being manually defined. When calculating the mass of food waste, since the standard mass value is within the confidence interval, the error caused by the actual meal quality can be ignored.
[0128] Standard mass calculation method: collect the sample mass of sample food weighed multiple times, use interval estimation method to calculate the mean, variance and average error of the sample mass, determine the confidence interval of the sample mass based on the mean, variance and average error of the sample mass, select the sample mass interval with a confidence level of a preset threshold, determine the sample mass of the above-mentioned sample mass falling within the interval from the sample mass interval, calculate the mean of the sample mass falling within the sample mass interval, and use the mean as the standard mass of the sample food. The preset threshold is set by technicians in this field based on actual experience.
[0129] In a feasible embodiment, since changes in food preparation methods may cause changes in the standard mass of the same food category, and since it is impossible to ensure that the standard mass of food is unique and unchanged, the standard mass can be determined within the error range, thereby reducing misjudgments caused by actual errors. Therefore, the standard mass can be updated, and the food can be weighed regularly when it is served, and the mass of the food can be recorded. Then, the standard mass of each type of food can be calculated using the above-mentioned standard mass calculation method, and the standard mass can be updated regularly to reduce actual errors.
[0130] In the embodiment of the present application, a correspondence between standard volume, standard food category and standard quality is established in advance based on standard meal delivery, and then the standard of waste behavior of each type of food can be set in a targeted manner based on the correspondence, and then it can be determined in a targeted manner whether the user has waste behavior, and then the accuracy of identifying the user's waste behavior can be improved. The correspondence will be updated regularly to reduce actual errors.
[0131] A feasible embodiment In a feasible embodiment, in order to improve the recognition accuracy, the present embodiment adopts the method of reconstructing the three-dimensional point cloud of the target edible area and calculating the volume of the remaining edible food in the plate based on the finite element integration method. Figure 5-1 As shown, for the convenience of calculation, the image to be detected is an RGB image and a depth image taken at a top-down angle perpendicular to the horizontal plane. The specific steps are as follows:
[0132] S501. For each target edible area, three-dimensional point cloud data of the target edible area is established according to the RGB image and the depth image.
[0133] In this step, the three-dimensional point cloud data of the target edible area is established for the feature map of the image to be detected.
[0134] S502 , dividing the three-dimensional point cloud data into a plurality of cubic elements along a plane perpendicular to the horizontal plane.
[0135] In this step, it is then divided into multiple cubic elements, and the division method is as follows Figure 5-2 , Figure 5-3 shown.
[0136] S503 , for each cubic element, obtain the top surface of each cubic element by fitting.
[0137] In this step, if Figure 5-2 The top surface shown is the top surface to be fitted in the embodiment of the present application. By combining and adding the top surfaces of all cubic elements, a complete surface can be obtained, such as Figure 5-3 Calculate the maximum value X in the X-axis direction of the spatial rectangular coordinate system max and minimum value X min Similarly, we get the maximum value Y in the Y-axis direction max and minimum value Y min. Surface fitting should first select data points that basically reflect the shape of the surface and are evenly distributed, and use surface skinning technology to generate a surface that basically reflects the shape of the surface and has good properties as the initial surface. Then find the corresponding point of the data point on the initial surface with a certain mapping relationship, and call the parameter value of the point the parameter value of the data point on the initial surface, and establish an overdetermined linear equation group at the same time. Finally, use the least squares method to solve the overdetermined linear equation group to obtain the best fitting surface for the data point.
[0138] S504. Calculate the volume of the cubic element according to the top surface.
[0139] In this step, the volume of the cubic element can be solved by double integral.
[0140] S505. Obtain the volume corresponding to the target edible area according to the volume of each cubic element.
[0141] In this step, if Figure 5-3 As shown, by adding the volumes of each cubic element together, the volume corresponding to the target edible area can be obtained.
[0142] In this embodiment, the accuracy of calculating the volume of the target edible area is improved by reconstructing a three-dimensional point cloud of the target edible area and calculating the volume of the remaining edible food in the plate based on the finite element integration method, thereby further improving the accuracy of identifying the user's wasteful behavior.
[0143] In this embodiment, when establishing the three-dimensional point cloud data, it is established based on the image to be detected, so the foreground and background and some interference areas are used to establish the three-dimensional point cloud data, which will be screened later. However, this will cause point cloud data that should not appear in the target edible area to appear in the point cloud data, and it will also waste time to screen. Therefore, in order to further improve the accuracy and speed of establishing the point cloud data, the method in the embodiment of the present application also includes:
[0144] S5011. Perform mask processing on areas other than the target edible area through the mask module of the target detection model to obtain a masked image.
[0145] S5012. Create three-dimensional point cloud data based on the masked image.
[0146] In this embodiment, by performing mask processing on the target detection image, some foreground images, background images and some interference images can be covered. When establishing three-dimensional point cloud data, only the target edible area can be established without interference from other areas, thereby improving the accuracy and speed of establishing point cloud data.
[0147] Corresponding to the aforementioned transfer learning method based on multi-task learning, the present application also provides a food waste detection device, such as Figure 6 As shown, the device comprises:
[0148] An acquisition module 601 is used to acquire an image to be detected including a container;
[0149] The determination module 602 is used to determine the target edible area from the image to be detected; the target edible area is the area where the edible part in the image to be detected is located;
[0150] An identification module 603 is used to identify the actual food category and food waste volume of each target edible area;
[0151] The food waste determination module 604 is used to determine the food waste mass of the edible part in the target edible area in the image to be detected based on the preset correspondence between food category, volume and mass; the correspondence is predetermined based on the standard food category, standard volume and standard mass of the sample food of the standard meal.
[0152] In a possible embodiment, the correspondence is established in advance in the following manner, including: obtaining a standard image containing sample food; wherein the sample food is a standard serving food; identifying a standard edible area from the standard image; the standard edible area is an area where an edible part is located in the standard image; identifying a standard food category and a standard volume of each standard edible area, and obtaining a standard mass of the edible part of the sample food; and establishing the correspondence based on the standard food category, the standard volume, and the standard mass.
[0153] The standard quality is obtained based on the statistics of sample food that has been weighed multiple times and served in a standard manner;
[0154] The image to be detected is an RGB image and a depth image taken at a top-down angle perpendicular to the horizontal plane; the recognition module is specifically used to establish, for each of the target edible areas, three-dimensional point cloud data of the target edible area according to the RGB image and the depth image; divide the three-dimensional point cloud data into a plurality of cubic elements along a plane perpendicular to the horizontal plane; for each cubic element, fit the top surface of each cubic element; calculate the volume of the cubic element according to the external surface; and obtain the volume corresponding to the target edible area according to the volume of each cubic element;
[0155] The device also includes a personnel information acquisition module 605, which is used to acquire personnel information in the image to be detected; and update the food waste information corresponding to the personnel information according to the food waste quality in the image to be detected.
[0156] Corresponding to the aforementioned transfer learning method based on multi-task learning, the present application also provides a food waste detection system, the system comprising: a camera device, comprising:
[0157] The camera device is used to obtain the image of the food to be inspected that is taken at the food recovery station and includes the container.
[0158] like Figure 7 As shown, the entire process design diagram of the system includes the following parts:
[0159] Constructing corresponding relationships, training target detection models, and updating food waste information. The specific steps are the same as the aforementioned S101-S104, S201-S203, S301-S302, S401-S404, and will not be repeated here.
[0160] The embodiment of the present application also provides an electronic device, which can be a depth camera, which can sample the color image and depth image of the video, and the depth camera directly analyzes and determines the food waste behavior. The electronic device can also be a server, which obtains the image captured by the depth camera or the personnel capture camera through the electronic device to analyze and determine the food waste behavior. Figure 8 As shown, the electronic device includes:
[0161] Memory 801, used for storing computer programs;
[0162] The processor 802 is used to execute the program stored in the memory 801, and implements the following steps:
[0163] Acquire an image to be inspected including a container;
[0164] Marking a plurality of candidate regions in the image to be detected;
[0165] determining an edible region from among the plurality of candidate regions;
[0166] identifying the food type and volume of each of said edible areas;
[0167] The food waste behavior in the image to be detected is determined according to the preset correspondence between food category, volume and mass; the correspondence is predetermined based on sample food of standard meal.
[0168] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 802, the communication interface, and the memory 801 communicate with each other via the communication bus.
[0169] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0170] The communication interface is used for communication between the above electronic device and other devices.
[0171] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0172] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0173] In another embodiment provided in the present application, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned food waste detection methods are implemented.
[0174] In another embodiment provided in the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the food waste detection methods in the above embodiments.
[0175] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0176] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0177] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0178] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A food waste detection method, characterized in that: The method comprises: Acquire an image to be inspected including a container; Determine a target edible area from the image to be detected; the target edible area is the area where the edible part of the image to be detected is located; identifying actual food categories and food waste volumes for each of the target edible areas; The mass of food waste in the edible part of the target edible area in the image to be detected is determined according to the preset correspondence between food category, volume and mass; the correspondence is predetermined based on the standard food category, standard volume and standard mass of the sample food for standard meal delivery.
2. The method according to claim 1, characterized in that The corresponding relationship is established in advance in the following ways, including: Acquire a standard image containing sample food; wherein the sample food is a standard serving food; Identifying a standard edible area from the standard image; the standard edible area is the area where the edible part in the standard image is located; Identify the standard food category and standard volume of each standard edible area, and obtain the standard mass of the edible portion of the sample food; The corresponding relationship is established based on the standard food category, the standard volume and the standard mass.
3. The method according to claim 2, characterized in that The standard quality is obtained based on the statistics of sample food that has been weighed multiple times and served in a standard manner.
4. The method according to claim 1, characterized in that: The image to be detected is an RGB image and a depth image taken at a top-down angle perpendicular to the horizontal plane; the method of identifying the food waste volume of each target edible area includes: For each of the target edible areas, establishing three-dimensional point cloud data of the target edible area according to the RGB image and the depth image; Dividing the three-dimensional point cloud data into a plurality of cubic elements along a plane perpendicular to the horizontal plane; For each cubic element, the top surface of each cubic element is obtained by fitting; Calculating the volume of the cubic element according to the external curved surface; According to the volume of each of the cubic elements, the volume corresponding to the target edible area is obtained.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Acquire the person information in the image to be detected; According to the food waste quality in the image to be detected, the food waste information corresponding to the personnel information is updated.
6. A food waste detection device, characterized in that: The device comprises: An acquisition module, used for acquiring an image to be inspected including the container; A determination module, used to determine a target edible area from the image to be detected; the target edible area is the area where the edible part in the image to be detected is located; An identification module, used for identifying the actual food category and food waste volume of each target edible area; The food waste determination module is used to determine the food waste mass of the edible part in the target edible area in the image to be detected according to the preset correspondence between food category, volume and mass; the correspondence is predetermined based on the standard food category, standard volume and standard mass of the sample food of the standard meal.
7. The device according to claim 6, characterized in that The corresponding relationship is established in advance in the following manner, including: obtaining a standard image containing sample food; wherein the sample food is a standard serving food; identifying a standard edible area from the standard image; the standard edible area is an area where an edible part is located in the standard image; identifying a standard food category and a standard volume of each standard edible area, and obtaining a standard mass of the edible part in the sample food; establishing the corresponding relationship based on the standard food category, the standard volume and the standard mass; The standard quality is obtained based on the statistics of sample food that has been weighed multiple times and served in a standard manner; The image to be detected is an RGB image and a depth image taken at a top-down angle perpendicular to the horizontal plane; the recognition module is specifically used to establish, for each of the target edible areas, three-dimensional point cloud data of the target edible area according to the RGB image and the depth image; divide the three-dimensional point cloud data into a plurality of cubic elements along a plane perpendicular to the horizontal plane; for each cubic element, fit the top surface of each cubic element; calculate the volume of the cubic element according to the external surface; and obtain the volume corresponding to the target edible area according to the volume of each cubic element; The device also includes a personnel information acquisition module, which is used to acquire personnel information in the image to be detected; and update the food waste information corresponding to the personnel information according to the food waste quality in the image to be detected.
8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-5 when executing a program stored in a memory.
9. A food waste detection system, characterized in that: The system comprises: a camera device, and the electronic device according to claim 8, wherein: The camera device is used to obtain the image of the food to be inspected that is taken at the food recovery station and includes the container.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Intelligent garbage identification and classification method
CN110813792A
Meal service management system and operating method therefor
CN111344734A
Catering content identification method and catering content identification system
CN114445614A
Multi-stage food nutrition assessment method and system
CN114519855A
Food waste assessment method and system based on image method
CN114926525A
Cited By
Food waste detection method and system based on image processing
CN120953607A
Catering food waste amount identification method and system based on machine vision
CN122435008A
