Disclosure of Invention
The invention aims to provide a food freshness identification method based on an electronic nose system, which can reduce the design complexity of the electronic nose system, shorten the construction time of the electronic nose system and detect the freshness of food materials in a refrigerator in real time.
Particularly, the invention provides a food freshness identification method based on an electronic nose system, which is used for detecting food freshness in a refrigerator and comprises the following steps:
collecting resistance data in real time by using an array gas sensor, wherein the resistance data is responsive to gas emitted by food in the refrigerator;
performing exponential smoothing filtering processing on the acquired resistance data to filter out periodic responses brought to the array gas sensor by internal and external circulation of the refrigerator;
preprocessing the filtered resistance data, and calculating the change delta R of the resistance of the array gas sensor within a period delta T;
judging whether target gas exists or not according to the resistance change delta R of the array gas sensor within a period delta T; if not, re-collecting resistance data responding to the gas in the refrigerator; if so, forming a characteristic vector by the response of the array gas sensor to the target gas;
and identifying the target gas according to the characteristic vector so as to identify the freshness of the food material to which the target gas belongs.
Further, the method comprises the following steps:
collecting resistance data responding to different freshness of food by using the array gas sensor to serve as a standard sample;
processing the acquired resistance data, and determining a threshold value theta of the target gas detected;
extracting the sample characteristics of the array gas sensor to the target gas according to the processed resistance data;
and forming a training set of samples by using the extracted sample characteristics, and building a classification model for identifying the freshness of the food.
Further, the method for preprocessing the filtered resistance data is a moving average method or a normalization method.
Further, the step of determining whether there is a target gas according to the change Δ R of the resistance of the array gas sensor over a period of time Δ T includes:
judging whether the change delta R of the resistance of the array gas sensor in a period delta T is larger than the threshold theta, if not, judging that the target gas is not detected, and re-collecting the gas resistance data in the refrigerator;
if yes, judging that the target gas is detected, and extracting the response of the array gas sensor to the detected target gas to form a feature vector.
Further, the target gas is identified by a classifier to identify the freshness of the food.
Further, the classifier employs one of a proximity algorithm or a decision tree algorithm.
Further, the freshness of the food is classified into fresh, stale and putrefactive.
The invention also provides an electronic nose system, comprising an array gas sensor, a processor and a memory, wherein the array gas sensor is used for collecting resistance data responding to gas emitted by food in the refrigerator; stored in the memory is a computer program for implementing, when being executed by the processor, the method for identifying food freshness based on an electronic nose system according to any one of claims 1-7.
Further, the array gas sensor includes a plurality of individual sensors, wherein at least one of the sensors is responsive to at least one gas within the refrigerator.
According to the food freshness identification method based on the electronic nose system, the influence of the internal and external circulation of the refrigerator on the periodic response of the array gas sensor is reduced by performing the exponential filtering processing on the collected resistance data which is in response to the gas emitted by the food in the refrigerator, the response characteristic of the array gas sensor on the gas emitted by the food in the refrigerator is only reserved, the additional design of hardware of the electronic nose system is not needed, the design complexity and the manufacturing cost of the electronic nose system are reduced, the building time of the electronic nose system is shortened, and the freshness of the food in the refrigerator can be detected in real time.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Detailed Description
The method for recognizing food freshness based on the electronic nose system can be used for detecting food freshness in a refrigerator, and a person skilled in the art can understand that the method is also applicable to the electronic nose system for detecting the alarm of rotten food materials in the refrigerator or the recognition of odor or gas in an environment with periodic response to an array gas sensor.
Referring to fig. 1, the method for identifying food freshness based on an electronic nose system of the present invention mainly comprises the following steps:
s1, collecting resistance data responding to gas emitted by food in the refrigerator in real time by using the array gas sensor;
s2, performing exponential smoothing filtering processing on the collected resistance data to filter out periodic responses brought to the array gas sensor by internal and external circulation of the refrigerator;
s3, preprocessing the filtered resistance data, and calculating the resistance change delta R of the array gas sensor within a period delta T;
s4, judging whether target gas exists or not according to the resistance change delta R of the array gas sensor within a period of time delta T; if not, re-collecting resistance data responding to the gas in the refrigerator; if so, forming a characteristic vector by the response of the array gas sensor to the target gas;
and S5, identifying the target gas according to the characteristic vector so as to identify the freshness of the food material to which the target gas belongs.
Specifically, as shown in fig. 1, in the method for recognizing freshness of food based on the electronic nose system of the present invention, first, resistance data responsive to gas emitted from food in a refrigerator can be collected in real time using an array gas sensor. The electronic nose system comprises an array gas sensor, wherein the array gas sensor consists of N independent sensors, and at least one sensor can respond to at least one gas in the refrigerator. The resistance data which is responded to the gas (smell) emitted by the food in the refrigerator can be collected in real time through the array gas sensor. During detection, the sensors which respond to all freshness degrees of food in the array sensors can be judged according to resistance data collected by the array gas sensors. It will be understood by those skilled in the art that the response of the array gas sensor to the gas may be marked by different resistance values and will not be described in detail in this application.
And then, carrying out exponential smoothing filtering processing on the acquired resistance data by using an exponential smoothing technology to filter out periodic responses brought to the array gas sensor by internal and external circulation of the refrigerator, and only keeping the response characteristics of the array gas sensor to the gas emitted by the food in the refrigerator. That is, in the method of the present invention, the resistance values of the array gas sensor response are collected in real time and are subjected to an exponential smoothing filtering process every time a new resistance value is collected, and only the response characteristics of the array gas sensor to the gas emitted by the food in the refrigerator are retained. It should be noted that the exponential smoothing filtering processing is a processing mode of a software algorithm, in other words, in the method of the present invention, the influence of periodic response brought to the array gas sensor by the internal and external circulation of the refrigerator can be effectively avoided through the software algorithm, no additional design is required to be performed on the hardware of the electronic nose system, the design complexity of the electronic nose system is reduced, and the setup time of the electronic nose system is shortened.
The resistance data after the exponential smoothing filtering processing can be preprocessed, the preprocessing method can adopt a moving average method, a normalization method and the like, the resistance data are preprocessed by adopting the moving average method, the normalization method and the like, the influence of some abnormal data which fluctuate suddenly on the result can be smoothed, and the data processing precision is improved. The electronic nose system may then calculate the change in resistance Δ R over a period of time Δ T for the arrayed gas sensors. For example, the array gas sensor may collect data points every 10s, and the change Δ R in the resistance collected by the array gas sensor within 30min may be calculated. The change in resistance can be calculated each time a new resistance value is acquired, wherein Δ T can be determined analytically from the acquired resistance data.
And judging whether the target gas exists or not according to the resistance change delta R of the array gas sensor within a period delta T. If the target gas is judged not to be collected, the resistance data of the gas in the refrigerator can be collected again. And if the target gas is judged to exist, forming a characteristic vector by the response of the array gas sensor to the target gas. Specifically, the electronic nose system can judge whether the change Δ R of the resistance of the array gas sensor within a period of time Δ T is greater than a threshold value θ, if Δ R is less than or equal to θ, it is judged that the target gas is not detected, and resistance data responding to the gas in the refrigerator is collected again. If delta R is larger than theta, the target gas is judged to be detected, and the response of the array gas sensor to the detected target gas is extracted to form a feature vector. According to the food freshness identification method based on the electronic nose system, the whole response and recovery curve does not need to be acquired, the acquired resistance data can be processed in real time, the time required for predicting the detected food freshness is shortened, and the food freshness in the refrigerator is displayed in real time.
And finally, identifying the target gas according to the characteristic vector so as to identify the freshness of the food material to which the target gas belongs. Preferably, the electronic nose system can employ a classifier to identify the target gas to identify the freshness of the food. The classifier is a general term of a method for classifying samples in data mining, wherein the classifier can adopt algorithms such as a proximity algorithm, a decision tree, logistic regression, naive Bayes, a neural network and the like. The freshness of food can be roughly classified into fresh, stale, and spoiled. The present invention can recognize which of freshness, freshness or putrefaction of food in a refrigerator is by the method.
According to one embodiment of the invention, the food freshness identification method based on the electronic nose system further comprises the following steps:
collecting resistance data responding to different freshness of food by using an array gas sensor to serve as a standard sample; processing the acquired resistance data, and determining a threshold theta for detecting the target gas; extracting the sample characteristics of the array gas sensor to the target gas according to the processed resistance data; and forming a training set of the samples by using the extracted sample characteristics, and building a classification model for identifying the freshness of the food.
Specifically, in the method of the present invention, before the freshness of the food material in the refrigerator is detected by using the electronic nose system, a batch of data of different freshness of the food material by the array gas sensor needs to be collected. That is, it is first necessary to collect resistance data responsive to different freshness degrees of food by using the array gas sensor as a standard sample, which is resistance data responsive to only different freshness degrees of food in the environment. And then, processing and analyzing the acquired resistance data, and determining a threshold value theta of the detected target gas, wherein the threshold value theta can be used as a reference value for judging whether the array gas sensor acquires the target gas in the subsequent detection process. And finally, extracting the sample characteristics of the array gas sensor to the target gas according to the processed resistance data, forming a training set of samples by using the acquired resistance data, and building a classification model for recognizing food freshness.
In summary, according to the food freshness identification method based on the electronic nose system, the collected resistance data which is responsive to the gas emitted by the food in the refrigerator is subjected to exponential filtering processing, so that the influence of the internal and external circulation of the refrigerator on the periodic response of the array gas sensor is reduced, the response characteristic of the array gas sensor on the gas emitted by the food in the refrigerator is only reserved, the hardware of the electronic nose system is not required to be additionally designed, the design complexity and the manufacturing cost of the electronic nose system are reduced, the construction time of the electronic nose system is shortened, and the freshness of the food in the refrigerator can be detected in real time.
The present invention also provides an electronic nose system comprising an array gas sensor for collecting resistance data responsive to gas emitted by food in a refrigerator, a processor, and a memory, wherein the array gas sensor comprises a plurality of individual sensors, at least one of which is responsive to at least one gas in the refrigerator. The memory stores a computer program, and the computer program is used for realizing the food freshness identification method based on the electronic nose system in the embodiment when being executed by the processor. By adopting the method for identifying the freshness of food based on the electronic nose system, the electronic nose system detects the freshness of food in the refrigerator without additionally designing hardware of the electronic nose system, reduces the design complexity and the manufacturing cost of the electronic nose system, shortens the construction time of the electronic nose system, and can detect the freshness of food in the refrigerator in real time.
Other structures and operating principles of the electronic nose system according to embodiments of the present invention will be understood and readily implemented by those skilled in the art, and therefore will not be described in detail.
Thus, it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been illustrated and described in detail herein, many other variations or modifications consistent with the principles of the invention may be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Accordingly, the scope of the invention should be understood and interpreted to cover all such other variations or modifications.