0% found this document useful (0 votes)
79 views8 pages

E Nose IoT

This paper discusses the development of a low-cost electronic nose system using sensors to predict food expiration dates and reduce waste. Metal oxide sensors detect gases from fruits like bananas and tomatoes at different ripening stages. Sensor data is analyzed using machine learning algorithms, achieving over 95% accuracy in predicting if a banana is stale. The system has potential for use in food storage and distribution to monitor quality in real-time and reduce waste by informing consumers and farmers of upcoming expiration dates.

Uploaded by

arun raja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views8 pages

E Nose IoT

This paper discusses the development of a low-cost electronic nose system using sensors to predict food expiration dates and reduce waste. Metal oxide sensors detect gases from fruits like bananas and tomatoes at different ripening stages. Sensor data is analyzed using machine learning algorithms, achieving over 95% accuracy in predicting if a banana is stale. The system has potential for use in food storage and distribution to monitor quality in real-time and reduce waste by informing consumers and farmers of upcoming expiration dates.

Uploaded by

arun raja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Expiry Prediction and Reducing Food Wastage

using IoT and ML


Original Scientific Paper

Kartik Nair Krina Shah


Dwarkadas J. Sanghvi College of Engineering, Dwarkadas J. Sanghvi College of Engineering,
Student of Electronics and Telecommunication, Student of Electronics and Telecommunication,
Department of Electronics and Telecommunication Department of Electronics and Telecommunication
Mumbai, India Mumbai, India
[email protected] [email protected]

Bhavya Sekhani Dr. Sunil Karamchandani


Dwarkadas J. Sanghvi College of Engineering, Dwarkadas J. Sanghvi College of Engineering,
Student of Electronics and Telecommunication, Faculty of Electronics and Telecommunication,
Department of Electronics and Telecommunication Department of Electronics and Telecommunication
Mumbai, India Mumbai, India
[email protected] [email protected]

Abstract – This paper details development of a low-cost, small-size, and portable electronic nose (E-nose) for the prediction of
the expiry date of food products. The Sensor array is composed of commercially available metal oxide semiconductors sensors like
MQ2 sensor, temperature sensor, and humidity sensor, which were interfaced with the help of ESP8266 and Arduino Uno for data
acquisition, storage, and analysis of the dataset consisting of the odor from the fruit at different ripening stages. The developed
system is used to analyze gas sensor values from various fruits like bananas and tomatoes. Responding signals of the e-nose were
extracted and analyzed. Based on the obtained data we applied a few machine learning algorithms to predict if a banana is stale
or not. Logistic regression, Decision Tree Classifier, Support Vector Classifier (SVC) & K-Nearest Neighbours (KNN) classifiers were the
binary classification algorithms used to determine whether the fruit became stale or not. We achieved an accuracy of 97.05%. These
results prove that e-nose has the potential of assessing fruits and vegetable freshness and predict their expiry date, thus reducing
food wastage.

Keywords – electronic nose (E-nose), MQ2 sensor, food expiry prediction, food wastage, machine learning

1. INTRODUCTION Earlier research has been done on the detection of dif-


ferent ripening stages of bananas using Computer Vision
Today, many food products come with labels – “Best [9]. For example, a camera system has been proposed to
By” or “Use By” stamped on the packaging. But what observe the peel color on the surface of the fruit as an
do they mean? 37% of users reported that they dis- additional feature. The dual E-nose/camera system de-
card food each time it’s past the expiry date – however picts the Fisher class separability measure. It displays
the date only denotes peak quality determined by the a perfect classification of the four maturity stages of a
manufacturer. The manufacturer tests the food in a banana: Unripe, half-ripe, fully ripe, and overripe [11]. In
controlled environment. However, during transporta- another method, the Raspberry Pi 3 Model B was used
tion from Farm-to-Fridge, it undergoes mishandling to collect and display the data from a sampling and sen-
and temperature fluctuations. Thus, the expiry date sor chamber. The sensor chamber consisted of 7 types of
mentioned on the packaging is not accurate anymore
MQ sensors that were detecting the gas being released
and this ambiguity leads to food wastage in large quan-
from tomato-based Filipino cuisine [2].
tities around the world, daily [6]. Farmers tend to keep
the food products in the warehouses for a long period But these methods will be computationally expensive
before sending them to the market, causing food wast- and memory exhaustive for storing the data and ap-
age in large quantities since one spoilt batch usually plying machine learning algorithms. Instead, we have
spoils the entire batch. The farmers incur heavy losses approached the problem using temperature, humidity,
which in turn leads to increased prices thus, adversely and gas sensors that detect the emission of combus-
affecting the economy. This is one of the major reasons tible gases from the food products (e.g., Banana and To-
for the fluctuating prices of fruits and vegetables. mato). Using this method, we obtained numeric values

Volume 12, Number 3, 2021 155


to build the dataset ourselves. The MQ2 gas sensor was must be suggested. In future systems, alerts using SMS
linked to the Blink IoT application using the ESP8266 or E-mail can be provided [3].
module. The banana is placed in the sample chamber
In this paper, the development of a small-size, low-
and the sensors capture data every 30 seconds. The val-
cost portable e-nose has been discussed. Metal ox-
ues are automatically logged into a CSV file. We noticed
ide semiconductors by Figaro have been used for the
an incremental graph of the gas concentration over a 5
sensor array. PIC18F4520 is used in the Embedded
days course. Based on the obtained data, we applied
E-nose and RS 232 is used to interface it to the PC for
machine learning algorithms: Logistic regression, De-
the acquisition, storage, and analysis of the data set
cision Tree Classifier, Support Vector Classifier (SVC) &
consisting of odor signals from oranges and onions.
K-Nearest Neighbours (KNN) classifier to predict if a ba-
The PIC18f4520 is used to control the sensor heaters
nana is stale or not. We achieved an accuracy of 95.9%
and record the sensor response. It is interfaced to the
with the Support Vector Classifier. The same procedure
sensor array consisting of 10 metal oxide semiconduc-
is being applied to other fruits and vegetables too.
tor (MOS) sensors like TGS-813 and TGS-816 as well as
The system can be used in warehouses for food stor- temperature and humidity sensors like LM-35 and SY-
age by manufacturers, the food processing industry, HS-220 respectively using programmable gain ampli-
and supermarkets to monitor food quality in real-time fiers (PGA). Four quads op-amp LM 324 IC is used as a
and help the consumer gain complete transparency unity gain amplifier as the signal conditioning unit to
about the food they consume [1]. If people know ex- avoid loading. It was observed that the responses to
actly when their food is going to spoil, they can con- food like onion and rotten onion were different. Thus,
sume, donate, or convert it to compost. This way, food showing that this Embedded E-nose has shown prom-
wastage reduces tremendously and the traditional ising results. However, pattern recognition algorithms
methods of discarding food (which leads to increased still need to be developed and applied to identify the
Co2) can be avoided. The Agro-benefits can be seen odor and freshness of food [4].
where a farmer can predict and plan the distribution
This project proposed a metal oxide semiconductor-
of his produce. As soon as one batch of the product is
based cost-effective E-nose that was able to differenti-
ready and ripe, the farmer will be notified, and he can
ate between the different ripening stages of a banana.
quickly sell his product. The system will also notify him
It was able to identify the difference between the aro-
if one batch becomes overripe so that the other prod-
ma fingerprint of bananas and achieved an accuracy
ucts can be saved. This will also minimize fluctuations
of 98.66% accuracy using Support Vector Machines
in the global food economy. Overall, the project holds
(SVM). The experimental setup included four stages:
multiple benefits in addition to the above that can also
(1) a sampling system, (2) a gas sensor array, (3) a data
be explored.
acquisition system, and (4) pattern recognition algo-
Fruits like bananas are usually stored together in rithms. 15 bananas varying in color, size, weight was
a warehouse, a ripening wave is initiated due to the placed inside the sampling chamber where the gas lev-
ethylene gas being emitted from the first banana [10]. el (ethylene) and temperature were being controlled
This process expedites the ripening of other bananas and monitored. The cycloid gas chamber consisted
as well, thus leading to the over-ripening of food prod- of 6 MOS sensors (MQ-3, MQ-5, MQ-9, MQ-131, MQ-
ucts sooner than expected. Thus, constant monitoring 135, MQ-136), and using the data acquisition card, the
is required to reduce food wastage. gas sensor readings were stored in the computer and
used for analysis to extract vital information. Principal
2. LITERATURE SURVEY component analysis (PCA), linear discriminant analysis
(LDA), SIMCA, and SVM were the methods used for data
The solution to cur pollution by monitoring air qual-
analysis. SVM separates the classes using a hyperplane,
ity is presented in the form of a prototype that uses
which maximizes a quantity called margin and can be
semiconductor gas sensors like MQ4 and MQ7. MQ7
used for non-linear data as well. Thus, a low-cost MOS-
can be used to detect carbon monoxide concentration
based e-nose was designed to identify and differenti-
in the range of 20 to 2000 ppm. The tin dioxide of the
ate between the different ripening stages of an e-nose.
sensor reacts with carbon monoxide which results in
However, further work to develop additional sensors
the reduction of the sensor resistance. This reduction
and an estimate about the right number of sensors
is an indication of an increase in the output voltage,
need to be determined [7].
which can now be measured. MQ4 sensor is used to
detect natural gases like methane in the concentration The review discusses the application of E-nose and
range of 200 to 10,000 ppm. An LM35 sensor is also be- E-tongue in determining properties that are related to
ing used to obtain the output directly in the centigrade food quality. Various sensors used in E-nose and tongue
scale. Further, air quality was estimated based on Air are compared based on the working principle, applica-
Quality Index (AQI) guidelines set by the Central Pol- tion, and limitation. Gas sensors like conducting poly-
lution Board (CPCB). However, the prototype needs to mers (CP), metal-oxide-semiconductor (MOS), quartz
be implemented on a larger scale to make an impact in crystal microbalance (QCM), and surface acoustic wave
reducing pollution. Additional ways to curb pollution (SAW) sensors can be used to develop an E-nose. These

156 International Journal of Electrical and Computer Engineering Systems


sensors then react with the target chemicals and cause additional Machine Learning algorithms need to be de-
irreversible changes in electrical properties like con- veloped to increase accuracy and range [5].
ductivity. MOS sensors are sensitive to hydrogen and
In this paper, Electronic noses are being developed
unsaturated hydrocarbons and used metal oxide semi-
for the automated identification of volatile chemicals.
conductors like iron or zinc oxide. However, these sen-
They have described and developed a basic prototype
sors consume a high amount of energy as they have
of an Electronic Nose and discussed its’ applications
constraints related to working temperature conditions in the field of medicine, food, and the environment.
(between 150 to 400 °C). CP sensors operate without Electronic Nose consists of a sensor array and Artificial
external heating and hence consume less power than Neural Networks (ANN). Each chemical vapor makes a
MOS sensors. However, these are sensitive to humidity particular signature/pattern when detected by a sen-
and temperature and hence, it becomes necessary to sor. Introducing different chemical vapors will create a
maintain the optimum conditions at all times. database of those signatures. ANN is then used to ana-
The properties of food samples can be recognized lyze the complex database and identify the chemical
using machine learning classifiers and algorithms vapor. A prototype consisting of nine tin-oxide vapor
like PCA and SVM. In some cases, it has been com- sensors along with temperature and humidity sensors
bined with other classifiers to determine food quality. was built. The ANN used for this prototype was a multi-
The decision tree used ID3 as a training algorithm. It layer feed-forward network trained with the backprop-
builds the decision tree using the top-to-bottom and agation algorithm and the fuzzy ARTmap algorithm.
greedy approach. Hence, decision trees and RF can also This prototype was tested on five chemicals: acetone,
be used to determine certain aspects related to food ammonia, isopropanol, lighter fluid, and vinegar. The
quality. Gas sensors are in general, extremely sensi- two networks were trained using randomly selected
tive to temperature and humidity and sample prepa- training patterns and an accuracy ranging from 89.7%
ration and sampling both depend on these factors. to 98.2% was achieved. In the medical field, an elec-
Even the sample size has to be considerably large to tronic nose detects possible problems by analyzing
achieve a high level of accuracy. E-nose also consumes odors from the human body. Using this can also reduce
a high level of energy which thus, hampers their ability. the amount of analytical chemistry used in food pro-
Only time-invariant information could be detected as duction and its applications are in assessing food qual-
ANN and PCA were both developed for static features. ity, checking rancidity of mayonnaise, and grading of
Hence, an E-nose, smaller in size, unaffected by exter- whiskey. However, it still needs to compare the proto-
nal environmental features, consumes less energy and type with the conventional systems as well as develop
still gives a high level of accuracy, needed to be devel- a field system. Also, additional neural networks should
oped. In addition to this, E-nose had to be made more be applied to ensure the highest level of accuracy [14].
user-friendly [13]. The ripeness of postharvest kiwifruit was predicted
In this project, an e-nose (PEN2, Airsense Analytics, using an E-nose with 10 MOS sensors. Three different
GmBH, Germany) which consists of an auto-sampling feature extraction methods like max/min values, differ-
apparatus, a sensor array, and a pattern recognizer ence values, and 70th values were used to discriminate
software was used to detect the freshness of pork. The the fruit at different stages. In addition to this, Partial
sensor array is made of ten MOS sensors lik3 W1C, W6S, least squares regression (PLSR), SVM, and random for-
and W3C. Factors like the mass of the pork samples, est (RF) were used to predict overall ripeness, soluble
storage time, and headspace-generation time were solids content (SSC), and firmness. 160 kiwifruits were
used in the sampling procedure to determine the op- subdivided into groups of 20 each and stored in an
timum experimental conditions. Linear Discriminant incubator (20 °C and 70% relative humidity). PEN3
Analysis (LDA) and Back Propagation Neural Network E-nose system was used to detect the gas from the
(BPNN) were used to classify the pork samples based samples. The E-nose was preheated to reach working
on storage times (ST) and showed an accuracy of temperature and sensor 2 (W5S) gave the most sig-
97.14%. Multiple Linear Regression was used to pre- nificant response. Further, SSC and firmness were used
dict the sensory scores. The correlation coefficients to determine the sweetness and hardness of kiwifruit.
(R2 = 0.9848) between the sensory scores and e-nose The three features were used along with LDA to clas-
signal were high, thus proving that it can effectively sify the different ripening stages. RF algorithm showed
assess pork freshness. The result showed that sensory the best performance with overall ripeness (training:
R2 = 0.9928; testing: R 2 = 0.9928), SSC (training: R2 =
scores of odor and viscosity reduced as storage time
0.9749; testing: R2 = 0.9143) and firmness (training: R2
increased, especially after the third day. Thus, the algo-
= 0.9814; testing: R2 = 0.9290). Thus, this study success-
rithms applied were able to classify the pork samples
fully predicted the ripeness of postharvest kiwifruit us-
during the storage period, thus predicting the storage
ing a MOS E-nose using different feature extraction and
time and sensory scores. They were well discriminated
pattern recognition methods [8].
by LDA, classified correctly by BPNN and the quality in-
dex was provided by MLR. However, the PEN2 e-nose is The study aims to determine the effectiveness of a
comparatively expensive and not easily available. Also, fast gas chromatography (GC) e-nose which is used to

Volume 12, Number 3, 2021 157


determine the storage time and internal quality chang- The MQ2 sensor is conventionally used for smoke
es during the storage of hen eggs. 3 experiments were detection. However, we observed and identified that
conducted: egg volatile detection, internal quality it is highly sensitive to combustible gases. Concentra-
measurement, and sensory evaluation. Yolk and albu- tions of the gas are measured using a voltage divider
men color, spread ratio, freshness, and overall accept- network present in the sensor. This sensor works on 5V
ability were the evaluated sensory characters. The fast DC voltage. It can detect gases in the concentration of
GC e-nose consists of a sampling system (HS100 autos- range 200 to 1000 ppm. This sensor contains Ceramic
ampler), a detector system connected to 2 flame ion- coated with Tin dioxide, enclosed in a stainless-steel
ization detectors (FID), and a data acquisition and pro- mesh. The sensing element has six legs attached to it,
cessing system. Observations showed that haugh unit two of which are responsible for heating the sensing
values decreased as the storage time increased due to element and four are used for output. Oxygen gets
a decrease in albumen height. Principal component absorbed on the surface of sensing material when it
analysis and Discriminant Factor Analysis were further is heated in air at a high temperature. The donor elec-
used to process the data. These confirmed the differ- trons present in tin oxide are attracted towards this
ence in volatile profiles of egg samples and accounted oxygen, thus preventing the current flow. The ethylene
for a total variance of 95.7% and 93.71%, respectively. gas from the banana reacts with these oxygen atoms,
Thus, it was concluded that the fast GC e-nose can be thereby decreasing the surface density of absorbed ox-
used as a reliable instrument for determining the pre- ygen. Current can now flow through the sensor which
diction and quality assessment of egg freshness, espe- generates the analog voltage values. This voltage value
cially during the supply-chain phase [12]. is an indicator of the concentration of the ethylene gas.
A higher concentration of the gas results in a higher
3. BLOCK DIAGRAM analog voltage and vice-versa.

Fig. 2. Proof of Concept Stage

ESP8266 was used to interface the MQ2 gas sensor


Fig. 1. Block Diagram array with the Blynk IoT application to observe the data
in real-time. A banana was put under test and the gas
4. IMPLEMENTATION concentrations released by the banana as it continued
to ripen were observed. With an increase in time, the
Being a novel idea, there were not any datasets read- gas concentrations increased significantly thus proving
ily available that were structured or could be structured that the MQ2 sensor could be used to develop a cost-
as per our requirement. So, we decided that we would effective version of an E-nose.
be building a dataset on our own using a banana and
a few sensors. The stages of implementation are ex-
plained below.

4.1. Proof of Concept

The traditional E-noses available in the market are


either too expensive, inefficient, and difficult to use.
Hence, the first stage involved developing a cost-effec-
tive version of the e-nose. After thorough research, the
MQ2 sensor, a metal oxide semiconductor was used
to test the food products for gas level concentrations
(mainly ethylene). Fig. 3. Graphs for day 1 to 3

158 International Journal of Electrical and Computer Engineering Systems


4.2. Sampling Chamber compact chamber, was activated by supplying a 5V
DC supply through an Arduino module. Similarly, the
The gas chamber is an enclosed, air-tight, and con- temperature and humidity sensors were connected
trolled environment where the food products have and calibrated to the Arduino board. The gas sen-
been tested. The chamber must be cleaned at regular sor was heated for a few minutes before we started
intervals with a clean cloth. The controlled environ- to take the readings. The data from the sensors were
ment ensured accurate data collection and reduced
captured every 30 seconds. Using the comma as the
fluctuations. It is essential that the chamber remains
delimiter, the values were printed onto the serial
airtight as outside parameters can severely affect the
monitor of an application named Teraterm, which di-
operating conditions and working of the sensor which
rectly logged the data into a CSV file. After repeating
is highly sensitive. The gases accumulated in the cham-
this procedure multiple times at different hours of the
ber must be released after every testing interval. The
day, sufficient data had been created in different CSV
temperature and humidity data are collected using
files. All the CSV files were then merged with their
DHT11 sensor that is important to get higher accuracy
in the machine learning stage by providing additional matching columns to create one huge dataset that
attributes. could further be used for training our machine learn-
ing model.
The gases being released from the product get accu-
mulated in the chamber over time, aiding in the ripen- Metal Oxide Semiconductor (MOS) uses a simple
ing of the food products. Thus, as observed in the ‘proof voltage divider network. When the gas comes in con-
of concept' stage, the gas concentrations being re- tact with the sensing element made of Aluminum Ox-
leased from the banana keeps on increasing exponen- ide (Al2O3) and coated with Tin Dioxide (SnO2), the
tially. Based on this observation, concerned individuals resistance of the voltage divider network changes in
must release batches of their products to ensure that proportion to the gas concentrations. In a clean envi-
the rest of the product remains fresh. ronment, the electrons in the tin dioxide layer are at-
tracted towards the oxygen present on the surface of
4.3. Data Collection the sensing material. However, oxygen present on the
surface decreases as they react with certain combus-
The MQ2 gas sensor is interfaced with an Arduino tible gas particles thus allowing the donor electrons to
Uno Board as it is highly compatible and easy to code become free and allowing a flow of current through the
using C Language on Arduino IDE software. The Ar- sensor.
duino Uno reads the analog output voltage at one of
its pins, connected directly with the gas sensor. The MOS sensors operate in the temperature range of
temperature and humidity sensor, DHT11 was also con- 200 to 400°C. These sensors are highly reliable, stable,
nected and calibrated to the Arduino analog pins using sensitive, and have a long lifetime. These can be oper-
a similar procedure. This ensured constant monitoring ated in the wide temperature range of -40°C to +70°C
of the room conditions and took into consideration and humidity range of 0 to 100%RH. They have a short
both temperature and humidity, in real-time. 3000 response and recovery time and do not require heavy
samples over a period of 2 days were taken at a rate of maintenance.
30 seconds per sample.
4.5. Proposed System

We have used python for data handling, data pre-


processing, and training our model. Google Collabo-
ratory with a GPU-based runtime environment was
utilized to write and execute our python code. To work
with the imported CSV file, we used common python
libraries. First, we converted the CSV file into a data
frame using the Pandas library. One of the datasets
which contain 3000 data points is displayed in Table
1 given below, where we have printed only the first
10 values (head) of the dataset for initial analysis. We
can see the data frame consists of 4 features: gas con-
centration (in ppm), temperature value, and humidity
values are the input features whereas the last column
Fig. 4. 3D Model Implementation (overripe/ripeness) is the target value that needs to
be predicted by our model. Additionally, we used the
4.4. Data Preparation seaborn library for plotting and visualizing the data
we had acquired which helped us gain some useful
An unripe banana was taken and placed inside the insights. The graph plot for gas concentration value
chamber. The MQ2 gas sensor, also placed inside the can be seen in Fig. 6.

Volume 12, Number 3, 2021 159


Table 1. Data Frame (first 10 data points) 4.6. Stationarity
Different Features/Parameters present in Dataset The gas concentration value is non-stationary as it
Index Gas (ppm) Temperature Humidity Ripeness keeps on increasing with time. Whereas the humidity
0 0.083333 0.456405 0.791574 0 and temperature values are stationary and periodic
1 0.083333 0.627228 0.595237 0 as the values kept on oscillating between a particular
2 0.083333 0.598781 0.599076 0
range of values. We can also observe that the gas con-
centration value starts to increase exponentially after a
3 0.083333 0.422635 0.702421 0
certain threshold as there is an increase in the emission
4 0.083333 0.618524 0.829969 0
of ethylene gas as the fruit starts to ripen.
5 0.083333 0.247694 0.752487 0
6 0.083333 0.568728 0.688531 0 4.7. Data Cleaning (Preprocessing)
7 0.083333 0.470279 0.785262 0
By observing the data plot, some outliers can be seen
8 0.083333 0.520554 0.839753 0 present in the line-plot because the gas sensor is sen-
9 0.083333 0.616535 0.689238 0 sitive to temperature and humidity changes. The val-
ues which created abrupt changes and disturbed the
uniform linear growth of the gas concentration were
termed as outliers and removed from the dataset. Sec-
ondly, when the fruit is unripe there is no significant
change in the concentration leading to a flat graph.
Hence, we decided to discard the starting values till
they did not begin to show significant changes.

4.8. Model Training


For shuffling and splitting the dataset, creating, and
training our machine learning model, and finally cal-
culating the accuracy of the different models, we used
the Scikit learn module which has multiple libraries
Fig. 5. Gas Concentration Plot available to carry out these functions. The dataset was
shuffled randomly so that range of values is properly
distributed before splitting it to the training set (75%)
and test set (25%). As the numerical features like gas
concentration, humidity and temperature have a differ-
ent range of values, to avoid bias in the data, we used
StandardScaler (a Sklearn library) to scale the data to
a given range. It can be inferred from the given table
below, Logistic regression, Decision Tree Classifier, Sup-
port Vector Classifier (SVC) & K-Nearest Neighbours
(KNN) classifier were the different models trained and
tested on our data. We achieved the highest accuracy
of 97.05% on the Support Vector Classifier model.

4.9. Data Collection


Fig. 6. Temperature Variations
The traditional E-noses available in the market are
either too expensive, inefficient, and difficult to use.
Hence, the first stage involved developing a cost-effec-
tive version of the e-nose. After thorough research, the
MQ2 sensor, a metal oxide semiconductor was used
to test the food products for gas level concentrations
(mainly ethylene).

5. RESULTS

5.1. Result Table

Following is the accuracy and ROC_AUC score ob-


tained for different machine learning models. Accuracy
Score column measures how many observations, both
Fig. 7. Humidity Variations ripe and unripe, were correctly classified.

160 International Journal of Electrical and Computer Engineering Systems


ROC AUC Score tells us how good our model is by cal- 5.4. Confusion Matrix
culating the Area Under the ROC Curve (Refer Fig. 4).
More top-left the ROC curve is, the higher the area and The confusion matrix represents the number of
hence we will get a higher ROC AUC score. correct and incorrect predictions made by the classi-
fier, thereby evaluating the performance of the classi-
Table 2. Accuracy and ROC AUC Score fication model. The matrix is displayed in the form of
of different models a heatmap.

Machine Learning Model Accuracy Score ROC AUC Score


Decision Tree Classifier 96.51% 0.992
Gaussian Naïve Bayes 91.3% 0.987
KNN Classifier 95.97% 0.989
Logistic Regression 96.78% 0.995
Support Vector Classifier 97.05% 0.996

5.2. Learning Curves

The learning curves are computed to choose the per-


fect ratio to split the dataset into training and testing
sets, to minimize the error, improve the accuracy of the
model and allow to detect of high variance or high bias Fig. 10. Confusion Matrix
is present in the data. After careful evaluation of the
learning curves, the dataset was split with 75% of the
data as a training set and 25% as the test set. 6. CONCLUSION

Technologies like the Internet of Things (IoT) and


Machine Learning have been used in this project to ac-
curately determine the expiry date of food products to
reduce food wastage. To achieve this, a cost-effective
version of a traditional e-nose was developed and used
for the detection of staleness of food products. The gas
level (ethylene) was mapped and recorded for different
ripening stages and a data set was recorded successful-
ly using a banana. After the data collection, data clean-
ing (prep-processing steps) was implemented. Further,
machine learning algorithms like Logistic regression:
Fig. 8. Gas Concentration Plot 96.78%, Decision Tree Classifier: 96.51%, Support Vec-
tor Classifier (SVC): 97.05% & K-Nearest Neighbours
5.3. ROC Curves (KNN) classifier: 95.97% were used to process the data
and gain valuable insights regarding the ripening stage
The Receiver Operating Characteristic curve (ROC) and expiry date. These results proved that this low-cost
curve is a useful tool for predicting the probability of a e-nose, supported by efficient machine learning algo-
binary outcome, which plots the false positive rate (x- rithms can be used to determine the expiry date and
axis) versus the true positive rate (y-axis) for different reduce food wastage.
candidate threshold values between 0.0 and 1.0. ROC
curves are to be used when the observations are bal- 7. FUTURE SCOPE
anced between each class.
The project model used and discussed in this paper
can be extended to work with any food product that
emits incremental amounts of ethylene gas or other
volatile gases during its ripening stages. The current sen-
sor-based system can be enhanced by using Raspberry
Pi and camera-based model. The camera can be used to
detect the color and texture of the food item while the
R-Pi will provide additional processing capability. The
machine learning models mentioned above are only be-
ing used as a binary classification algorithm to predict
if the food item is getting stale or not. It can be further
enhanced by utilizing a time-series forecasting model
Fig. 9. The curve for SVM Classifier which can show accurate expiration dates of products

Volume 12, Number 3, 2021 161


beforehand. The prototype can be made compact and Journal Papers:
easy to use by individuals in different industries like food
processing, supply chain, and farming. It can be used [6] M. Alongi, S. Sillani, L. Manzocco, "Effect of expiry
to raise awareness among people about the accurate date communication on acceptability and waste
expiry date of their food products. We also want to pro- of fresh-cut lettuce during storage at different
vide suggestions on the accurate way to utilize/dispose temperatures", Food Research International, Vol.
of their food products, for example, if it has reached an 116, 2019, pp. 1121-1125.
over-ripened state, the suggestions regarding compost-
ing will be provided to the user via a mobile notification, [7] A. Sanaeifar, S. S. Mohtasebi, M. Ghasemi-Vanam-
thus ensuring that the food is not wasted, but utilized khasti, H. Ahmadi, J. Lozano, "Development and ap-
optimally. plication of a new low-cost electronic nose for the
ripeness monitoring of banana using computational
8. REFERENCES
techniques (PCA, LDA, SIMCA, and SVM)", Czech Jour-
Conference papers: nal of Food Sciences, Vol. 32, No. 6, 2014, 538-548

[1] H. Vaviya, A. Yadav, V. Vishwakarma, N. Shah, [8] D. Du, Dongdong, J. Wang, B. Wang, L. Zhu, Z.
"Identification of artificially ripened fruits using Hong, "Ripeness prediction of postharvest kiwi-
machine learning", Proceedings of the 2nd Interna- fruit using a MOS E-Nose combined with chemo-
tional Conference on Advances in Science & Tech- metrics", Sensors, Vol. 19, No. 2, 2019, p. 419.
nology, Mumbai, India, 8-9 April 2019. [9] S. Gunasekaran, "Computer vision technology for
food quality assurance", Trends in Food Science &
[2] M. V.C Caya. et al., "Determining spoilage level
Technology, Vol. 7, No. 8, 1996, pp. 245-256.
against time and temperature of tomato-based
Filipino cuisines using electronic nose”, Proceed- [10] S. P. Burg,.E. A. Burg, "Ethylene action and the rip-
ings of the IEEE 9th International Conference on ening of fruits: Ethylene influences the growth
and development of plants and is the hormone
Humanoid, Nanotechnology, Information Tech-
which initiates fruit ripening", Science, Vol. 148,
nology, Communication and Control, Environ-
No. 3674, 1965, pp. 1190-1196.
ment and Management, Manila, Philippines, 1-3
December 2017. [11] L.-Y. Chen, C.-C. Wu, T.-I. Chou, S.-W. Chiu, K.-T. Tang,
"Development of a Dual MOS electronic nose/cam-
[3] S. Karamchandani, G. Aaklin G. Deven, "Pervasive
era system for improving fruit ripeness classifica-
monitoring of carbon monoxide and methane us-
tion", Sensors, Vol. 18, No. 10, 2018, pp. 3256.
ing air quality prediction", Proceedings of the 3rd
[12] S. M. Yimenu, J. Y. Kim, B. S. Kim, "Prediction of
International Conference on Computing for Sus-
egg freshness during storage using an electronic
tainable Global Development, New Delhi, India,
nose", Poultry Science, Vol. 96, No.10, 2017, pp.
16-18 March 2016.
3733-3746.
[4] A. Kumbhar, D. C. Gharpure, B. A. Botre, S. S. Sadis-
[13] J. Tan, J. Xu, "Applications of electronic nose (e-
tap, "Embedded e-nose for food inspection", Pro- nose) and electronic tongue (e-tongue) in food
ceedings of the 1st International Symposium on quality-related properties determination: A re-
Physics and Technology of Sensors, Pune, India, view", Artificial Intelligence in Agriculture, Vol. 4,
7-10 March 2012. 2020, pp. 104-115.
[5] X. Hong, J. Wang. "Discrimination and Prediction [14] P. E. Keller, "Electronic noses and their applica-
of Pork Freshness by E-nose", International Confer- tions", Proceedings of the IEEE Technical Applica-
ence on Computer and Computing Technologies tions Conference and Workshops, Portland, OR,
in Agriculture, Beijing, China, 29-31 October 2011. USA, 10-12 October 1995.

162 International Journal of Electrical and Computer Engineering Systems

You might also like