Food value generation method and device, electronic equipment and computer readable medium
Through the processing of food shooting images and semantic division information, image encoding and semantic encoding models are used to generate splicing information, which solves the problem that the image recognition model cannot match the food determination logic, realizes the accurate generation of food value information, and improves the accuracy of automatic services Sex and efficiency.
Patent Information
- Application Number
- CN202411659581.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-11-20
AI Technical Summary
In the prior art, when determining the value of food, the image recognition model cannot be matched with the logic of food determination, resulting in confusion and error in the determination of value information, wasted identification resources, and technical personnel need to coordinate and handle it.
By obtaining food-taking images and semantic division information, preprocessing images and inputting them into the image encoding model and semantic encoding model, generating splicing information, using the decoding model for semantic segmentation, and accurately determining the food value information.
Accurate food semantic segmentation information and value information generation, reduce errors and resource waste, and improve the accuracy and efficiency of automatic services.
Smart Images

Figure CN119152497A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, device, electronic device, and computer-readable medium for generating food value. Background Art
[0002] At present, with the continuous development of the restaurant industry, the existing automatic services for meals are becoming more and more intelligent. For determining the value information of the food corresponding to the user, the usual method is: first, the food is identified through an image recognition model. Then, according to the identified food, the value information of the identified food is determined through the pre-set food value determination logic. Finally, the value information of the food is sent to the user corresponding to the food.
[0003] However, when using the above method to determine value information, the following technical problems often occur: There may be different determination logics for the value of food. The image recognition model can only realize the recognition of food, but cannot match the determination logic of food, which may lead to confusion in the final selection of the value determination logic of food, resulting in errors in the determination of food value information. A lot of recognition resources are wasted, and relevant technical personnel are required to participate in the coordination process.
[0004] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention
[0005] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.
[0006] Some embodiments of the present disclosure propose a food value generation method, device, electronic device and computer-readable medium to solve one or more of the technical problems mentioned in the above background technology section.
[0007] In a first aspect, some embodiments of the present disclosure provide a method for generating food value, comprising: acquiring a currently acquired food photographed image and food semantic division information; performing image preprocessing on the above-mentioned food photographed image to generate a first preprocessed image; inputting the above-mentioned first preprocessed image into a pre-trained image coding model to generate first image coding information; inputting the above-mentioned food semantic division information into a pre-trained semantic coding model to generate food semantic coding information; performing information splicing on the above-mentioned food semantic coding information and the above-mentioned first image coding information to generate splicing information; inputting the above-mentioned splicing information into a pre-trained decoding model for semantic segmentation to generate food semantic segmentation information; and generating food value information corresponding to the above-mentioned food photographed image based on the above-mentioned food semantic segmentation information and the above-mentioned food semantic division information.
[0008] In a second aspect, some embodiments of the present disclosure provide a food value generating device, comprising: an acquisition unit, configured to acquire a currently acquired food photographed image and food semantic division information; a preprocessing unit, configured to perform image preprocessing on the above-mentioned food photographed image to generate a first preprocessed image; a first input unit, configured to input the above-mentioned first preprocessed image into a pre-trained image coding model to generate first image coding information; a second input unit, configured to input the above-mentioned food semantic division information into a pre-trained semantic coding model to generate food semantic coding information; a splicing unit, configured to splice the above-mentioned food semantic coding information and the above-mentioned first image coding information to generate splicing information; a third input unit, configured to input the above-mentioned splicing information into a pre-trained decoding model for semantic segmentation to generate food semantic segmentation information; a generation unit, configured to generate food value information corresponding to the above-mentioned food photographed image according to the above-mentioned food semantic segmentation information and the above-mentioned food semantic division information.
[0009] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.
[0010] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner in the first aspect is implemented.
[0011] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the food value generation method of some embodiments of the present disclosure, the value information of the corresponding food can be accurately generated on the basis of accurately generating food semantic segmentation information. Specifically, the reason why the value information of the relevant food is not accurate is that there may be different determination logics for the value of the food, and the image recognition model can only realize the recognition of the food, and cannot be matched with the determination logic of the food, resulting in confusion in the final selection of the value determination logic for the food, resulting in errors in the determination of the food value information. A large amount of recognition resources are wasted, and relevant technical personnel are required to participate in the coordination process. Based on this, the food value generation method of some embodiments of the present disclosure, first, obtains the currently obtained food shooting image and food semantic segmentation information, so as to obtain food information and food plate information through the food shooting image to determine the food value information. The food semantic segmentation information is used to realize the division and determination of the food corresponding to the food shooting image, which is convenient for the determination of the food value information. Then, the above-mentioned food shooting image is image preprocessed to generate a first preprocessed image to improve the image quality of the image and facilitate the subsequent extraction of image feature information. Next, the first preprocessed image is input into a pre-trained image coding model to generate first image coding information and extract the characteristic semantic content related to food in the image. Next, the food semantic segmentation information is input into a pre-trained semantic coding model to generate food semantic coding information and extract the characteristic semantic content related to how food is divided in the food semantic segmentation information. Secondly, the food semantic coding information and the first image coding information are spliced to generate splicing information to fuse the food semantic feature content with the image feature semantic content. Furthermore, the splicing information is input into a pre-trained decoding model for semantic segmentation to accurately generate food semantic segmentation information. Here, through the decoding model, the characteristic semantics corresponding to the food semantic coding information and the first image coding information can be fully considered to accurately perform food semantic segmentation processing. Finally, based on the food semantic segmentation information and the food semantic segmentation information, the food value information corresponding to the food shooting image can be accurately generated. In summary, the image coding model, semantic coding model and decoding model can be used to realize the feature semantic content extraction of food images, the feature extraction of food semantic content by the semantic coding model and the food semantic segmentation processing based on the fused feature information, so that accurate food value information can be obtained subsequently. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0013] Figure 1 is a flow chart of some embodiments of the food value generation method according to the present disclosure; Figure 2 is a schematic diagram of the structure of some embodiments of the food value generating device according to the present disclosure; Figure 3 is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure; Figure 4 It is a schematic diagram of first semantic division information, second semantic division information, third semantic division information and fourth semantic division information. DETAILED DESCRIPTION
[0014] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0015] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.
[0016] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0017] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0018] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0019] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0020] refer to Figure 1 , shows a process 100 of some embodiments of the food value generation method according to the present disclosure. The food value generation method comprises the following steps: Step 101, obtaining the currently acquired food photographed image and food semantic segmentation information.
[0021] In some embodiments, the execution subject of the above-mentioned food value generation method (for example, an electronic device) can obtain the currently acquired food shot image and food semantic division information through a wired connection method or a wireless connection method. Among them, the food shot image can be an image taken of the corresponding food at the target time point. There is a corresponding serving plate (i.e., a plate) for the corresponding food. Food semantic division information can represent information on how to semantically divide the food. In practice, food semantic division information can represent classification rules for how to classify food in corresponding situations. The target time point can be the time point corresponding to the target location. That is, when the food acquisition object reaches the target location with the food, the corresponding shooting process will be performed to obtain the food shot image. Food semantic division information can be information in text form.
[0022] In some optional implementations of some embodiments, each food plate in the above-mentioned food shooting image has a corresponding food division label. Among them, the food division label can represent the division standard of the food corresponding to the food plate. Among them, the food division label can be a standard information for determining how each food in the food plate is divided, which is affixed to each food plate. For example, the food division label can be: a first division label, a second division label, a third division label and a fourth division label. The first division label corresponds to the first semantic division information. The second division label corresponds to the second semantic division information. The third division label corresponds to the third semantic division information. The fourth division label corresponds to the fourth semantic division information. The first semantic division information can represent the division information based on the value determination of the food plate. Specifically, the first semantic division information can be the division information representing the value determination based on the shape of the food plate corresponding to the plate. In practice, the food value can be the food price. The food value can be the food price that the food object should pay during the food purchase process. For example, for the first semantic division information, the plate shape includes: a square shape, a triangle shape and a circular shape. The food price corresponding to the square shape can be 10 yuan. The price of food corresponding to the triangle shape may be 15 yuan. The price of food corresponding to the circular shape may be 20 yuan. The second semantic segmentation information may represent segmentation information that determines the value based on the type of food and regardless of the number. Specifically, the second semantic segmentation information may represent segmentation information that determines the value based on the type of food and regardless of the number. The type of food may be the type of food dish. Different food dishes have different corresponding prices. And the second semantic segmentation information does not calculate the number of food dishes. For example, for the second semantic segmentation information, the corresponding food types may include: scrambled eggs with tomatoes, fried pork with peppers, and spicy chicken nuggets. The corresponding price of scrambled eggs with tomatoes is 14 yuan. The price of fried pork with peppers is 24 yuan. The price of fried pork with peppers is 29 yuan. The third semantic segmentation information may represent segmentation information that determines the value based on the type of food and by number. Specifically, the third semantic segmentation information may represent segmentation information that determines the value based on the type of food and by number. For example, for the third semantic segmentation information, the corresponding food types may include: scrambled eggs with tomatoes, fried pork with peppers, spicy chicken nuggets, 2 eggs, and 4 steamed buns. The corresponding price of scrambled eggs with tomatoes is 14 yuan. The price of stir-fried pork with peppers is 24 yuan. The price of stir-fried pork with spicy chicken nuggets is 29 yuan. The corresponding price of each egg is 2 yuan, and the corresponding price of 2 eggs is 4 yuan. The price of 1 steamed bun is 0.5 yuan. The corresponding price of 4 steamed buns is 2 yuan. The fourth semantic division information can represent the division information for value determination based on the fourth semantic division information of food ingredients. Specifically, the fourth semantic division information can represent the division information for value determination based on whether the food is meat-type food or vegetarian food. Food ingredients can include: food ingredients including meat items and food ingredients not including meat items.For example, for the fourth semantic division information, the corresponding food component includes meat dishes and 1 meat dish and 2 vegetarian dishes, and the value is 14 yuan. The value of including meat dishes and 2 meat dishes and 1 vegetarian dish is 18 yuan. The value of including meat dishes and 3 meat dishes and 1 vegetarian dish is 25 yuan.
[0023] like Figure 4 As shown, a schematic diagram of first semantic division information, second semantic division information, third semantic division information and fourth semantic division information is shown.
[0024] Optionally, the food semantic segmentation information is generated by the following steps: The first step is to obtain the label description feature information corresponding to each food classification label from the target database. The label description feature information includes: label shape feature information, label position feature information and label font feature information. The target database may be a database storing all food classification labels. All food classification labels may be all complete food classification labels. There is a one-to-one correspondence between the food classification labels in each food classification label and the label description feature information in each label description feature information. The label description feature information may be information in the form of a vector. The label description feature information may represent the descriptive feature semantic content of the label. The label shape feature information may be in the form of a vector, representing the feature semantic content of the shape corresponding to the label. The label shape feature information may be in the form of a vector, representing the feature semantic content of the position of the label on the food plate. The label font feature information may be in the form of a vector, representing the feature semantic content of the font corresponding to the label.
[0025] In the second step, the above-mentioned food shooting image is input into the target detection model to generate at least one detection feature information for at least one initial detection object. Among them, the target detection model can be a neural network model that detects the label as the target detection object. In practice, the target detection model can be a YOLO V5 model + convolution layer. There is a one-to-one correspondence between the initial detection object in at least one initial detection object and the detection feature information in at least one detection feature information. The initial detection object can be a detection object that is initially considered to be a label predicted by the target detection model. The initial detection object can be an object to be labeled. The detection feature information can characterize the feature semantic content corresponding to the initial detection object. The detection feature information can be information in vector form.
[0026] As an example, the execution subject may input the food image into the YOLO V5 model to generate at least one detection information corresponding to at least one initial detection object. Then, the at least one detection information is input into the convolution layer to generate at least one detection feature information.
[0027] In the third step, for each detection feature information in the at least one detection feature information, the following first generation step is performed: Sub-step 1, input the above detection feature information into a pre-trained label shape feature extraction model to generate initial label shape feature information. The label shape feature extraction model may be a neural network model for extracting label shape feature information. In practice, the label shape feature extraction model may be a convolution layer + a fully connected layer of the first predetermined number of layers corresponding to the target detection model. The initial label shape feature information may be feature information related to the label shape in the detection feature information. For example, the first predetermined number of layers may be 11 layers.
[0028] Sub-step 2, input the above detection feature information into a pre-trained label position feature extraction model to generate initial label position feature information. The label position feature extraction model may be a neural network model for extracting label position feature information. In practice, the label position feature extraction model may be a convolutional layer + a fully connected layer of the second predetermined number of layers corresponding to the target detection model. The initial label position feature information may be feature information related to the label position in the detection feature information. For example, the second predetermined number of layers may be 11 layers.
[0029] Sub-step 3, input the above detection feature information into a pre-trained label font feature extraction model to generate initial label font feature information. The label font feature extraction model may be a neural network model for extracting label font feature information. In practice, the label font feature extraction model may be a convolutional layer + a fully connected layer of the third predetermined number of layers corresponding to the target detection model. The initial label font feature information may be feature information related to the label font in the detection feature information. For example, the third predetermined number of layers may be 8 layers.
[0030] Sub-step 4, feature comparison of the above-mentioned label shape feature information and each initial label shape feature information to generate first feature comparison information. The first feature comparison information can represent the feature similarity between the label shape feature information and the initial label shape feature information. For example, the first feature comparison information can be cosine similarity. The first feature comparison information can be a value between 0 and 1. The higher the value, the higher the feature similarity between the label shape feature information and the corresponding initial label shape feature information.
[0031] Sub-step 5, feature comparison is performed on the above-mentioned tag position feature information and each initial tag position feature information to generate second feature comparison information. The second feature comparison information can represent the feature similarity between the tag position feature information and the initial tag position feature information. For example, the second feature comparison information can be cosine similarity. The second feature comparison information can be a value between 0 and 1. The higher the value, the higher the feature similarity between the tag position feature information and the corresponding initial tag position feature information.
[0032] Sub-step 6, feature comparison of the above-mentioned label font feature information and each initial label font feature information to generate third feature comparison information. The third feature comparison information can represent the feature similarity between the label font feature information and the initial label font feature information. For example, the third feature comparison information can be cosine similarity. The third feature comparison information can be a value between 0 and 1. The higher the value, the higher the feature similarity between the label font feature information and the corresponding initial label font feature information.
[0033] Sub-step 7, determining whether the initial detection object corresponding to the detection feature information is a target detection object based on the first feature comparison information, the second feature comparison information and the third feature comparison information.
[0034] As an example, the execution subject may determine the average similarity values corresponding to the first feature comparison information, the second feature comparison information, and the third feature comparison information. Finally, in response to determining that the average similarity value is greater than or equal to the target value, the initial detection object corresponding to the detection feature information is determined to be the target detection object. In response to determining that the average similarity value is less than the target value, the initial detection object corresponding to the detection feature information is determined not to be the target detection object.
[0035] Sub-step 8, inputting at least one target detection feature information corresponding to the above-mentioned at least one target detection object into a pre-trained food partition label content generation model to generate at least one food partition label content. The food partition label content generation model may be a neural network model for generating food partition label content. There is a one-to-one correspondence between the food partition label content in at least one food partition label content and the target detection object in at least one target detection object. The food partition label content may be the label content corresponding to the food partition label. The food partition label content generation model may be a decoding model of a multi-output model. In practice, the food partition label content generation model may include: a downsampling model + multiple convolutional layers connected in series. The downsampling model may be a pyramid model.
[0036] In a fourth step, deduplication processing is performed on the content of the at least one food classification label to generate at least one semantic classification information as the food semantic classification information.
[0037] Step 102: performing image preprocessing on the food image to generate a first preprocessed image.
[0038] In some embodiments, the execution subject may perform image preprocessing on the food image to generate a first preprocessed image, wherein the image preprocessing may be but is not limited to at least one of the following: image preliminary cropping, image resizing, and image sharpening.
[0039] As an example, the execution entity may use image processing software to perform image preprocessing on the food image to generate a first preprocessed image.
[0040] Step 103: input the first preprocessed image into a pre-trained image coding model to generate first image coding information.
[0041] In some embodiments, the execution entity may input the first preprocessed image into a pretrained image coding model to generate first image coding information. The image coding model may be a neural network model for content coding the semantic content in the image. In practice, the image coding model may be a plurality of convolutional layers connected in series. For example, the image coding model may be 11 convolutional layers connected in series for downsampling processing. The first image coding information may be information in vector form that characterizes the semantic content of the features corresponding to the first preprocessed image.
[0042] Step 104: input the food semantic classification information into a pre-trained semantic coding model to generate food semantic coding information.
[0043] In some embodiments, the execution entity may input the food semantic segmentation information into a pre-trained semantic coding model to generate food semantic coding information. The semantic coding model may be a neural network model that performs information encoding processing on the semantic segmentation information. The food semantic coding information may be information in vector form that represents the encoding processing of the food semantic content. In practice, the semantic coding model may be a Bert pre-trained model.
[0044] In some optional implementations of some embodiments, the above-mentioned food semantic division information includes at least one of the following: first semantic division information based on food plates, second semantic division information based on food types and not counting purposes, third semantic division information based on food types and determined by number, and fourth semantic division information based on food ingredients.
[0045] Optionally, the execution entity may input at least one of the first semantic division information, the second semantic division information, the third semantic division information and the fourth semantic division information into the semantic coding model to generate food semantic coding information.
[0046] Step 105: splicing the food semantic coding information and the first image coding information to generate splicing information.
[0047] In some embodiments, the execution entity may splice the food semantic coding information and the first image coding information to generate splicing information.
[0048] Step 106: input the above-mentioned splicing information into a pre-trained decoding model for semantic segmentation to generate food semantic segmentation information.
[0049] In some embodiments, the execution entity may input the splicing information into a pre-trained decoding model for semantic segmentation to generate food semantic segmentation information. The food semantic segmentation information may be information after semantic segmentation of food. The decoding model may be a multi-layer series-connected neural network for upsampling processing. For example, the decoding model may be a 16-layer series-connected convolutional layer for upsampling processing. It should be noted that the image coding model, the semantic coding model, and the decoding model are trained synchronously.
[0050] In the process of adopting technical solutions to solve the technical problems mentioned in the background technology, the following problems often occur: the decoding model cannot realize feature processing for splicing information, resulting in limited feature information extracted by the decoding model and inaccurate food semantic segmentation information generated. In view of these problems, combined with the advantages / technical status of the inventor's company, the following implementation method is adopted to enable the decoding model to fully utilize the various feature information included in the splicing information.
[0051] In some optional implementations of some embodiments, the above-mentioned splicing information is input into a pre-trained decoding model for semantic segmentation to generate food semantic segmentation information, including: In the first step, the above-mentioned splicing information is input into the attention mechanism model included in the above-mentioned decoding model to generate semantic splicing information representing the first image coding information and the target semantic division feature information. Wherein, the splicing information may include: the first image coding information, the first semantic division feature information corresponding to the first semantic division information, the second semantic division feature information corresponding to the second semantic division information, the third semantic division feature information corresponding to the third semantic division information, and the fourth semantic division feature information corresponding to the fourth semantic division information. The target semantic division feature information may be the semantic division feature information that is most similar to the first image coding information among the first semantic division feature information, the second semantic division feature information, the third semantic division feature information and the fourth semantic division feature information. The attention mechanism model is used to screen out the semantic division feature information that best matches the feature information between the first image coding information. In practice, the attention mechanism model may be a multi-head attention mechanism model.
[0052] In the second step, the semantic concatenation information is input into a feature fusion model to generate first fused feature information. The feature fusion model can be a model of multiple convolutional layers connected in series, which is used to fuse and extend the food semantic encoding information and the target semantic segmentation feature information.
[0053] The third step is to input the first fusion feature information into the food semantic segmentation layer included in the decoding model to output the first initial food semantic segmentation information and the first segmentation score. The food semantic segmentation layer can be a network layer for semantically segmenting food. In practice, the food semantic segmentation layer can be a U-net model. The first segmentation score can represent the segmentation accuracy corresponding to the first initial food semantic segmentation information. The higher the first segmentation score, the higher the corresponding segmentation accuracy.
[0054] In the fourth step, the first image coding information and the remaining semantic division feature information sets are input into a feature fusion model to generate second fusion feature information. The remaining semantic division feature information sets may be information sets obtained by removing the target semantic division feature information from the first semantic division feature information, the second semantic division feature information, the third semantic division feature information, and the fourth semantic division feature information.
[0055] In the fifth step, the second fusion feature information is input into the food semantic segmentation layer included in the decoding model to output the second initial food semantic segmentation information and the second segmentation score. The second segmentation score can represent the segmentation accuracy corresponding to the second initial food semantic segmentation information. The higher the second segmentation score, the higher the corresponding segmentation accuracy.
[0056] The sixth step is to determine whether the first initial food semantic segmentation information is consistent with the second food semantic segmentation information.
[0057] Step 7: In response to determining that there is inconsistency, determine whether the subtraction score corresponding to the subtraction of the first split score from the second split score is greater than a target score. The target score may be a preset score. For example, the target score may be 40.
[0058] In step eight, in response to determining that the score is greater than the target score, the first initial food semantic segmentation information is determined as the above-mentioned food semantic segmentation information.
[0059] In step 9, in response to determining that the score is not greater than the target score, the concatenation information corresponding to the first image coding information and the remaining semantic division feature information sets is input into the attention mechanism model to generate the secondary semantic concatenation information representing the first image coding information and the secondary semantic division feature information. The secondary semantic division feature information may be the remaining semantic division feature information with the highest feature similarity with the first image coding information in the remaining semantic division feature information sets.
[0060] The tenth step is to fuse the secondary semantic splicing information with the above semantic splicing information to generate splicing information.
[0061] In the eleventh step, the splicing information is input into the feature fusion model to generate third fused feature information. For the explanation of the third fused feature information, please refer to the explanation of the second fused feature information.
[0062] In the twelfth step, the secondary semantic partition feature information is removed from the remaining semantic partition feature information sets to generate a post-removal feature information set.
[0063] In the thirteenth step, the removed feature information set and the first image coding information are input into a feature fusion model to generate fourth fused feature information.
[0064] In the fourteenth step, the third fused feature information is input into the food semantic segmentation layer to generate third initial food semantic segmentation information and a third segmentation score.
[0065] In the fifteenth step, the fourth fused feature information is input into the food semantic segmentation layer to generate fourth initial food semantic segmentation information and a fourth segmentation score.
[0066] In step 16, in response to determining that the third initial food semantic segmentation information is different from the fourth initial food semantic segmentation information, and the third segmentation score is higher than the fourth segmentation score, the first initial food semantic segmentation information is determined as the food semantic segmentation information.
[0067] The above technical solution and its related contents, as an inventive point of an embodiment of the present disclosure, solve the technical problem that the decoding model cannot realize feature processing for splicing information, resulting in limited feature information extracted by the decoding model and insufficient accuracy of the generated food semantic segmentation information. Based on this, the present disclosure uses the attention mechanism model, food semantic segmentation layer and feature fusion model included in the decoding model to extract more accurate semantic segmentation feature information to subsequently generate food semantic segmentation information, so that the obtained food semantic segmentation information is more accurate.
[0068] Step 107: Generate food value information corresponding to the food captured image based on the food semantic segmentation information and the food semantic division information.
[0069] In some embodiments, the execution subject may generate food value information corresponding to the food photographed image based on the food semantic segmentation information and the food semantic division information. The food value information may be value information of the food corresponding to the food photographed image. In practice, the food value information may be the amount payable for the corresponding food.
[0070] In some optional implementations of some embodiments, the food semantic segmentation information includes: at least one segmentation sub-image, wherein each segmentation sub-image may represent each sub-image after the target food image is segmented by food semantics.
[0071] Optionally, the generating of food value information corresponding to the food photographed image according to the food semantic segmentation information and the food semantic division information includes: In the first step, in response to determining that the food semantic segmentation information is the first semantic segmentation information, the image size information corresponding to the at least one segmented sub-image is determined to obtain at least one image size information. There is a one-to-one correspondence between the segmented sub-image in the at least one segmented sub-image and the image size information in the at least one image size information. The image size information can represent the image size corresponding to the segmented sub-image.
[0072] The second step is to obtain a first value table representing the correspondence between the image size information and the value information for the first semantic segmentation information from the target database. In practice, for a dining scene, the value information may be a price. The first value table may be an association table representing the correspondence between the image size and the price.
[0073] The third step is to determine the value information corresponding to each image size information in the at least one image size information according to the first value table to obtain at least one first value information.
[0074] The fourth step is to add up each of the at least one first value information to generate added information as food value information.
[0075] In a fifth step, in response to determining that the food semantic segmentation information is the second semantic segmentation information, each of the at least one segmented sub-image is input into a pre-trained first food type information generation model to generate first food type information, and obtain at least one first food type information, wherein the first food type information includes: food type. The first food type information generation model may be a neural network model for generating food type information. The food type information may be food dish information. In practice, the first food type information generation model may be a target detection model that takes food type (i.e., food dish) as the detection object. In practice, the first food type information generation model may include: a multi-layer series of convolutional layers + a YOLO V5 model.
[0076] Step 6: Obtain a second value table from the target database, and determine the value information corresponding to each of the at least one first food type information according to the second value table to obtain at least one second value information. The second value table may represent the correspondence between the food type and the corresponding value information (e.g., price). For example, the second value table may represent the correspondence between each food dish and the corresponding price.
[0077] The seventh step is to add up the respective second value information in the at least one second value information to generate added information as food value information.
[0078] In the eighth step, in response to determining that the food semantic segmentation information is the third semantic segmentation information, each segmentation sub-image in the at least one segmentation sub-image is input into a pre-trained second food type information generation model to generate second food type information, thereby obtaining at least one second food type information. The second food type information includes: food type and food number. The second food type information generation model may be a neural network model for generating food type information. The food type information may be food dish information. In practice, the second food type information generation model may be a target detection model that uses food type (i.e., food dish) as the detection object. In practice, the second food type information generation model may include: multiple layers of serially connected convolutional layers + YOLO V5 model. The number of convolutional layers of the multiple serially connected convolutional layers corresponding to the second food type information generation model and the number of convolutional layers of the multiple serially connected convolutional layers corresponding to the first food type information generation model may be different.
[0079] In step 9, according to the second value table, the value information corresponding to each second food type information in the at least one second food type information is determined to obtain at least one third value information. The third value information is the value information obtained by multiplying the corresponding value of the food type corresponding to the second food type information by the number of foods. The third value information can be the price corresponding to the food type.
[0080] The tenth step is to add up each of the at least one third value information to generate added information as food value information.
[0081] In step 11, in response to determining that the food semantic segmentation information is the fourth semantic segmentation information, each of the at least one segmented sub-image is input into a pre-trained food composition information generation model to generate food composition information, thereby obtaining at least one food composition information. The food composition information generation model may be a meat food recognition model. In practice, the meat food recognition model may also be a neural network model that uses meat food as the recognition object. The food composition information may represent the cost information of whether each dish is a meat dish.
[0082] Step 12: Obtain a pre-stored third value table representing the relationship between food ingredient combinations and value information from the target database. The third value table may represent the relationship between food ingredients and prices under various types. Food ingredients under various types may include: food ingredients represented as one meat and two vegetables, food ingredients represented as two meats and one vegetable, food ingredients represented as two meats and two vegetables, food ingredients represented as three meats, and food ingredients represented as three vegetables.
[0083] In the thirteenth step, according to the third value table, value information corresponding to the food ingredient combination corresponding to the at least one food ingredient information is determined as the food value information.
[0084] As an example, the execution subject may determine the value information corresponding to the food ingredient combination corresponding to the at least one food ingredient information by querying the third value table as the food value information.
[0085] In some optional implementations of some embodiments, after step 107, the steps further include: The first step is to instruct the food acquisition object corresponding to the above-mentioned food photographed image to place the food corresponding to the above-mentioned food photographed image on the target placement platform. The food acquisition object may be the acquisition object of the food corresponding to the food photographed image. That is, the food acquisition object may be a user who purchases food. The target placement platform may be a platform for placing food.
[0086] In the second step, in response to determining that the corresponding food has been placed on the target placement platform, a historical food image sequence corresponding to the food image is obtained. The shooting time corresponding to the historical food image is earlier than the shooting time corresponding to the food image. The historical food image can be an image taken of the food held by the food acquisition object at a historical time. The historical food images in the historical food image sequence correspond to the historical time in the historical time period.
[0087] The third step is to remove the historical food images whose corresponding food contents do not meet the preset content condition from the above historical food image sequence to obtain the removed historical food image sequence. The preset content condition may be that the pixel ratio of the food in the image is greater than the target ratio value.
[0088] The fourth step is to perform semantic segmentation verification on the food semantic segmentation information based on the above-mentioned removed historical food shooting image sequence and the above-mentioned food semantic segmentation information to obtain verification information.
[0089] In step 5, in response to determining that the verification information representation is correct, the food content corresponding to the food photographed image is displayed on the display platform corresponding to the target placement platform, and the food value information is displayed on the display platform as a QR code, so that the food acquisition object can transfer the corresponding value. The display platform can be a platform that displays QR code information, food value and food information. The display platform is located above the target placement platform.
[0090] In some optional implementations of some embodiments, performing semantic segmentation verification on the food semantic segmentation information according to the above-mentioned removed historical food shooting image sequence and the above-mentioned food semantic segmentation information to obtain verification information may include the following steps: In the first step, for each historical food shot image in the above-mentioned removed historical food shot image sequence, the following second generation step is performed: Sub-step 1: performing image preprocessing on the above-mentioned historical food photographed image to generate a second preprocessed image.
[0091] Sub-step 2: inputting the second preprocessed image into the image coding model to generate second image coding information.
[0092] Sub-step 3, inputting the above-mentioned food semantic coding information and the above-mentioned second image coding information into the above-mentioned decoding model to generate historical food semantic segmentation information.
[0093] Sub-step 4: determining a semantic segmentation image set corresponding to the above-mentioned historical food semantic segmentation information. The specific implementation method will not be described in detail.
[0094] In the second step, the semantic segmentation images in the obtained semantic segmentation image set sequence are clustered to obtain semantic segmentation image cluster sets.
[0095] As an example, first, image coding is performed on each semantic segmentation image in the above-mentioned semantic segmentation image set sequence to generate image coding information and obtain an image coding information set. Then, the image coding information set is clustered using the K-means algorithm to generate an image coding information cluster set. Finally, a semantic segmentation image clustering cluster set corresponding to the image coding information cluster set is generated.
[0096] The third step is to determine the similarity between the cluster center set corresponding to the above semantic segmentation image clustering cluster set and at least one divided sub-image. The similarity can represent the overall image content similarity between the cluster center set and at least one divided sub-image. The similarity can include multiple sub-similarity. The sub-similarity can represent the image similarity between the cluster center and the divided sub-image.
[0097] As an example, first, the execution subject may perform a corresponding combination of the cluster center in the cluster center set and the divided sub-image in at least one divided sub-image to generate a combined information set. Then, the image semantic similarity between the two images corresponding to each combined information in the combined information set is determined as a sub-similarity. Finally, the obtained sub-similarity set is determined as the similarity.
[0098] In the fourth step, in response to determining that the similarity is greater than or equal to the target similarity value, verification information indicating that the verification has passed is generated, wherein the target similarity value may be a preset value.
[0099] Optionally, the above method further includes: In the first step, in response to determining that the similarity is less than the target similarity value, verification information indicating that the verification has failed is generated.
[0100] In the second step, a food image of the corresponding food placed on the target placement platform is re-photographed as a real-time food image.
[0101] The third step is to generate the corresponding food value information according to the real-time food image. The specific implementation method can refer to the implementation method of generating the corresponding food value information by taking a food image.
[0102] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the food value generation method of some embodiments of the present disclosure, the value information of the corresponding food can be accurately generated on the basis of accurately generating food semantic segmentation information. Specifically, the reason why the value information of the relevant food is not accurate is that there may be different determination logics for the value of the food, and the image recognition model can only realize the recognition of the food, and cannot be matched with the determination logic of the food, resulting in confusion in the final selection of the value determination logic for the food, resulting in errors in the determination of the food value information. A large amount of recognition resources are wasted, and relevant technical personnel are required to participate in the coordination process. Based on this, the food value generation method of some embodiments of the present disclosure, first, obtains the currently obtained food shooting image and food semantic segmentation information, so as to obtain food information and food plate information through the food shooting image to determine the food value information. The food semantic segmentation information is used to realize the division and determination of the food corresponding to the food shooting image, which is convenient for the determination of the food value information. Then, the above-mentioned food shooting image is image preprocessed to generate a first preprocessed image to improve the image quality of the image and facilitate the subsequent extraction of image feature information. Next, the first preprocessed image is input into a pre-trained image coding model to generate first image coding information and extract the characteristic semantic content related to food in the image. Next, the food semantic segmentation information is input into a pre-trained semantic coding model to generate food semantic coding information and extract the characteristic semantic content related to how food is divided in the food semantic segmentation information. Secondly, the food semantic coding information and the first image coding information are spliced to generate splicing information to fuse the food semantic feature content with the image feature semantic content. Furthermore, the splicing information is input into a pre-trained decoding model for semantic segmentation to accurately generate food semantic segmentation information. Here, through the decoding model, the characteristic semantics corresponding to the food semantic coding information and the first image coding information can be fully considered to accurately perform food semantic segmentation processing. Finally, based on the food semantic segmentation information and the food semantic segmentation information, the food value information corresponding to the food shooting image can be accurately generated. In summary, the image coding model, semantic coding model and decoding model can be used to realize the feature semantic content extraction of food images, the feature extraction of food semantic content by the semantic coding model and the food semantic segmentation processing based on the fused feature information, so that accurate food value information can be obtained subsequently.
[0103] Further references Figure 2 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a food value generation device. These device embodiments are similar to Figure 1 Corresponding to the method embodiments shown, the food value generating device can be specifically applied to various electronic devices.
[0104] like Figure 2 As shown, a food value generating device 200 includes: an acquisition unit 201, a preprocessing unit 202, a first input unit 203, a second input unit 204, a splicing unit 205, a third input unit 206 and a generating unit 207. Among them, the acquisition unit 201 is configured to acquire the currently acquired food shooting image and food semantic division information; the preprocessing unit 202 is configured to perform image preprocessing on the above-mentioned food shooting image to generate a first preprocessed image; the first input unit 203 is configured to input the above-mentioned first preprocessed image into a pre-trained image coding model to generate a first image coding information; the second input unit 204 is configured to input the above-mentioned food semantic division information into a pre-trained semantic coding model to generate food semantic coding information; the splicing unit 205 is configured to splice the above-mentioned food semantic coding information and the above-mentioned first image coding information to generate splicing information; the third input unit 206 is configured to input the above-mentioned splicing information into a pre-trained decoding model for semantic segmentation to generate food semantic segmentation information; the generation unit 207 is configured to generate food value information corresponding to the above-mentioned food shooting image according to the above-mentioned food semantic segmentation information and the above-mentioned food semantic division information.
[0105] It is understandable that the units recorded in the food value generating device 200 and the reference Figure 1 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the food value generating device 200 and the units contained therein, and will not be repeated here.
[0106] Reference below Figure 3 , which shows a structural schematic diagram of an electronic device (eg, an electronic device) 300 suitable for implementing some embodiments of the present disclosure. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0107] like Figure 3 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 to a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0108] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 3 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0109] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.
[0110] It should be noted that the computer-readable medium in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0111] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0112] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains the currently acquired food photographed image and food semantic segmentation information; performs image preprocessing on the food photographed image to generate a first preprocessed image; inputs the first preprocessed image into a pre-trained image coding model to generate first image coding information; inputs the food semantic segmentation information into a pre-trained semantic coding model to generate food semantic coding information; splices the food semantic coding information and the first image coding information to generate splicing information; inputs the splicing information into a pre-trained decoding model for semantic segmentation to generate food semantic segmentation information; generates food value information corresponding to the food photographed image based on the food semantic segmentation information and the food semantic segmentation information.
[0113] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor including an acquisition unit, a preprocessing unit, a first input unit, a second input unit, a splicing unit, a third input unit, and a generation unit. Among them, the names of these units do not constitute a limitation on the units themselves in certain cases, for example, the acquisition unit may also be described as a "unit for acquiring the currently acquired food photographic image and food semantic segmentation information".
[0116] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that may be used include, without limitation, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0117] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.
Claims
1. A method for generating food value, comprising: Acquire the currently acquired food photographed image and food semantic segmentation information; Performing image preprocessing on the food captured image to generate a first preprocessed image; Inputting the first preprocessed image into a pre-trained image coding model to generate first image coding information; Inputting the food semantic segmentation information into a pre-trained semantic coding model to generate food semantic coding information; Splicing the food semantic coding information and the first image coding information to generate splicing information; Inputting the concatenated information into a pre-trained decoding model for semantic segmentation to generate food semantic segmentation information; Food value information corresponding to the food photographed image is generated according to the food semantic segmentation information and the food semantic division information.
2. The method according to claim 1, wherein: The food semantic division information includes at least one of the following: first semantic division information based on food plates, second semantic division information based on food types and not counting purposes, third semantic division information based on food types and determined by number, and fourth semantic division information based on food ingredients; as well as The step of inputting the food semantic segmentation information into a pre-trained semantic coding model to generate food semantic coding information includes: At least one of the first semantic division information, the second semantic division information, the third semantic division information and the fourth semantic division information is input into the semantic coding model to generate food semantic coding information.
3. The method according to claim 1, wherein: Each food plate in the food photographed image has a corresponding food classification label; as well as The food semantic segmentation information is generated by the following steps: Acquire each label description feature information corresponding to each food classification label from the target database, wherein the label description feature information includes: label shape feature information, label position feature information and label font feature information; Inputting the food image to an object detection model to generate at least one detection feature information for at least one initial detection object; For each of the at least one detection feature information, the following first generating step is performed: Inputting the detection feature information into a pre-trained label shape feature extraction model to generate initial label shape feature information; Inputting the detection feature information into a pre-trained label position feature extraction model to generate initial label position feature information; Inputting the detected feature information into a pre-trained label font feature extraction model to generate initial label font feature information; Performing feature comparison on the label shape feature information and the initial label shape feature information to generate first feature comparison information; Performing feature comparison on the tag position feature information and the initial tag position feature information to generate second feature comparison information; Performing feature comparison on the label font feature information and the initial label font feature information to generate third feature comparison information; Determining whether the initial detection object corresponding to the detection feature information is a target detection object according to the first feature comparison information, the second feature comparison information, and the third feature comparison information; Inputting the obtained at least one target detection feature information corresponding to the at least one target detection object into a pre-trained food classification label content generation model to generate at least one food classification label content; Deduplication processing is performed on the at least one food classification label content to generate at least one semantic classification information as the food semantic classification information.
4. The method according to claim 1, wherein: The method further comprises: Instructing a food acquisition object corresponding to the food photographed image to place the food corresponding to the food photographed image on a target placement platform; In response to determining that the corresponding food has been placed on the target placement platform, acquiring a sequence of historical food photographed images corresponding to the food photographed image, wherein the corresponding photographing time of the historical food photographed images is earlier than the corresponding photographing time of the food photographed image; Removing historical food photographed images whose corresponding food contents do not satisfy a preset content condition from the historical food photographed image sequence, to obtain a historical food photographed image sequence after removal; According to the removed historical food shooting image sequence and the food semantic segmentation information, performing semantic segmentation verification on the food semantic segmentation information to obtain verification information; In response to determining that the verification information representation is correct, the food content corresponding to the food image is displayed on the display platform corresponding to the target placement platform, and the food value information is displayed as a QR code on the display platform so that the food acquisition object can transfer the corresponding value.
5. The method according to claim 4, wherein: The step of performing semantic segmentation verification on the food semantic segmentation information according to the removed historical food shooting image sequence and the food semantic segmentation information to obtain verification information includes: For each historical food photographed image in the sequence of historical food photographed images after removal, the following second generation step is performed: Performing image preprocessing on the historical food photographed image to generate a second preprocessed image; Inputting the second preprocessed image into the image coding model to generate second image coding information; Inputting the food semantic encoding information and the second image encoding information into the decoding model to generate historical food semantic segmentation information; Determine a semantic segmentation image set corresponding to the historical food semantic segmentation information; Performing clustering processing on the semantic segmentation images in the obtained semantic segmentation image set sequence to obtain a semantic segmentation image clustering cluster set; Determine the similarity between the cluster center set corresponding to the semantic segmentation image cluster set and at least one divided sub-image; In response to determining that the similarity is greater than or equal to the target similarity value, verification information indicating that the verification is passed is generated.
6. The method according to claim 5, wherein: The method further comprises: In response to determining that the similarity is less than the target similarity value, generating verification information indicating that the verification has failed; re-shooting a food image of the corresponding food placed on the target placement platform as a real-time food image; The corresponding food value information is generated according to the real-time food image.
7. The method according to claim 2, wherein: The food semantic segmentation information includes: at least one segmented sub-image; and The step of generating food value information corresponding to the food photographed image according to the food semantic segmentation information and the food semantic division information includes: In response to determining that the food semantic division information is the first semantic division information, determining image size information corresponding to the at least one divided sub-image, and obtaining at least one image size information; Acquire a first value table representing the correspondence between image size information and value information for the first semantic segmentation information from a target database; Determine, according to the first value table, the value information corresponding to each image size information in the at least one image size information, and obtain at least one first value information; adding each of the at least one first value information to generate added information as food value information; In response to determining that the food semantic segmentation information is the second semantic segmentation information, each segmentation sub-image in the at least one segmentation sub-image is input into a pre-trained first food type information generation model to generate first food type information, thereby obtaining at least one first food type information, wherein the first food type information includes: food type; Acquire a second value table from the target database, determine the value information corresponding to each first food type information in the at least one first food type information according to the second value table, and obtain at least one second value information; adding each of the at least one second value information to generate added information as food value information; In response to determining that the food semantic segmentation information is the third semantic segmentation information, each segmentation sub-image in the at least one segmentation sub-image is input into a pre-trained second food type information generation model to generate second food type information, thereby obtaining at least one second food type information, wherein the second food type information includes: food type and food quantity; Determine the value information corresponding to each second food type information in the at least one second food type information according to the second value table, and obtain at least one third value information, wherein the third value information is the value information obtained by multiplying the value corresponding to the food type corresponding to the second food type information by the number of foods; adding each of the at least one third value information to generate added information as food value information; In response to determining that the food semantic segmentation information is the fourth semantic segmentation information, inputting each segmentation sub-image of the at least one segmentation sub-image into a pre-trained food composition information generation model to generate food composition information, thereby obtaining at least one food composition information; Acquire a pre-stored third value table representing the relationship between food component combinations and value information from the target database; According to the third value table, value information corresponding to the food component combination corresponding to the at least one food component information is determined as the food value information.
8. A food value generating device, comprising: an acquisition unit, configured to acquire a currently acquired food photographed image and food semantic segmentation information; a preprocessing unit configured to perform image preprocessing on the food photographed image to generate a first preprocessed image; a first input unit configured to input the first preprocessed image into a pre-trained image coding model to generate first image coding information; a second input unit configured to input the food semantic segmentation information into a pre-trained semantic coding model to generate food semantic coding information; a splicing unit, configured to splice the food semantic coding information and the first image coding information to generate splicing information; a third input unit, configured to input the concatenated information into a pre-trained decoding model for semantic segmentation to generate food semantic segmentation information; A generating unit is configured to generate food value information corresponding to the food photographed image according to the food semantic segmentation information and the food semantic division information.
9. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for generating multi-document summarization
CN108733682A
Semantic segmentation network training and image semantic segmentation method, device and equipment
CN113420827A
Image semantic segmentation method and system based on coding multipath semantic crossover network
CN113642581A
Interface generation method and device, electronic equipment and storage medium
CN113672315A
Multi-label image classification method and device and related equipment
CN113723513A
