Food material recognition method and apparatus, electronic device, and computer-readable storage medium

Through feature extraction and fusion of ingredients entering and exiting videos, ingredient information is directly obtained, which solves the problems of cumbersome and low robustness of multi-model identification in the existing technology, and improves the real-time speed and user experience of ingredient recognition.

WO2024221609A1PCT designated stage expired Publication Date: 2024-10-31HEFEI HUALING CO LTD +2
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/106801
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-27
Filing Date
2023-07-11
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

Existing food ingredient identification technology adopts a two-stage identification method. The use of multiple algorithm models results in cumbersome identification, high cost, and low robustness. The accuracy is affected by multiple models, resulting in poor real-time speed and user experience.

Method used

By obtaining the video of the process of food entering and exiting the refrigeration equipment, intercepting continuous pictures and performing feature extraction, using 3D and 2D convolutional network models to extract time and space information, and combining feature fusion and pre-trained models to directly obtain the category, location and entry and exit of food. information, reducing training difficulty and cost.

Benefits of technology

It achieves real-time speed increase and user experience improvement for food ingredient recognition, simplifies the recognition process, reduces training complexity and cost, and improves recognition accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023106801_31102024_PF_FP_ABST
    Figure CN2023106801_31102024_PF_FP_ABST
Patent Text Reader

Abstract

A food material recognition method and apparatus, an electronic device, and a computer-readable storage medium. The method comprises: from a process video about a food material entering / exiting a refrigeration device, capturing multiple consecutive pictures to be recognized; dividing the multiple pictures to be recognized into multiple groups of pictures to be recognized, and performing feature extraction on each group of pictures to be recognized, to obtain first feature information and second feature information corresponding to each group of pictures to be recognized, wherein the first feature information comprises food material time information and the second feature information comprises food material space information; according to the first feature information and the second feature information of each group of pictures to be recognized, obtaining food material information comprising food material category, position and entrance / exit information and corresponding to each group of pictures to be recognized; and determining a final recognition result of a food material according to the food material information corresponding to each group of pictures to be recognized.
Need to check novelty before this filing date? Find Prior Art

Description

Food identification method, device, electronic device and computer-readable storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This disclosure claims priority to Chinese patent application number 202310485066.3, filed on April 27, 2023, entitled “Food Identification Method, Device, Electronic Device and Computer-Readable Storage Medium,” the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present disclosure relates to the field of smart home technology, and in particular to a food identification method, device, electronic device, and computer-readable storage medium. Background Art

[0004] Currently, most methods for identifying food entering and exiting refrigerators use a two-stage recognition approach. This involves first detecting the food's category and location using algorithms like target detection, then tracking the food's movement using algorithms like target tracking to determine the food's entry and exit information. However, these methods utilize multiple algorithmic models, making them extremely cumbersome to use and affecting the real-time speed of food identification. Furthermore, training different algorithmic models is difficult and costly. Furthermore, the accuracy of food identification, influenced by multiple algorithmic models, can suffer from a "barrel effect," resulting in low robustness.

[0005] Public content

[0006] The present disclosure aims to solve, at least to some extent, one of the technical problems in the related art. To this end, the first purpose of the present disclosure is to propose a food identification method that can obtain the temporal and spatial information of an food simply through feature extraction, and based on the temporal and spatial information of the food, can simultaneously obtain the food category information, location information, and entry and exit information. This greatly reduces the training difficulty, training cost, and complexity of food identification, and improves the real-time speed of food identification, thereby improving the user experience.

[0007] A second objective of the present disclosure is to provide a food identification device.

[0008] A third objective of the present disclosure is to provide an electronic device.

[0009] A fourth object of the present disclosure is to provide a computer-readable storage medium.

[0010] To achieve the above-mentioned purpose, the first embodiment of the present disclosure proposes a method for identifying food, which includes: obtaining a process video of food entering and exiting a refrigeration device, and intercepting multiple continuous pictures to be identified from the process video; dividing the multiple continuous pictures to be identified into multiple groups of pictures to be identified, and performing feature extraction on each group of pictures to be identified respectively, to obtain first feature information and second feature information corresponding to each group of pictures to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; according to the first feature information and second feature information corresponding to each group of pictures to be identified, obtaining food information corresponding to each group of pictures to be identified, wherein the food information includes category information, location information and entry and exit information of the food; according to the food information corresponding to each group of pictures to be identified, determining the final identification result of the food.

[0011] According to the food identification method of the embodiment of the present disclosure, by obtaining a process video of food entering and exiting a refrigeration device, and intercepting multiple continuous pictures to be identified from the process video; dividing the multiple continuous pictures to be identified into multiple groups of pictures to be identified, and performing feature extraction on each group of pictures to be identified, obtaining first feature information and second feature information corresponding to each group of pictures to be identified, wherein the first feature information includes the time information of the food, and the second feature information includes the spatial information of the food; according to the first feature information and the second feature information corresponding to each group of pictures to be identified, obtaining food information corresponding to each group of pictures to be identified, wherein the food information includes the category information, location information and entry and exit information of the food; according to the food information corresponding to each group of pictures to be identified, determining the final identification result of the food. Thus, compared with the two-stage recognition method, it breaks through the limitation of multiple models, only needs to obtain the time information and spatial information of the food through feature extraction, and according to the time information and spatial information of the food, the category information, location information and entry and exit information of the food can be obtained at the same time, which greatly reduces the training difficulty, training cost and complexity of food recognition, and improves the real-time speed of food recognition, thereby improving the user experience.

[0012] According to one embodiment of the present disclosure, feature extraction is performed on each group of pictures to be identified respectively to obtain first feature information corresponding to each group of pictures to be identified, including: using a 3D convolutional network model, feature extraction is performed on each group of pictures to be identified respectively to obtain first feature information corresponding to each group of pictures to be identified.

[0013] According to one embodiment of the present disclosure, feature extraction is performed on each group of pictures to be identified respectively to obtain second feature information corresponding to each group of pictures to be identified, including: using a 2D convolutional network model, feature extraction is performed on the last picture to be identified in each group of pictures to be identified respectively to obtain the second feature information corresponding to each group of pictures to be identified.

[0014] According to one embodiment of the present disclosure, based on the first feature information and the second feature information corresponding to each group of pictures to be identified, the food information corresponding to each group of pictures to be identified is obtained, including: performing feature fusion on the first feature information and the second feature information corresponding to each group of pictures to be identified to obtain the fused feature information corresponding to each group of pictures to be identified; and obtaining the food information corresponding to each group of pictures to be identified based on the fused feature information corresponding to each group of pictures to be identified.

[0015] According to one embodiment of the present disclosure, based on the fusion feature information corresponding to each group of pictures to be identified, the food information corresponding to each group of pictures to be identified is obtained, including: inputting the fusion feature information corresponding to each group of pictures to be identified into a pre-trained food recognition model to obtain the food information corresponding to each group of pictures to be identified, and the food recognition model is obtained based on training samples that are labeled with category information, location information and entry and exit information of the food corresponding to multiple sample pictures.

[0016] According to one embodiment of the present disclosure, when training an ingredient recognition model, the method further includes: calculating a first loss value of the ingredient recognition model by presetting a cross-entropy loss function; adjusting a first parameter of the ingredient recognition model according to the first loss value, wherein the first parameter is used to adjust a first output of the ingredient recognition model, wherein the first output includes category information and input and output information of the ingredient.

[0017] According to one embodiment of the present disclosure, when training an ingredient recognition model, the method further includes: calculating a second loss value of the ingredient recognition model by presetting an intersection-over-union regression loss function; and adjusting a second parameter of the ingredient recognition model according to the second loss value, wherein the second parameter is used to adjust a second output of the ingredient recognition model, wherein the second output includes location information of the ingredient.

[0018] To achieve the above-mentioned purpose, the second embodiment of the present disclosure proposes a food identification device, which includes: a first acquisition module, used to obtain a process video of food entering and exiting a refrigeration device, and to intercept multiple continuous pictures to be identified from the process video; an extraction module, used to divide the multiple continuous pictures to be identified into multiple groups of pictures to be identified, and perform feature extraction on each group of pictures to be identified respectively, to obtain first feature information and second feature information corresponding to each group of pictures to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; a second acquisition module, used to obtain food information corresponding to each group of pictures to be identified based on the first feature information and second feature information corresponding to each group of pictures to be identified, wherein the food information includes category information, location information and entry and exit information of the food; a determination module, used to determine the final identification result of the food based on the food information corresponding to each group of pictures to be identified.

[0019] According to the food identification device of the embodiment of the present disclosure, a first acquisition module is used to obtain a process video of food entering and exiting a refrigeration device, and a plurality of continuous pictures to be identified are intercepted from the process video; an extraction module is used to divide the plurality of continuous pictures to be identified into a plurality of groups of pictures to be identified, and feature extraction is performed on each group of pictures to be identified respectively to obtain first feature information and second feature information corresponding to each group of pictures to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; a second acquisition module is used to obtain food information corresponding to each group of pictures to be identified based on the first feature information and the second feature information corresponding to each group of pictures to be identified, wherein the food information includes category information, location information and entry and exit information of the food; a determination module is used to determine the final identification result of the food based on the food information corresponding to each group of pictures to be identified. Therefore, compared with the two-stage recognition method, it breaks through the limitations of multiple models and can obtain the time information and spatial information of the ingredients only through feature extraction. Based on the time information and spatial information of the ingredients, the category information, location information and entry and exit information of the ingredients can be obtained at the same time, which greatly reduces the training difficulty, training cost and complexity of ingredient recognition, and improves the real-time speed of ingredient recognition, thereby improving the user experience.

[0020] According to one embodiment of the present disclosure, the extraction module is specifically used to perform feature extraction on each group of pictures to be identified through a 3D convolutional network model to obtain first feature information corresponding to each group of pictures to be identified.

[0021] According to one embodiment of the present disclosure, the extraction module is specifically used to extract features of the last picture to be identified in each group of pictures to be identified through a 2D convolutional network model to obtain second feature information corresponding to each group of pictures to be identified.

[0022] According to one embodiment of the present disclosure, the second acquisition module is specifically used to fuse the first feature information and the second feature information corresponding to each group of pictures to be identified to obtain the fused feature information corresponding to each group of pictures to be identified; and obtain the food information corresponding to each group of pictures to be identified based on the fused feature information corresponding to each group of pictures to be identified.

[0023] According to one embodiment of the present disclosure, the second acquisition module is specifically used to input the fusion feature information corresponding to each group of pictures to be identified into a pre-trained food recognition model to obtain the food information corresponding to each group of pictures to be identified. The food recognition model is obtained based on training samples that are labeled with category information, location information and entry and exit information of the food corresponding to multiple sample pictures.

[0024] According to one embodiment of the present disclosure, the food identification device also includes a training module, which is used to calculate a first loss value of the food identification model through a preset cross-entropy loss function; according to the first loss value, adjust the first parameter of the food identification model, wherein the first parameter is used to adjust the first output of the food identification model, wherein the first output includes category information and input and output information of the food.

[0025] According to one embodiment of the present disclosure, the training module is also used to calculate the second loss value of the food recognition model by using a preset intersection-over-union regression loss function; and adjust the second parameter of the food recognition model according to the second loss value, wherein the second parameter is used to adjust the second output of the food recognition model, wherein the second output includes the location information of the food.

[0026] To achieve the above-mentioned objectives, a third embodiment of the present disclosure proposes an electronic device, comprising: a memory for storing programs; and a processor for implementing the food identification method of the first embodiment by executing the programs stored in the memory.

[0027] In the above electronic device, a process video of food entering and exiting a refrigeration device is obtained, and multiple continuous images to be identified are intercepted from the process video; the multiple continuous images to be identified are divided into multiple groups of images to be identified, and feature extraction is performed on each group of images to be identified to obtain first feature information and second feature information corresponding to each group of images to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; based on the first feature information and the second feature information corresponding to each group of images to be identified, the food information corresponding to each group of images to be identified is obtained, wherein the food information includes category information, location information, and entry and exit information of the food; and based on the food information corresponding to each group of images to be identified, the final identification result of the food is determined. Therefore, compared with the two-stage recognition method, the limitation of multiple models is broken through, and the time information and spatial information of the food can be obtained only by feature extraction. Moreover, based on the time information and spatial information of the food, the category information, location information, and entry and exit information of the food can be obtained at the same time, which greatly reduces the training difficulty, training cost, and complexity of food recognition, and improves the real-time speed of food recognition, thereby improving the user experience.

[0028] To achieve the above-mentioned objectives, the fourth embodiment of the present disclosure proposes a computer-readable storage medium, on which a program is stored, and the program can be executed by a processor to implement the food identification method of the first embodiment.

[0029] In the above-mentioned computer-readable storage medium, a process video of food entering and exiting a refrigeration device is obtained, and multiple continuous images to be identified are intercepted from the process video; the multiple continuous images to be identified are divided into multiple groups of images to be identified, and feature extraction is performed on each group of images to be identified to obtain first feature information and second feature information corresponding to each group of images to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; based on the first feature information and the second feature information corresponding to each group of images to be identified, the food information corresponding to each group of images to be identified is obtained, wherein the food information includes category information, location information and entry and exit information of the food; based on the food information corresponding to each group of images to be identified, the final identification result of the food is determined. Therefore, compared with the two-stage recognition method, it breaks through the limitation of multiple models, and only needs to use feature extraction to obtain the time information and spatial information of the food, and based on the time information and spatial information of the food, the category information, location information and entry and exit information of the food can be obtained at the same time, which greatly reduces the training difficulty, training cost and complexity of food recognition, and improves the real-time speed of food recognition, thereby improving the user experience.

[0030] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] FIG1 is a flow chart of a first embodiment of a method for identifying food materials according to an embodiment of the present disclosure;

[0032] FIG2 is a flow chart of a second embodiment of a food identification method provided by an embodiment of the present disclosure;

[0033] FIG3 is a schematic structural diagram of a food identification device provided by an embodiment of the present disclosure;

[0034] FIG4 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0035] The following describes in detail embodiments of the present disclosure, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0036] The following describes the food identification method, device, electronic device, and computer-readable storage medium proposed in the embodiments of the present disclosure with reference to the accompanying drawings.

[0037] In the present disclosure, referring to FIG1 , FIG1 is a flow chart of a first embodiment of a method for identifying food materials provided by an embodiment of the present disclosure. The method for identifying food materials provided by this embodiment may include the following steps:

[0038] S101, obtaining a process video of food entering and exiting a refrigeration device, and capturing a plurality of continuous images to be identified from the process video.

[0039] Specifically, the food identification method provided in this embodiment can be applied to any device with processing capabilities, such as refrigeration equipment, servers, etc. The refrigeration equipment can be a freezer, refrigerator, fresh-keeping cabinet, etc. The embodiment of this disclosure can be explained using the refrigeration equipment as a refrigerator as an example.

[0040] Specifically, an image capture device installed inside the refrigeration unit can be used to capture video of a user inserting or removing food from the refrigeration unit. In practice, the image capture device can be installed near the frame of the top of the refrigeration unit, near the door, or in other locations where it can capture the process of food entering or exiting the refrigeration unit. This is not a limitation of the present disclosure.

[0041] Specifically, after the user turns on the refrigeration device, the image acquisition device installed inside the refrigeration device can shoot a video of the user putting food into and taking out food from the refrigeration device, and after the user turns off the refrigeration device, the image acquisition device installed inside the refrigeration device can be controlled to stop shooting.

[0042] Specifically, when the subject executing the above-mentioned food identification method is a refrigeration device, the image acquisition device installed inside the refrigeration device can send the acquired process video to the refrigeration device. When the subject executing the above-mentioned food identification method is a server, the image acquisition device installed inside the refrigeration device can send the acquired process video to the server; alternatively, the image acquisition device installed inside the refrigeration device can send the acquired process video to the refrigeration device, and the refrigeration device can then send the process video to the server.

[0043] Specifically, a plurality of continuous images to be identified can be intercepted from the process video according to a preset interception rule. For example, the preset interception rule can be to intercept each frame of the process video, or the preset interception rule can be to intercept a plurality of images to be identified from the process video every preset number of frames (such as intercepting 1 image to be identified from the process video every 10 frames), or the preset interception rule can be to intercept a plurality of images to be identified from the process video every preset time (such as intercepting 10 images to be identified from the process video every second), etc. The embodiment of the present disclosure does not impose any restrictions on this. In addition, since the user's actions will not produce significant changes in a short period of time, the plurality of images to be identified intercepted according to the above-mentioned preset interception rules can be regarded as continuous image frames.

[0044] S102, dividing multiple continuous pictures to be identified into multiple groups of pictures to be identified, and performing feature extraction on each group of pictures to be identified respectively to obtain first feature information and second feature information corresponding to each group of pictures to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food.

[0045] Specifically, a plurality of consecutive images to be identified may be divided into a plurality of groups of images to be identified according to a preset division rule, wherein the number of images in each group may be the same or different. For example, when the number of images in each group is the same, the preset division rule may be to determine the first to sixteenth images arranged in chronological order as the first group of images to be identified, the second to seventeenth images as the second group of images to be identified, and so on; or the preset division rule may be to determine the first to fifteenth images arranged in chronological order as the first group of images to be identified, the fifth to nineteenth images as the second group of images to be identified, and so on; or the preset division rule may be to determine the first to tenth images arranged in chronological order as the first group of images to be identified, the eleventh to twentieth images as the second group of images to be identified, and so on. Alternatively, when the number of pictures to be identified in each group is different, the preset division rule may be to determine the first to tenth pictures arranged in chronological order as the first group of pictures to be identified, the second to seventeenth pictures as the second group of pictures to be identified, the third to twenty-first pictures as the third group of pictures to be identified, etc.; or, the preset division rule may be to determine the first to tenth pictures arranged in chronological order as the first group of pictures to be identified, the eleventh to seventeenth pictures as the second group of pictures to be identified, the eighteenth to twenty-ninth pictures as the third group of pictures to be identified, etc.

[0046] Specifically, feature extraction is performed on each group of pictures to be identified to obtain first feature information corresponding to each group of pictures to be identified, including food time information. The first feature information can represent the attributes of the food in the time interval corresponding to each group of pictures to be identified during the process of the food entering and leaving the refrigeration equipment.

[0047] Specifically, feature extraction is performed on each group of pictures to be identified to obtain second feature information corresponding to each group of pictures to be identified, including food spatial information. The second feature information can characterize the properties of the food in the spatial area corresponding to each group of pictures to be identified during the process of the food entering and exiting the refrigeration equipment.

[0048] S103, obtaining food information corresponding to each group of pictures to be identified based on the first feature information and the second feature information corresponding to each group of pictures to be identified, wherein the food information includes category information, location information, and entry and exit information of the food.

[0049] Specifically, based on the first feature information corresponding to each set of images to be identified, including temporal information about the ingredients, the temporal correlation between the user's food access behaviors at different moments corresponding to the images to be identified in each set can be derived. Furthermore, based on the second feature information corresponding to each set of images to be identified, including spatial information about the ingredients, the spatial correlation between the user's food access behaviors at different locations corresponding to the images to be identified in each set can be derived. Based on the temporal and spatial correlations between the user's food access behaviors, the category information, location information, and entry and exit information of the ingredients within each set of images to be identified can be derived.

[0050] S104: Determine the final recognition result of the food according to the food information corresponding to each group of pictures to be recognized.

[0051] Specifically, based on preset rules, the final ingredient recognition result can be determined according to the ingredient information corresponding to each set of images to be recognized. For example, if there are 100 sets of images to be recognized, and the ingredient information corresponding to 80 sets of images to be recognized is "user takes apples out of the refrigerator," then the final ingredient recognition result can be determined to be "apples taken out of the refrigerator by the user."

[0052] The food identification method provided by the embodiment of the present disclosure obtains a process video of food entering and exiting a refrigeration device, and intercepts multiple continuous images to be identified from the process video; divides the multiple continuous images to be identified into multiple groups of images to be identified, and performs feature extraction on each group of images to be identified, obtaining first feature information and second feature information corresponding to each group of images to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; obtains food information corresponding to each group of images to be identified based on the first feature information and the second feature information, wherein the food information includes category information, location information and entry and exit information of the food; and determines the final identification result of the food based on the food information corresponding to each group of images to be identified. Thus, compared with the two-stage recognition method, it breaks through the limitation of multiple models, and only needs to obtain the time information and spatial information of the food through feature extraction, and according to the time information and spatial information of the food, the category information, location information and entry and exit information of the food can be obtained at the same time, which greatly reduces the training difficulty, training cost and complexity of food identification, and improves the real-time speed of food identification, thereby improving the user experience.

[0053] In some embodiments, the above-mentioned feature extraction of each group of pictures to be identified separately to obtain the first feature information corresponding to each group of pictures to be identified may include: using a 3D convolutional network model to extract features of each group of pictures to be identified separately to obtain the first feature information corresponding to each group of pictures to be identified.

[0054] Specifically, through the 3D convolutional network model, features can be extracted from the time dimension for each picture to be identified in each group of pictures to be identified, and the first feature information corresponding to each group of pictures to be identified can be obtained based on the time feature information of each picture to be identified in each group of pictures to be identified. In specific implementation, 3D convolution is achieved by stacking multiple consecutive frames (multiple pictures to be identified in each group of pictures to be identified) to form a cube, and then applying a 3D convolution kernel in the cube. Through this structure, the feature maps in the convolution layer are connected to multiple adjacent frames in the previous layer, thereby capturing motion information.

[0055] Specifically, since the 3D convolutional network model is only used to extract features from the time dimension for each group of images to be identified, the 3D convolutional network model can use a lightweight Shufflenet network or Mobilenet network and its derivative versions.

[0056] In the disclosed embodiment, a 3D convolutional network model is used to extract features from each set of images to be identified, obtaining first feature information corresponding to each set of images to be identified. This lightweight 3D convolutional network model can extract features from the temporal dimension of each set of images to be identified, reducing training difficulty, training costs, and the complexity of food identification.

[0057] In some embodiments, the above-mentioned feature extraction of each group of pictures to be identified separately to obtain the second feature information corresponding to each group of pictures to be identified may include: using a 2D convolutional network model, feature extraction of the last picture to be identified in each group of pictures to be identified separately to obtain the second feature information corresponding to each group of pictures to be identified.

[0058] Specifically, since the last picture to be identified in each group of pictures to be identified contains the final spatial information of the food in the time interval, it is only necessary to perform feature extraction on the last picture to be identified in each group of pictures to be identified from the spatial dimension to obtain the second feature information corresponding to each group of pictures to be identified, which includes the final spatial information of the food in the time interval (reducing the amount of calculation). In specific implementation, the last picture to be identified in each group can be determined as the key frame picture corresponding to each group of pictures to be identified, that is, feature extraction is performed on the key frame pictures corresponding to each group of pictures to be identified to obtain the second feature information corresponding to each group of pictures to be identified.

[0059] Specifically, since the 2D convolutional network model is only used to extract features from the spatial dimension in the last picture to be identified in each group of pictures to be identified, the 2D convolutional network model can use a lightweight Shufflenet network or Mobilenet network and its derivative versions.

[0060] In the disclosed embodiment, a 2D convolutional network model is used to extract features from the last image in each group of images to be identified, obtaining second feature information corresponding to each group of images. This lightweight 2D convolutional network model can extract features from the spatial dimension of the last image in each group of images to be identified, reducing training difficulty, training cost, and complexity of food identification.

[0061] In some embodiments, the above-mentioned obtaining the food information corresponding to each group of pictures to be identified based on the first feature information and the second feature information corresponding to each group of pictures to be identified may include: performing feature fusion on the first feature information and the second feature information corresponding to each group of pictures to be identified to obtain the fused feature information corresponding to each group of pictures to be identified; and obtaining the food information corresponding to each group of pictures to be identified based on the fused feature information corresponding to each group of pictures to be identified.

[0062] Specifically, the first feature information including the time information of the ingredients and the second feature information including the spatial information of the ingredients can be feature fused, so that the time information of the ingredients and the spatial information of the ingredients can be preliminarily fused, realizing the unification of the time information and the spatial information, making it easier to obtain the ingredient information through the unified fused feature information.

[0063] In the disclosed embodiment, the first and second feature information corresponding to each set of images to be identified are fused to obtain fused feature information corresponding to each set of images to be identified. Based on the fused feature information corresponding to each set of images to be identified, the food information corresponding to each set of images to be identified is obtained. This unifies temporal and spatial information, facilitating faster acquisition of food information using the unified fused feature information, thereby improving the real-time speed of food identification and enhancing the user experience.

[0064] In some embodiments, the above-mentioned obtaining the food information corresponding to each group of pictures to be identified based on the fusion feature information corresponding to each group of pictures to be identified may include: inputting the fusion feature information corresponding to each group of pictures to be identified into a pre-trained food recognition model to obtain the food information corresponding to each group of pictures to be identified, and the food recognition model is obtained based on training samples that are labeled with category information, location information and entry and exit information of the food corresponding to multiple sample pictures.

[0065] Specifically, the pre-trained food recognition model may be a model such as FPN (Feature Pyramid Networks) or dilated convolution.

[0066] In the embodiment of the present disclosure, by inputting the fusion feature information corresponding to each group of pictures to be identified into a pre-trained food recognition model, the food information corresponding to each group of pictures to be identified is obtained, and relatively accurate food information can be quickly obtained, thereby improving the real-time speed of food recognition and improving the user experience.

[0067] In some embodiments, when training an ingredient recognition model, the above-mentioned ingredient recognition method may further include: calculating a first loss value of the ingredient recognition model by presetting a cross-entropy loss function; adjusting a first parameter of the ingredient recognition model according to the first loss value, wherein the first parameter is used to adjust a first output of the ingredient recognition model, wherein the first output includes category information and input and output information of the ingredient.

[0068] Specifically, a preset cross-entropy loss function can be used to measure the difference between the predicted data (category results, entry and exit results) and the baseline data. The preset cross-entropy loss function can be used to calculate the first loss value of the ingredient recognition model. The first parameter of the ingredient recognition model is updated based on the first loss value to reduce the loss, and the cycle repeats. Ultimately, after many rounds of training, the loss is small enough, and the accuracy of the ingredient classification results and entry and exit results is high enough.

[0069] In an embodiment of the present disclosure, a first loss value of the food identification model is calculated by a preset cross-entropy loss function; and a first parameter of the food identification model is adjusted based on the first loss value, wherein the first parameter is used to adjust a first output of the food identification model, wherein the first output includes the category information and the entry and exit information of the food. Thus, the first parameter of the food identification model can be updated using the preset cross-entropy loss function, thereby improving the accuracy of the food category results and the entry and exit results.

[0070] In some embodiments, when training the food recognition model, the above-mentioned food recognition method can also: calculate the second loss value of the food recognition model by presetting the intersection-over-union regression loss function; adjust the second parameter of the food recognition model according to the second loss value, wherein the second parameter is used to adjust the second output of the food recognition model, wherein the second output includes the location information of the food.

[0071] Specifically, a preset intersection-over-union (IoU) regression loss function can be used to measure the difference between the predicted data (ingredient location information) and the baseline data. The IoU regression loss function can be used to calculate a second loss value for the ingredient recognition model. Based on this second loss value, the second parameter of the ingredient recognition model is updated to reduce the loss, and the cycle repeats. Ultimately, after many rounds of training, the loss is sufficiently small, and the accuracy of the ingredient location information is sufficiently high.

[0072] In the disclosed embodiment, a second loss value of the food identification model is calculated using a preset intersection-over-union (IoU) regression loss function. Based on the second loss value, a second parameter of the food identification model is adjusted, where the second parameter is used to adjust a second output of the food identification model, where the second output includes the location information of the food. Thus, the second parameter of the food identification model can be updated using the preset IoU regression loss function, thereby improving the accuracy of the food location information.

[0073] As a specific example, FIG2 is a flow chart of a second embodiment of a food identification method provided by an embodiment of the present disclosure. As shown in FIG2 , the food identification method provided by this embodiment may include the following steps:

[0074] S201, obtaining a process video of food entering and exiting a refrigerator, and capturing a plurality of continuous frames from the process video.

[0075] S202: Divide the plurality of continuous frames into a plurality of groups of continuous frames.

[0076] For example, each group of consecutive frames may include 16 consecutive frames.

[0077] S203: Perform feature extraction on each group of consecutive frames through a 3D convolutional network to obtain a first feature map corresponding to each group of consecutive frames.

[0078] Among them, the first feature map includes time information of the food.

[0079] In step S204, the last frame in each group of continuous frames is used as the key frame corresponding to each group of continuous frames, and features of the key frames of each group are extracted based on downsampling at different magnifications through a 2D convolutional network to obtain multiple second feature maps corresponding to each group of continuous frames.

[0080] Specifically, the second feature map includes spatial information of the food, and the second feature maps obtained by downsampling at different magnifications have different resolutions.

[0081] Specifically, both 2D convolutional networks and 3D convolutional networks can use lightweight Shufflenet or Mobilenet networks and their derivative versions.

[0082] S205 , after upsampling the first feature map at different magnifications, splicing it with each second feature map extracted by the 2D convolutional network to obtain a plurality of spliced ​​feature maps.

[0083] Specifically, through the above-mentioned splicing method, time information and spatial information can be preliminarily integrated.

[0084] S206: Input each spliced ​​feature map into a feature pyramid network to obtain food information corresponding to each group of continuous frames.

[0085] Specifically, in order to strengthen the information interaction between each spliced ​​feature map, each spliced ​​feature map can be input into the feature pyramid network to strengthen the fusion between features.

[0086] Specifically, the food information corresponding to each set of consecutive frames output by the feature pyramid network can be (C+6)*N-dimensional prediction data. Here, N can represent the number of grids the original image is divided into, that is, N bounding boxes are obtained in the original image. The C+6-dimensional vector can represent three types of prediction information: the food classification information can be C+1-dimensional, where C is the number of all categories; the food location information can be 4-dimensional, which can be the center point (horizontal and vertical coordinates), width, and height of the bounding box; and the food entry and exit information is 1-dimensional, for example, 1 can represent food entering the refrigerator, and 0 can represent food being taken out of the refrigerator.

[0087] Specifically, the output of the feature pyramid network can be adjusted using a preset loss function. In specific implementations, the classification information and entry and exit information of the ingredients can be adjusted using a preset cross entropy loss function, and the location information of the ingredients can be adjusted using a preset intersection-over-union regression loss function.

[0088] S207: Determine a final recognition result of the food according to the food information corresponding to each group of continuous frames.

[0089] Specifically, through the above embodiment, only one forward network pass is required to obtain the category information, location information, and entry and exit information of all objects in any group of consecutive frames in the video stream. Compared with the two-stage recognition method of target detection and target tracking, the difficulty of identifying food ingredients through the camera deployed locally in the refrigerator is greatly reduced. Therefore, a lightweight backbone network can be used to extract features, compress model parameters as much as possible, and deploy the lightweight model to the camera deployed locally in the refrigerator. That is, the execution body of the above embodiment can be the camera deployed locally in the refrigerator. By identifying food ingredients through the camera deployed locally in the refrigerator, it is possible to detect the entry and exit of food ingredients in real time, and no redundant servers will be used for streaming detection, thereby reducing costs.

[0090] Specifically, in order to improve the recognition accuracy, the execution subject of the above embodiment can also be a server. The server uses a 3D convolutional network to extract the temporal features of continuous frames, uses a 2D convolutional network to extract the spatial features of continuous frames, and performs a preliminary fusion of the temporal features and spatial features to achieve the unification of temporal information and spatial information. Finally, the feature pyramid network is used to predict the category of the action and the location information of the subject performing the action and the category of the subject. Among them, the 2D convolutional network and the 3D convolutional network as well as the feature fusion method can be dynamically adjusted to strike a balance between the real-time and accuracy of food identification.

[0091] In the disclosed embodiment, compared with the two-stage recognition method, the limitation of multiple models is broken through. The time information and spatial information of the ingredients can be obtained only through feature extraction. Based on the time information and spatial information of the ingredients, the category information, location information and entry and exit information of the ingredients can be obtained at the same time, which greatly reduces the training difficulty, training cost and complexity of ingredient recognition, and improves the real-time speed of ingredient recognition, thereby improving the user experience.

[0092] FIG3 is a schematic diagram of the structure of a food identification device provided by an embodiment of the present disclosure. As shown in FIG3 , the food identification device 30 may include: a first acquisition module 310 , an extraction module 320 , a second acquisition module 330 and a determination module 340 .

[0093] Among them, the above-mentioned first acquisition module 310 can be used to obtain a process video of food entering and exiting the refrigeration equipment, and to intercept multiple continuous pictures to be identified from the process video; the above-mentioned extraction module 320 can be used to divide multiple continuous pictures to be identified into multiple groups of pictures to be identified, and perform feature extraction on each group of pictures to be identified respectively, to obtain the first feature information and second feature information corresponding to each group of pictures to be identified, wherein the first feature information includes the time information of the food, and the second feature information includes the spatial information of the food; the above-mentioned second acquisition module 330 can be used to obtain the food information corresponding to each group of pictures to be identified based on the first feature information and second feature information corresponding to each group of pictures to be identified, wherein the food information includes the category information, location information and entry and exit information of the food; the above-mentioned determination module 340 can be used to determine the final identification result of the food based on the food information corresponding to each group of pictures to be identified.

[0094] The food identification device provided by the embodiment of the present disclosure obtains a process video of food entering and exiting a refrigeration device through a first acquisition module, and intercepts multiple continuous pictures to be identified from the process video; divides the multiple continuous pictures to be identified into multiple groups of pictures to be identified through an extraction module, and performs feature extraction on each group of pictures to be identified respectively, to obtain first feature information and second feature information corresponding to each group of pictures to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; obtains food information corresponding to each group of pictures to be identified through a second acquisition module based on the first feature information and second feature information corresponding to each group of pictures to be identified, wherein the food information includes category information, location information and entry and exit information of the food; determines the final identification result of the food based on the food information corresponding to each group of pictures to be identified through a determination module. Therefore, compared with the two-stage recognition method, it breaks through the limitations of multiple models and can obtain the time information and spatial information of the ingredients only through feature extraction. Based on the time information and spatial information of the ingredients, the category information, location information and entry and exit information of the ingredients can be obtained at the same time, which greatly reduces the training difficulty, training cost and complexity of ingredient recognition, and improves the real-time speed of ingredient recognition, thereby improving the user experience.

[0095] According to an embodiment of the present disclosure, the extraction module 320 may be specifically configured to perform feature extraction on each group of images to be identified using a 3D convolutional network model to obtain first feature information corresponding to each group of images to be identified.

[0096] According to an embodiment of the present disclosure, the extraction module 320 may be specifically configured to perform feature extraction on the last image to be identified in each group of images to be identified through a 2D convolutional network model to obtain second feature information corresponding to each group of images to be identified.

[0097] According to one embodiment of the present disclosure, the above-mentioned second acquisition module 330 can be specifically used to: perform feature fusion on the first feature information and the second feature information corresponding to each group of pictures to be identified to obtain the fused feature information corresponding to each group of pictures to be identified; and obtain the food information corresponding to each group of pictures to be identified based on the fused feature information corresponding to each group of pictures to be identified.

[0098] According to one embodiment of the present disclosure, the above-mentioned second acquisition module 330 can be specifically used to: input the fusion feature information corresponding to each group of pictures to be identified into a pre-trained food recognition model to obtain the food information corresponding to each group of pictures to be identified. The food recognition model is obtained based on training samples that are labeled with category information, location information and entry and exit information of the food corresponding to multiple sample pictures.

[0099] According to one embodiment of the present disclosure, the above-mentioned food identification device 30 may further include a training module (not shown in the figure), which can be used to: calculate the first loss value of the food identification model by presetting the cross entropy loss function; adjust the first parameter of the food identification model according to the first loss value, wherein the first parameter is used to adjust the first output of the food identification model, wherein the first output includes the category information and input and output information of the food.

[0100] According to one embodiment of the present disclosure, the above-mentioned training module can also be used to: calculate the second loss value of the food recognition model by presetting the intersection-over-union regression loss function; adjust the second parameter of the food recognition model according to the second loss value, wherein the second parameter is used to adjust the second output of the food recognition model, wherein the second output includes the location information of the food.

[0101] In addition, corresponding to the food identification method provided in the above embodiment, the embodiment of the present disclosure also provides an electronic device, as shown in Figure 4, the electronic device 40 may include: a memory 410, a processor 420 and a program stored on the memory 410 and capable of running on the processor 420. When the processor 420 executes the program, all steps of the food identification method provided in the embodiment of the present disclosure are implemented.

[0102] In the above electronic device, a process video of food entering and exiting a refrigeration device is obtained, and multiple continuous images to be identified are intercepted from the process video; the multiple continuous images to be identified are divided into multiple groups of images to be identified, and feature extraction is performed on each group of images to be identified to obtain first feature information and second feature information corresponding to each group of images to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; based on the first feature information and the second feature information corresponding to each group of images to be identified, the food information corresponding to each group of images to be identified is obtained, wherein the food information includes category information, location information and entry and exit information of the food; based on the food information corresponding to each group of images to be identified, the final identification result of the food is determined. Therefore, compared with the two-stage recognition method, the limitation of multiple models is broken through, and the time information and spatial information of the food can be obtained only by feature extraction, and the category information, location information and entry and exit information of the food can be obtained at the same time based on the time information and spatial information of the food, which greatly reduces the training difficulty, training cost and complexity of food recognition, and improves the real-time speed of food recognition, thereby improving the user experience.

[0103] In addition, corresponding to the food identification method provided in the above embodiment, the embodiment of the present disclosure also provides a computer-readable storage medium on which a program is stored. When the program is executed by the processor, all steps of the food identification method of the embodiment of the present disclosure are implemented.

[0104] In the above-mentioned computer-readable storage medium, by obtaining a process video of food entering and exiting a refrigeration device, and intercepting multiple continuous images to be identified from the process video; dividing the multiple continuous images to be identified into multiple groups of images to be identified, and performing feature extraction on each group of images to be identified, obtaining first feature information and second feature information corresponding to each group of images to be identified, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; according to the first feature information and the second feature information corresponding to each group of images to be identified, obtaining food information corresponding to each group of images to be identified, wherein the food information includes category information, location information and entry and exit information of the food; according to the food information corresponding to each group of images to be identified, determining the final identification result of the food. Thus, compared with the two-stage recognition method, it breaks through the limitation of multiple models, only needs to use feature extraction to obtain the time information and spatial information of the food, and according to the time information and spatial information of the food, the category information, location information and entry and exit information of the food can be obtained at the same time, which greatly reduces the training difficulty, training cost and complexity of food recognition, and improves the real-time speed of food recognition, thereby improving the user experience.

[0105] It should be noted that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wires (electronic device), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.

[0106] It should be understood that various parts of the present disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0107] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0108] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0109] In this disclosure, unless otherwise expressly specified or limited, terms such as "installed," "connected," "connect," and "fixed" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integration; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal communication between two components or interaction between two components, unless otherwise expressly limited. Those skilled in the art will understand the specific meanings of the above terms in this disclosure based on specific circumstances.

[0110] Although the embodiments of the present disclosure have been shown and described above, it is understood that the above embodiments are illustrative and are not to be construed as limitations on the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.

Claims

1. A method for identifying food materials, wherein: The method comprises: Obtain a process video of food entering and exiting a refrigeration device, and capture multiple continuous images to be identified from the process video; Divide a plurality of continuous to-be-recognized pictures into a plurality of groups of to-be-recognized pictures, and perform feature extraction on each group of to-be-recognized pictures respectively, to obtain first feature information and second feature information corresponding to each group of to-be-recognized pictures, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; According to the first characteristic information and the second characteristic information corresponding to each group of pictures to be identified, the food information corresponding to each group of pictures to be identified is obtained, wherein the food information includes category information, location information and entry and exit information of the food; According to the food information corresponding to each group of pictures to be identified, the final identification result of the food is determined.

2. The method according to claim 1, wherein: Feature extraction is performed on each group of pictures to be identified to obtain first feature information corresponding to each group of pictures to be identified, including: Through the 3D convolutional network model, feature extraction is performed on each group of pictures to be identified to obtain the first feature information corresponding to each group of pictures to be identified.

3. The method according to claim 1, wherein: Feature extraction is performed on each group of pictures to be identified to obtain second feature information corresponding to each group of pictures to be identified, including: Through the 2D convolutional network model, feature extraction is performed on the last picture to be identified in each group of pictures to be identified, so as to obtain the second feature information corresponding to each group of pictures to be identified.

4. The method according to any one of claims 1 to 3, wherein: The method of obtaining the food information corresponding to each group of pictures to be identified according to the first feature information and the second feature information corresponding to each group of pictures to be identified includes: Performing feature fusion on the first feature information and the second feature information corresponding to each group of pictures to be identified, to obtain fused feature information corresponding to each group of pictures to be identified; According to the fusion feature information corresponding to each group of pictures to be identified, the food information corresponding to each group of pictures to be identified is obtained.

5. The method according to claim 4, wherein: The step of obtaining food information corresponding to each group of pictures to be identified based on the fusion feature information corresponding to each group of pictures to be identified includes: The fused feature information corresponding to each group of pictures to be identified is input into a pre-trained food identification model to obtain the food information corresponding to each group of pictures to be identified. The food identification model is obtained based on training samples that are annotated with category information, location information and entry and exit information of the food corresponding to multiple sample pictures.

6. The method according to claim 5, wherein: When training the food identification model, the method further includes: Calculating a first loss value of the food recognition model by using a preset cross entropy loss function; According to the first loss value, a first parameter of the food identification model is adjusted, wherein the first parameter is used to adjust a first output of the food identification model, wherein the first output includes category information and entry and exit information of the food.

7. The method according to claim 5, wherein: When training the food identification model, the method further includes: Calculating a second loss value of the food recognition model by using a preset intersection-over-union regression loss function; According to the second loss value, a second parameter of the food identification model is adjusted, wherein the second parameter is used to adjust a second output of the food identification model, wherein the second output includes location information of the food.

8. A food identification device, wherein: The device comprises: A first acquisition module is used to acquire a process video of food entering and exiting the refrigeration equipment, and to capture a plurality of continuous images to be identified from the process video; an extraction module, used to divide a plurality of continuous to-be-recognized pictures into a plurality of groups of to-be-recognized pictures, and perform feature extraction on each group of to-be-recognized pictures respectively, to obtain first feature information and second feature information corresponding to each group of to-be-recognized pictures, wherein the first feature information includes time information of the food, and the second feature information includes spatial information of the food; A second acquisition module is used to obtain food information corresponding to each group of pictures to be identified according to the first feature information and the second feature information corresponding to each group of pictures to be identified, wherein the food information includes category information, location information and entry and exit information of the food; The determination module is used to determine the final recognition result of the food according to the food information corresponding to each group of pictures to be recognized.

9. An electronic device, wherein: include: A memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, wherein: A program is stored thereon, and 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

  • Intelligent ingredient image identification method and system, household electrical appliance

    CN106897661A

  • Food material determination method and device, electronic equipment, refrigerator and storage medium

    CN113239780A

  • Food material information detection method and device, storage medium and electronic device

    CN113591576A

  • Real-time refrigerator food material identification method based on multi-target tracking

    CN114037937A

  • Food material information determination method and device, storage medium and electronic device

    CN114758338A