Method and apparatus for determining freshness, device, and computer program product

Decoupling food category and freshness detection in a two-stage process improves model efficiency and accuracy by reducing output categories and leveraging context information for enhanced freshness determination.

WO2026082459A1PCT designated stage Publication Date: 2026-04-23BSH HAUSGERATE GMBH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
BSH HAUSGERATE GMBH
Filing Date
2025-10-02
Publication Date
2026-04-23

AI Technical Summary

Technical Problem

Existing food freshness detection technologies often require complex models with numerous output categories due to coupling food category detection with freshness detection, leading to increased model complexity and poor accuracy.

Method used

Decoupling food category detection from freshness detection, using a two-stage approach where food category is first determined, then used as context information for feature extraction and freshness determination, reducing model output categories and improving accuracy.

Benefits of technology

This approach optimizes model training and enhances freshness detection accuracy by reducing model complexity and improving feature extraction and classification precision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2025078445_23042026_PF_FP_ABST
    Figure EP2025078445_23042026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a method and an apparatus for determining freshness, a device, and a computer program product. The method includes obtaining input data associated with a target food. The method further includes determining a food category based on the input data. In addition, the method further includes determining freshness through a freshness detection model based on the food category and the input data. A feature extraction module in the freshness detection model extracts a food feature based on the food category and the input data. A freshness determining module in the freshness detection model is configured to determine the freshness based on the food category and the food feature. Therefore, according to the embodiments of the present disclosure, the food category is first determined, and then the food category is used as an input feature to extract the food feature and determine the food freshness. In this way, a quantity of output categories of the freshness detection model can be greatly reduced, thereby improving a training effect of the model and improving accuracy of freshness detection.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] METHOD AND APPARATUS FOR DETERMINING FRESHNESS, DEVICE, AND COMPUTER PROGRAM PRODUCT

[0002] TECHNICAL FIELD

[0003] Embodiments of the present disclosure relate to the field of computers, and more specifically, to a method and an apparatus for detecting freshness of food, a device, and a computer program product.

[0004] BACKGROUND

[0005] Food freshness detection is widely applied to the modern food industry and daily life. As people pay increasing attention to food safety and quality, an accurate food freshness detection technology becomes especially important. These technologies not only can effectively prevent food from spoiling and prolong a shelf life of the food, but also can play a key role in supply chain management, to ensure that freshness of the food can be maintained in each link from production to consumption.

[0006] The food freshness detection is very important in protecting consumer health and food safety. Food spoilage can be found and prevented in time by using a scientifically effective detection means, thereby avoiding health problems that may be caused after consumption. In addition, the food freshness detection plays a key role in food production and supply chain management, to ensure that an optimal state of food can be maintained in each link of production, transportation, and sale.

[0007] SUMMARY

[0008] Embodiments of the present disclosure provide a method and an apparatus for determining freshness, a device, a computer program product, and a medium.

[0009] According to a first aspect of the present disclosure, a method for determining freshness is provided. The method includes obtaining input data associated with a target food. The method further includes determining a food category of the target food based on the input data. In addition, the method further includes: determining freshness of the target food based on the food category and the input data through a freshness detection model, where the freshness detection model includes a feature extraction module and a freshness determining module, the feature extraction module is configured to extract a food feature of the target food based on the food category and the input data, and the freshness determining module is configured to determine the freshness based on the food category and the food feature.

[0010] According to a second aspect of the present disclosure, an apparatus for determining freshness is provided. The apparatus includes a data obtaining unit, configured to obtain input data associated with a target food. The apparatus further includes a category determining unit, configured to determine a food category of the target food based on the input data. In addition, the apparatus further includes a freshness determining unit, configured to determine freshness of the target food based on the food category and the input data through a freshness detection model, where the freshness detection model includes a feature extraction module and a freshness determining module, the feature extraction module is configured to extract a food feature of the target food based on the food category and the input data, and the freshness determining module is configured to determine the freshness based on the food category and the food feature.

[0011] According to a third aspect of the present disclosure, an electronic device / controller is provided. The electronic device includes: at least one processor; and a memory, coupled to the at least one processor and having instructions stored therein, where the instructions, when executed by the at least one processor, cause the device to perform the steps of the method according to the first aspect of the present disclosure.

[0012] According to a fourth aspect of the present disclosure, a computer program product is provided. The computer program product is tangibly stored in a non-transitory computer-readable medium and includes computer-executable instructions. The computer-executable instructions, when executed, cause a computer to perform the steps of the method according to the first aspect of the present disclosure.

[0013] According to a fifth aspect of the present disclosure, a machine-readable storage medium is provided. Machine-executable instructions are stored in the machine-readable storage medium, where the machine-executable instructions are executed by a processor to implement the steps of the method according to the first aspect of the present disclosure.

[0014] The summary part is to introduce selected concepts in a simplified form. The concepts are further described in the following detailed description part. The summary part is neither intended to identify a key feature or main feature of a claimed subject matter, nor intended to limit the scope of the claimed subject matter.

[0015] BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The foregoing and other objectives, features, and advantages of the present disclosure will become more apparent from more detailed descriptions of exemplary embodiments of the present disclosure with reference to the accompanying drawings. In the exemplary embodiments of the present disclosure, the same reference numerals generally represent the same components.

[0017] FIG. 1 is a schematic diagram of an exemplary environment in which a device and / or method can be implemented according to an embodiment of the present disclosure;

[0018] FIG. 2 is a flowchart of a method for determining freshness of food according to an embodiment of the present disclosure;

[0019] FIG. 3 A is a flowchart of a process of training a freshness detection model according to an embodiment of the present disclosure;

[0020] FIG. 3B is an exemplary structural diagram of an autoencoder model according to an embodiment of the present disclosure;

[0021] FIG. 3C is an exemplary structural diagram of a freshness detection model according to an embodiment of the present disclosure;

[0022] FIG. 4 is a flowchart of a process for determining freshness of food according to an embodiment of the present disclosure;

[0023] FIG. 5 is a schematic diagram of an apparatus for determining freshness according to an embodiment of the present disclosure; and

[0024] FIG. 6 is a schematic block diagram of an exemplary device that is suitable for implementing an embodiment of the present disclosure.

[0025] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0026] DETAILED DESCRIPTION

[0027] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure may be implemented in various forms and should not be construed as being limited to the embodiments described herein, but these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the accompanying drawings and embodiments of the present disclosure are merely used as examples, but are not intended to limit the protection scope of the present disclosure.

[0028] In descriptions of the embodiments of the present disclosure, the term "include" and similar terms should be understood as open inclusion, that is, "include but are not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", and the like may represent different objects or the same object, unless explicitly stated. Other explicit and implicit definitions may also be included below.

[0029] As described above, the food freshness detection technology plays a very important role in a plurality of aspects. Food freshness detection needs to involve detection of different categories of foods, for example, different types of fruits. However, different categories of foods behave differently in a process of reduction of the freshness. For example, some types of fruits are prone to be discolored, and some types of fruits are prone to be mildewed. Therefore, the food category is a very important condition for determining food freshness. However, because there are a large number of types of foods, and freshness detection conditions for different types of foods are also different, a process of detecting the food freshness is very complex.

[0030] In the related art, a corresponding freshness detection model is usually customized for a specific food category. This causes a large quantity of development tasks and incomplete coverage of the food categories. In addition, in some solutions, various freshness levels of each food are processed into a multi-class model with different categories. For example, if there are one hundred categories of foods, and there are three freshness categories of each food (for example, fresh, secondarily fresh, or spoiled), the multi-class model needs to generate three hundred output categories to determine a freshness degree of the food. The foregoing solution may cause excessive output categories of the freshness detection model, increase complexity of model training, and cause a poor model training effect. In conclusion, in the related art, food category detection and food freshness detection are usually coupled. Such a coupling causes many output categories of the models, and causes a poor food freshness detection effect.

[0031] Therefore, an embodiment of the present disclosure provides a food freshness detection solution. In this solution, detection of a food category and detection of food freshness are decoupled, to implement two-stage detection. First, in the solution, the food category is determined according to input data related to a to-be-detected food, to complete first-stage food category detection. Then, the food category is input to a freshness detection model as context information together with the input data, and a feature extraction model in the freshness detection model extracts a key feature of the food therefrom. As described above, because different food categories behave differently in a freshness change process, the food category, as the context information, plays an important role at a feature extraction stage. Finally, the food category and the food feature are input to a freshness determining module in the freshness detection model, to determine freshness of the to-be-detected food, and complete second-stage freshness detection. It can be seen that the context information, that is, the food category, not only plays a role at the feature extraction stage, but also plays a role at a freshness determining stage.

[0032] Therefore, according to the food freshness detection solution provided in this embodiment of the present disclosure, a food category can be first determined through a two-stage detection solution, and then the food category is used as an input feature to extract a food feature and generate food freshness. In this way, it can be avoided that various freshness levels of each food are processed into different categories, thereby greatly reducing a quantity of output categories of the freshness detection model, optimizing a training effect of the freshness detection model, and further improving detection accuracy of the freshness detection model. In addition, the food category plays an important role in both food feature extraction and food freshness determining, and can also help improve the detection accuracy of the freshness detection model.

[0033] The following describes the basic principles and several exemplary implementations of the present disclosure with reference to FIG. 1 to FIG. 6. It should be understood that these exemplary embodiments are provided only to enable a person skilled in the art to better understand and further implement the embodiments of the present disclosure, and are not intended to limit the scope of the present disclosure in any manner.

[0034] FIG. 1 shows an exemplary environment 100 in which a device and / or method in an embodiment of the present disclosure can be implemented. As shown in FIG. 1, the exemplary environment 100 may include a computing device 110, which may be a user terminal, a mobile device, a computer, or the like, or may be a computing system, a single server, a distributed server, or a cloud-based server. The computing device 110 may obtain input data 120 corresponding to a target food (for example, a food that needs to be detected). In some embodiments, the input data 120 may be image data and / or smell data of the food.

[0035] The computing device 110 may determine a food category 130 of the target food according to the input data 120. In some embodiments, the computing device 110 may determine the food category of the target food by using a food classification model. It should be understood that the food category may alternatively be determined in another manner. This is not limited in the present disclosure. The computing device 110 may include a freshness detection model 140, and the freshness detection model 140 may include a feature extraction module 150 and a freshness determining module 170. The feature extraction module 150 in the freshness detection model 140 may generate a food feature 160 based on the input data 120 and the food category 130. For example, the input data 120 may be high-dimensional vector data related to the image data and / or the smell data. The food feature 160 may be low-dimensional vector data obtained through dimension reduction. The food feature 160 not only retains core information of the input data 120, but also significantly reduces a data dimension, thereby improving efficiency and accuracy of subsequent processing.

[0036] The freshness determining module 170 in the freshness detection model 140 may determine freshness 180 of the target food based on the food feature 160 and the food category 130. For example, the freshness determining module 170 may be a classifier module, and the freshness 180 may be freshness levels of different categories, such as a fresh category, a secondarily fresh category, or a spoiled category. Different freshness categories may be understood as different freshness levels. It should be understood that this is merely an example herein, and division of the freshness levels is not limited in this embodiment of the present disclosure.

[0037] Therefore, according to the food freshness detection solution provided in this embodiment of the present disclosure, the food category is first determined, and then the food category is used as an input feature to extract the food feature and determine the food freshness. In this way, a quantity of output categories of the freshness detection model can be greatly reduced, thereby improving a training effect of the model and improving accuracy of freshness detection.

[0038] It should be understood that an architecture and a function of the exemplary environment 100 are described for illustrative purposes only, and do not imply any limitation on the scope of the present disclosure. The embodiments of the present disclosure may further be applied to another environment having a different structure and / or function.

[0039] A process according to an embodiment of the present disclosure is described in detail below with reference to FIG. 2 to FIG. 6. For ease of understanding, specific data mentioned in the following descriptions is exemplary, and is not intended to limit the protection scope of the present disclosure. It may be understood that the embodiments described below may further include additional actions that are not shown and / or may omit actions that are shown, and the scope of the present disclosure is not limited in this aspect.

[0040] FIG. 2 is a flowchart of a method 200 for determining freshness according to an embodiment of the present disclosure. At block 202, input data associated with a target food may be obtained.

[0041] For example, with reference to FIG. 1, the computing device 110 may obtain the input data 120 associated with the target food. At block 204, a food category of the target food may be determined based on the input data. For example, with reference to FIG. 1, the computing device 110 may determine the food category 130 of the target food based on the input data 120.

[0042] At block 206, freshness of the target food may be determined based on the food category and the input data through a freshness detection model, where the freshness detection model includes a feature extraction module and a freshness determining module, the feature extraction module is configured to extract a food feature of the target food based on the food category and the input data, and the freshness determining module is configured to determine the freshness based on the food category and the food feature. For example, with reference to FIG. 1, the computing device 110 may determine the freshness 180 of the target food based on the food category 130 and the input data 120 through the freshness detection model 140. The freshness detection model 140 includes the feature extraction module 150 and the freshness determining module 170. The feature extraction module 150 is configured to extract the food feature 160 of the target food based on the food category 130 and the input data 120. The freshness determining module 170 is configured to determine the freshness 180 based on the food category 130 and the food feature 160.

[0043] Therefore, according to the method 200 of this embodiment of the present disclosure, the food category can be first determined, and then the food category is used as an input feature to extract the food feature and generate the food freshness. In this way, it can be avoided that various freshness levels of each food are processed into different categories, thereby greatly reducing a quantity of output categories of the freshness detection model, optimizing a training effect of the freshness detection model, and further improving detection accuracy of the freshness detection model.

[0044] FIG. 3A is a flowchart of a process 300A of training a freshness detection model according to an embodiment of the present disclosure. At block 302, training data related to a food may be used to train an auto-encoding model configured for the food. An autoencoder is a neural network model, is mainly configured for an unsupervised learning task, and may compress input data into a low-dimensional latent representation (encoding), and then reconstruct the input data from the representation (decoding). The autoencoder usually includes an encoder and a decoder. FIG. 3B shows a structure of an autoencoder model configured for a food. The following describes the autoencoder model with reference to FIG. 3B.

[0045] FIG. 3B is an exemplary structural diagram of an autoencoder model 300B according to an embodiment of the present disclosure. FIG. 3B shows an overall architecture of the autoencoder model 300B and a mutual relationship between functional modules of the autoencoder model. The autoencoder model 300B may mainly include an encoder module 324, a sampling module 326, and a decoder module 330. A combination of the encoder module 324 and the sampling module 326 may be referred to as a feature extraction module. For example, the encoder module 324 may receive a combination of input data 322 and a condition variable 320 (that is, a food category) for encoding, to generate a parameter of a feature distribution (for example, a multivariate Gaussian distribution), including an average value p and a logarithmic variance logo2. The condition variable is additional information that affects an output of the autoencoder model, and is used for introducing prior knowledge or context information when the model generates a latent representation. In some embodiments, the condition variable may be food category information, for example, different fruit types (such as an apple and a banana).

[0046] The sampling module 326 performs a sampling operation by using the parameter of the feature distribution, to generate a latent vector 328 (that is, z in FIG. 3B) as a food feature extracted by the feature extraction module, for a next decoding process. Subsequently, the decoder module 330 combines the latent vector 328 and the condition variable 320, to reconstruct output data 332 corresponding to the input data 322. This process not only retains an important feature of the input data 322, but also performs adjustment according to additional information provided by the condition variable 320. In this way, the reconstructed output data 332 can better conform to characteristics of the input data 322.

[0047] Therefore, the autoencoder model according to this embodiment of the present disclosure can efficiently learn and capture a latent distribution of the input data, and flexibly combine the condition variable in the reconstruction process, thereby implementing precise data generation. In addition, the autoencoder model can implement unsupervised training. This means that training data does not need to be manually labeled. This not only significantly reduces a cost of data labeling, but also reduces manual intervention in a training process, and improves training efficiency and scalability.

[0048] Refer to FIG. 3A again, the training data related to a food at block 302 may be image data. In some embodiments, high-resolution image data may be collected through a color (RGB) camera or a hyperspectral camera. The image data can capture features such as a color, a shape, and a surface texture of the food, and provide rich visual information for a model to learn and extract important features related to freshness. Diversity of the image data may help the model to better identify and classify foods of different categories. In some embodiments, the training data may be smell data. For example, smell spectrum data of the food may be collected through an electronic nose. The data can reflect changes in a chemical composition and a volatile organic compound of the food, thereby providing key information about freshness of the food. Training is performed by using the smell data, so that the model can capture an internal state of the food and a potential spoilage signal that cannot be provided by the visual data, thereby further improving accuracy of freshness detection.

[0049] In some embodiments, the training data may be multi-modality data obtained by combining the image data and the smell data. In this case, the multi-modality data combines the visual information and chemical information, so that the model can analyze and evaluate the freshness of the food from a plurality of perspectives. By using both the image data and the smell data, the model can understand the state of the food more comprehensively, thereby avoiding a detection blind spot possibly caused by a single data category. Such integration of the multi-modality data not only can enhance robustness of the model, but also can provide more precise and reliable freshness detection.

[0050] At block 304, the decoder module in the autoencoder model may be replaced with a classifier module, to obtain the food freshness detection model. As described above, by training the autoencoder model, the feature extraction module (a combination of the encoder module and the sampling module) has a capability of extracting the food feature from the input data. Specifically, the autoencoder model converts the input data and the food category into feature representations in a latent space through the feature extraction module. The feature representations capture core information of the input data, and can reflect related features such as a color, a texture, and a smell of the food. As a generative model, the autoencoder may generate a food image or a smell feature similar to the input data (that is, an output of the decoder), however, the autoencoder cannot directly determine a freshness category of the food. This is because an objective of the autoencoder model is mainly to reconstruct the input data, rather than perform a classification task.

[0051] Therefore, in a scenario of the food freshness detection, to determine the food freshness, in this embodiment of the present disclosure, the original decoder module is replaced with the classifier module. The classifier module may determine the freshness of the food based on the food feature generated by the feature extraction module. In this way, the freshness detection model not only retains a feature extraction capability of the autoencoder, but also can use the extracted feature for classification determining of freshness levels. FIG. 3C shows an exemplary structure of a freshness detection model. The freshness detection model is described below with reference to FIG. 3C.

[0052] FIG. 3C is an exemplary structural diagram of a freshness detection model 300C according to an embodiment of the present disclosure. As shown in FIG. 3C, the freshness detection model 300C may include an encoder module 344, a sampling module 346, and a classifier module 350. A combination of the encoder module 344 and the sampling module 346 may be referred to as a feature extraction module. Specifically, the encoder module 344 receives a combination of input data 342 and a condition variable 340 (that is, a food category), and compresses the combination into a feature representation in a latent space.

[0053] The sampling module 346 may generate a food feature 348 (that is, z in FIG. 3C) through a sampling operation based on a distribution parameter (such as an average value p and a logarithmic variance logo2) of a feature distribution generated by the encoder 344. The food feature 348 may represent a core feature of a target food, and play a key role at a subsequent freshness determining stage. Then, the classifier module 350 may receive the food feature 348 generated by the sampling module 346, and classify freshness of the food with reference to the condition variable 340. The classifier module 350 may map the condition variable 340 and the food feature 350 to a specific freshness category through training, thereby implementing detection of food freshness. Finally, the classifier module 350 may output an output result 352 representing the food freshness category.

[0054] Refer to FIG. 3A again. At block 306, the freshness detection model may be trained based on the training data. As described above, the feature extraction module in the freshness detection model has been trained through an unsupervised learning process of an autoencoder model, and the classifier module in the freshness detection model further needs to be trained. For example, supervised training may be performed on the freshness detection model based on labeled training data. For example, the training data may be image data and / or smell data related to the food and a corresponding freshness category. The labeled categories may be fresh, secondarily fresh, or spoiled, which respectively indicate different freshness levels. It should be understood that, fresh, secondarily fresh, or spoiled are merely examples of the freshness categories, and a specific form and a quantity of the freshness categories are not limited in this embodiment of the present disclosure.

[0055] FIG. 4 is a flowchart of a process 400 for determining freshness of food according to an embodiment of the present disclosure. At block 402, input data related to a to-be-detected food may be obtained. As described above, the input data may be image data and / or smell data. In addition, the input data may further include time series image data and / or time series smell data. For example, a picture of the food may be collected and stored at a predetermined time interval. The time series data can provide richer information because the data can capture changes of the food with the passage of time, so that a freshness detection model can analyze these change trends to determine a freshness decay process.

[0056] At block 404, the input data may be analyzed to determine a category of the to-be-detected food. For example, an appearance feature of the food may be recognized by analyzing the image data through a food classification model, to classify the food as a specific food category. In addition, if the input data is the smell data, the food classification model may identify the category of the food based on component analysis in a smell spectrum. In some embodiments, accuracy of food classification may be further improved with reference to a multi-modality analysis of the image data and the smell data.

[0057] At block 406, freshness of the food may be determined based on the food category and the input data. For example, as shown in FIG. 3C, the food category 340 and the input data 342 may be input into the freshness detection model, to determine the freshness category 352 of the food. An encoder in the freshness detection model may determine a parameter of a feature distribution for the food according to the food category and the input data. In some embodiments, a multivariate Gaussian distribution may be used, and the parameter output by the encoder may be an average value vector and a variance vector of the multivariate Gaussian distribution. In addition, a sampler in the freshness detection model may perform sampling to obtain a food feature vector of the to-be-detected food based on the parameter of the feature distribution. Then, a classifier in the freshness detection model may determine the freshness of the food based on the food category and the food feature vector.

[0058] At block 408, prompt information may be sent to a user based on the freshness of the food. In some embodiments, a category of the freshness may be fresh, secondarily fresh, or spoiled. For example, when it is detected that the food is secondarily fresh or spoiled, a notification may be sent to the user for processing. In some embodiments, if the output freshness indicates that the target food is of the secondarily fresh category, the prompt information (also referred to as first prompt information) may be sent to the user, to prompt the user that the food has a preset quantity of days from a best before date, and the preset quantity of days is configurable. In some embodiments, if the output freshness indicates that the target food is of the spoiled category, warning information (also referred to as second prompt information) may be sent to the user, to warn the user that the food is already past the best before date. In this way, when receiving the first prompt information, the user may learn about a situation in which the food is about to approach the best before date in time, to consume the food or take another processing measure, for example, freezing the food for storage or cooking the food, to avoid a waste caused by an expired food. In addition, when receiving the second prompt information, the user may process the food that has been spoiled, to prevent a health risk or another negative consequence brought by accidental consumption.

[0059] FIG. 5 is a schematic diagram of an apparatus 500 for determining freshness according to an embodiment of the present disclosure. The apparatus 500 includes an input data obtaining unit 502, configured to obtain input data associated with a target food. The apparatus 500 further includes a food category determining unit 504, configured to determine a food category of the target food based on the input data. In addition, the apparatus 500 further includes a freshness determining unit 506, configured to determine freshness of the target food through a freshness detection model based on the food category and the input data, where the freshness detection model includes a feature extraction module and a freshness determining module, the feature extraction module is configured to extract a food feature of the target food based on the food category and the input data, and the freshness determining module is configured to determine the freshness based on the food category and the food feature.

[0060] In some embodiments, the feature extraction module includes an encoder module and a sampling module. In addition, the freshness determining unit 506 includes: a feature distribution generation unit, configured to generate, based on the food category and the input data, feature distribution of the target food through the encoder; a food feature generation unit, configured to generate the food feature based on the feature distribution of the target food through the sampling module; and a second freshness determining unit, configured to determine the freshness through the freshness determining module based on the food category and the food feature.

[0061] In some embodiments, the feature distribution of the target food includes a multivariate Gaussian distribution. In addition, the feature distribution generation unit includes: a distribution parameter generation unit, configured to generate a parameter of the multivariate Gaussian distribution through the encoder based on the food category and the input data; and a second feature distribution determining unit, configured to determine the food feature distribution based on the parameter of the multivariate Gaussian distribution.

[0062] In some embodiments, the input data includes at least one of image data and smell data of the target food. In addition, the food category determining unit 504 includes: a second food category determining unit, configured to determine the food category of the target food based on the at least one of the image data and the smell data.

[0063] In some embodiments, the image data includes time series image data. In addition, the apparatus 500 further includes: a food image collection unit, configured to collect the time series image data of the target food at a predetermined time interval through at least one of a color camera and a hyperspectral camera.

[0064] In some embodiments, the smell data includes time series smell data. In addition, the apparatus 500 further includes: a smell data collection unit, configured to collect the time series smell data of the target food item at a predetermined time interval through an electronic nose.

[0065] In some embodiments, the apparatus 500 further includes: a training data obtaining unit, configured to obtain food training data, where the food training data includes the image data of the food and the smell data of the food; and an autoencoder training unit, configured to train, through unsupervised learning, an autoencoder model configured for the food based on the food training data, where the autoencoder model includes the feature extraction module and a decoder module, and the food category is input to the feature extraction module and the decoder module as a condition variable for the autoencoder model. In some embodiments, the apparatus 500 further includes: an extraction module obtaining unit, configured to obtain a trained feature extraction module in a trained autoencoder model; a detection model generation unit, configured to generate the freshness detection model based on the trained feature extraction module and the freshness determining module; and a determining module training unit, configured to train the freshness determining module in the freshness detection model based on the food training data and food category data related to the food training data.

[0066] In some embodiments, the freshness determining module is a classifier module, and the freshness includes a fresh category, a secondarily fresh category, and a spoiled category.

[0067] In some embodiments, the apparatus 500 further includes: a first prompt information sending unit, configured to send first prompt information in response to that the freshness indicates that the target food is of the secondarily fresh category, where the first prompt information indicates that the target food has a preset quantity of days from a best before date, and the preset quantity of days is configurable; and a second prompt information sending unit, configured to send second prompt information in response to that the freshness indicates that the target food is of the spoiled category, where the second prompt information indicates that the target food is already past the best before date.

[0068] FIG. 6 is a schematic block diagram of an exemplary device 600 that is suitable for implementing an embodiment of the present disclosure. As shown in the figure, the device 600 includes a processor 601, which can perform various appropriate actions and processing according to computer program instructions stored in a read-only memory (ROM) 602 that are loaded into a random access memory (RAM) 603. The RAM 603 may further store various programs and data required for operating the device 600.

[0069] The processor 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0070] The methods and processes described above may be performed by the processor 601. For example, in some embodiments, the methods and processes described above may be implemented as a computer software program that is tangibly included in a machine-readable medium. In some embodiments, a part or all of the computer program may be loaded and / or installed on the device 600 through the ROM 602. When the computer program is loaded on the RAM 603 and executed by the processor 601, one or more actions of the methods and processes described above may be performed.

[0071] The present disclosure may be a method, an apparatus, a system, and / or a computer program product. The computer program product may include a computer-readable storage medium, having computer-readable program instructions used for performing various aspects of the present disclosure stored therein.

[0072] The computer-readable storage medium may be a tangible device that may hold and store instructions used by an instruction execution device. The computer-readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any appropriate combination of the above. A more specific example (a non-exhaustive list) of the computer-readable storage medium includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or a flash memory), a static random access memory (SRAM), and any appropriate combination of the above. The computer-readable storage medium used herein is not explained as a transient signal, such as a radio wave or other electromagnetic waves propagated freely, an electromagnetic wave propagated through a waveguide or other transmission media (for example, a light pulse propagated through an optical fiber cable), or an electrical signal transmitted over a wire.

[0073] The computer-readable program instructions described herein may be downloaded to various computing / processing devices from a computer-readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network, and / or a wireless network. The network may include a copper transmission cable, optical fiber transmission, wireless transmission, a router, a firewall, a switch, a gateway computer, and / or an edge server. A network adapter card or network interface in each computing / processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium within the various computing / processing devices.

[0074] The computer program instructions for performing operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages. The programming languages include object-oriented programming languages such as Smalltalk and C++, and conventional procedural programming languages such as a "C" language or a similar programming language. The computer-readable program instructions may be executed entirely on a computer of a user, partly on the computer of the user, as a stand-alone software package, partly on the computer of the user and partly on a remote computer, or entirely on the remote computer or a server. For the case involving a remote computer, the remote computer may be connected to a computer of a user through any type of network including a local area network (LAN) or wide area network (WAN), or may be connected to an external computer (for example, through the Internet by using an Internet service provider). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), is customized by using state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, to implement various aspects of the present disclosure.

[0075] All of the aspects of the present disclosure are described herein with reference to the flowcharts and / or the block diagrams of the method, the apparatus (system), and the computer program product in the embodiments of the present disclosure. It should be understood that each block in the flowcharts and / or the block diagrams and a combination of the blocks in the flowcharts and / or the block diagrams may be implemented through the computer-readable program instructions.

[0076] The computer-readable program instructions may be provided to a processing unit of a general-purpose computer, a special-purpose computer, or another programmable data processing apparatus, to produce a machine. In this way, when the instructions are executed by the processing unit of the computer or the another programmable data processing apparatus, an apparatus that implements the functions / actions specified in one or more blocks in the flowcharts and / or the block diagrams is generated. These computer-readable program instructions may alternatively be stored in a computer-readable storage medium. These instructions cause a computer, a programmable data processing apparatus, and / or another device to work in a particular manner. In this way, a computer-readable medium storing instructions includes an artifact that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks of the flowcharts and / or the block diagrams.

[0077] The computer-readable program instructions may alternatively be loaded onto a computer, another programmable data processing apparatus, or another device, to cause a series of operational steps to be performed on the computer, another programmable data apparatus, or another device to produce a computer implemented process, such that the instructions that are executed on the computer, another programmable data processing apparatus, or another device implement the functions / actions specified in one or more blocks of the flowcharts and / or the block diagrams.

[0078] The flowcharts and the block diagrams in the accompanying drawings show a system architecture, functions, and operations that may be implemented by using the system, the method, and the computer program product according to a plurality of embodiments of the present disclosure. In this regard, each block in a flowchart or a block diagram may represent a module, a program segment, or a part of instructions. The module, the program segment, or the part of instructions include one or more executable instructions used for implementing specified logic functions. In some alternative implementations, functions labeled in the blocks may alternatively be performed in an order different from that labeled in the drawings. For example, two consecutive blocks may be actually executed substantially in parallel, or may sometimes be executed in a reverse order. This depends on the functions involved. It should be further noted that, each block in the block diagrams and / or the flowcharts, and a combination of blocks in the block diagrams and / or the flowcharts may be implemented by using a dedicated hardware-based system that performs a specified function or action, or may be implemented by using a combination of dedicated hardware and computer instructions.

[0079] The embodiments of the present disclosure have been described above. The above descriptions are exemplary, not exhaustive and are not limited to the disclosed embodiments. Many modifications and changes are clear to a person of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of the terms used herein is intended to be the best explanation of the principles, practical applications of the various embodiments, or technical improvements of the technology in the market, or to enable another person of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

CLAIMSWhat is claimed is:

1. A method (200) for determining freshness, comprising: obtaining (202) input data associated with a target food; determining (204) a food category of the target food based on the input data; and determining (206) freshness of the target food based on the food category and the input data through a freshness detection model, wherein the freshness detection model comprises a feature extraction module and a freshness determining module, the feature extraction module is configured to extract a food feature of the target food based on the food category and the input data, and the freshness determining module is configured to determine the freshness based on the food category and the food feature.

2. The method (200) according to claim 1, characterized in that the feature extraction module comprises an encoder module and a sampling module, and the determining freshness of the target food comprises: generating a feature distribution of the target food based on the food category and the input data through the encoder; generating the food feature based on the feature distribution of the target food through the sampling module; and determining the freshness based on the food category and the food feature through the freshness determining module.

3. The method (200) according to claim 2, characterized in that the feature distribution of the target food comprises a multivariate Gaussian distribution, and the generating a feature distribution of the target food through the encoder comprises: generating a parameter of the multivariate Gaussian distribution through the encoder based on the food category and the input data; and determining the food feature distribution based on the parameter of the multivariate Gaussian distribution.

4. The method (200) according to any of claims 1 to 3, characterized in that the input data comprises at least one of image data and smell data of the target food, and the determining a food category of the target food comprises:determining the food category of the target food based on the at least one of the image data and the smell data.

5. The method (200) according to claim 4, characterized in that the image data comprises time series image data, and the method further comprises: collecting the time series image data of the target food at a preset time interval through at least one of a color camera and a hyperspectral camera.

6. The method (200) according to any of claims 4 to 5, characterized in that the smell data comprises time series smell data, and the method further comprises: collecting the time series smell data of the target food at a preset time interval through an electronic nose.

7. The method (200) according to any of claims 1 to 6, further comprising: obtaining food training data, wherein the food training data comprises image data of the food and smell data of the food; and training an autoencoder model configured for the food through unsupervised learning based on the food training data, wherein the autoencoder model comprises the feature extraction module and a decoder module, and the food category is input to the feature extraction module and the decoder module as a condition variable for the autoencoder model.

8. The method (200) according to claim 7, further comprising: obtaining a trained feature extraction module in a trained autoencoder model; generating the freshness detection model based on the trained feature extraction module and the freshness determining module; and training the freshness determining module in the freshness detection model based on the food training data and food category data related to the food training data.

9. The method (200) according to any of claims 1 to 8, characterized in that the freshness determining module is a classifier module, and the freshness comprises a fresh category, a secondarily fresh category, and a spoiled category.

10. The method (200) according to claim 9, further comprising: sending first prompt information in response to that the freshness indicates that the target food is of the secondarily fresh category, wherein the first prompt information indicates that the target food has a preset quantity of days from a best before date, and thepreset quantity of days is configurable; and sending second prompt information in response to that the freshness indicates that the target food is of the spoiled category, wherein the second prompt information indicates that the target food is already past the best before date.

11. An apparatus for determining freshness, comprising: an input data obtaining unit, configured to obtain input data associated with a target food; a food category determining unit, configured to determine a food category of the target food based on the input data; and a freshness determining unit, configured to determine freshness of the target food based on the food category and the input data through a freshness detection model, wherein the freshness detection model comprises a feature extraction module and a freshness determining module, the feature extraction module is configured to extract a food feature of the target food based on the food category and the input data, and the freshness determining module is configured to determine the freshness based on the food category and the food feature.

12. An electronic device, comprising: at least one processor; and a memory, coupled to the at least one processor and having instructions stored therein, wherein the instructions, when executed by the at least one processor, cause the device to perform the method according to any one of claims 1 to 10.

13. A computer program product, tangibly stored in a non-transitory computer-readable medium and comprising machine-executable instructions, wherein the machine-executable instructions are used for performing the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method for detecting freshness of fresh food

    CN117589951A

  • Method for determining a freshness state of a food in a storage container as well as computer program product and storage container

    US20220196623A1