0% found this document useful (0 votes)
26 views

Chapter 2

This chapter reviews literature related to detecting the freshness level of fruits and vegetables using various technologies. Studies have used infrared thermal imaging and machine learning algorithms like artificial neural networks to predict tomato freshness. Other research has used sensors and a convolutional neural network to detect ripened and rotten fruit, achieving 89% and 96% accuracy respectively. Additionally, a study proposed using temperature, humidity and weight loss data with a CNN-LSTM model to predict egg freshness, reducing prediction errors.

Uploaded by

marfcelis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Chapter 2

This chapter reviews literature related to detecting the freshness level of fruits and vegetables using various technologies. Studies have used infrared thermal imaging and machine learning algorithms like artificial neural networks to predict tomato freshness. Other research has used sensors and a convolutional neural network to detect ripened and rotten fruit, achieving 89% and 96% accuracy respectively. Additionally, a study proposed using temperature, humidity and weight loss data with a CNN-LSTM model to predict egg freshness, reducing prediction errors.

Uploaded by

marfcelis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Chapter II

REVIEW OF RELATED LITERATURE

This chapter represents selected literature focused on the studies that were used by the

researchers as basis to support this design project. The gathered information is based on concepts,

theories found on books or electronic sources/materials and published articles online. With this,

readers may understand the concept of the construction of the prototype as well as the tomatoes

freshness level indicator in cooling system. The researchers sited various authors of applied

information and studies that make study reliable.

Related Literature

Foreign Studies

According to (Jing Xie, Sheng-Jen, 2016), The United States and China are the world’s

leading tomato producers. Tomatoes account for over 2 billion annually in farm sales in the U.S.

Tomatoes also rank as the world’s 8th most valuable agricultural product, valued at 58 billion

dollars annually, and quality is highly prized. Nondestructive technologies, such as optical

inspection and near-infrared spectrum analysis, have been developed to estimate tomato freshness

(also known as grades in USDA parlance). However, determining the freshness of tomatoes is still

an open problem. This research (1) illustrates the principle of theory on why thermography might

be able to reveal the internal state of the tomatoes and (2) investigates the application of machine

learning techniques—artificial neural networks (ANNs) and support vector machines (SVMs)—

in combination with transient step heating, and thermography for freshness prediction, which

refers to how soon the tomatoes will decay. Infrared images were captured at a sampling frequency

of 1 Hz during 40 s of heating followed by 160 s of cooling. The temperatures of the acquired

images were plotted. Regions with higher temperature differences between fresh and less fresh
(rotten within three days) tomatoes of approximately uniform size and shape were used as the input

nodes for ANN and SVM models. The ANN model built using heating and cooling data was

relatively optimal. The overall regression coefficient was 0.99. These results suggest that a

combination of infrared thermal imaging and ANN modeling methods can be used to predict

tomato freshness with higher accuracy than SVM models.

Freshness Level Detection


A study by (Ganeshan Mudaliar, et. al., 2021), discussed the system to detect fruit freshness

using machine learning and IoT approach. The study focused on detecting rotten food early and

improving accuracy to reduce food waste by using sensors and analyzing gases released by specific

food products. In this study when a microcontroller detects gases, it communicates data to the

Internet of Things, enabling the necessary action to be taken. To accomplish this the author used

machine learning and IoT, as well as sensors, to anticipate how frequently a food will spoil. The

author also used a Wi-Fi module that connects this IoT system to the internet, and it begins reading

data from the connected sensors. The system consists of a microprocessor, as well as electrical and

biosensors such as a moisture sensor and an ethanol gas sensor. This technology detects moisture

as well as harmful gases. A convolutional neural network (CNN) is also used as, a sort of deep

learning neural network, is a type of deep learning neural network that’s a big step forward in

image identification. They’re most usually utilized to examine visual imagery, and they're

regularly involved in picture categorization behind the scenes. This study got an accuracy of 89%

while using CNN in detecting ripened fruit and 96% in rotten fruit. The result of both CNN and

sensors valve comparing that both the result is declared as fresh or rotten. This study answers our

research question on the accuracy of the freshness information.

According to (Tae Hyong Kim et al., 2022) proposed a study of an Egg Freshness

Prediction Model Using Real-Time Cold Chain Storage conditions based on Transfer Learning.
This study shows that maintaining and monitoring the quality of eggs is a major concern during

cold chain storage and transportation due to the variation of external environments, such as

temperature or humidity. In this study, they proposed a deep learning based Haugh unit (HU)

prediction model which is a universal parameter to determine egg freshness using a non-

destructively measured weight loss by transfer learning technique. The temperature and weight

loss of eggs from a laboratory and real-time cold chain environment conditions are collected from

ten different types of room temperature conditions. The data augmentation technique is applied to

increase the number of the collected datasets. The convolutional neural network (CNN) and long

short-term memory (LSTM) algorithm are stacked to make one deep learning model with

hyperparameter optimization to increase HU value prediction performance. In addition, the general

machine learning algorithms are applied to compare HU prediction results with the CNN-LSTM

model. The source and target model for stacked CNN-LSTM used temperature and weight loss

data, respectively. Predicting HU using only weight loss data, the target transfer learning CNN-

LSTM showed RMSE value decreased from 6.62 to 2.02 compared to a random forest regressor,

respectively. In addition, the MAE of HU prediction results for the target model decreased when

the data augmentation technique was applied from 3.16 to 1.39. It is believed that monitoring egg

freshness by predicting HU in a real-time cold chain environment can be implemented in real life

by using non-destructive weight loss parameters along with deep learning. the major parameter

for defining egg quality is freshness. Egg quality or freshness is reflected by the change in storage

time, temperature, and humidity and decreases due to the deterioration of internal quality to

compare and validate the performance of the proposed stacked CNN-LSTM-based deep learning

model via transfer learning, two general machine learning techniques from previous studies have

been used [34]. The regression models used are as follows: ANN regressor and random forest (RF)

regressor. For the ANN regressor, the input data is composed of a weight loss parameter and the
output data is HU value from real-time cold chain data. The initial structure of the ANN regressor

is composed of two hidden layers with a hidden node size of 50, respectively. The training function

is set as ‘trail’. The parameters for training ANN are learning rate, number of hidden node sizes,

and training function. For the RF regressor, the input and output data are identical to the ANN

regressor. The parameters for training the RF regressor are the number of trees, the number of leaf

sizes, and the number of predictors to sample. The optimal parameters for ANN and RF are

searched by using the Bayesian optimization technique with a maximum iteration of 35. The

objective function of optimization is to minimize the normalized RMSE which is identical to the

stacked CNN-LSTM deep learning model optimization objective function. In connection to our

study, it didn’t determine the freshness level of tomatoes, but it shows a similarity in a way to

determine freshness. It also tackles that egg freshness is reflected by the change in storage time,

temperature, and humidity and our study was about to use a cooling system that has a temperature

and humidity sensor and is somewhat connected to this study but in a different approach.

In Study of (Wei Wang, Weizhen Yang, et al., 2023), Apples are one of the most commonly

consumed fruits by people. China’s apple production accounts for one-seventh of the world’s

output, and it is an important cash crop in China. The freshness of apples is the most important

indicator to evaluate the quality of apples, which directly affects the sales of apples. If the shelf

life of apples can be accurately predicted, it will provide an effective guarantee for quality and

output value. Fruit and vegetable freshness prediction technology has a long history, and its

freshness prediction methods mainly include fuzzy sense, dielectric property, mechanical property,

acoustic property, near-infrared spectroscopy, and electronic nose detection technology. Fuzzy

sense mainly relies on individuals to judge the feel, smell, and experience of objects, which are

highly subjective. The dielectric property is detected by using the dielectric constant of the fruit,

which can be used for the detection of fruit sugar content and moisture content. Acoustic
characteristics are detected using acoustic properties such as fruit reflection, scattering,

transmission, and attenuation. Kinetic modeling is a technique that uses the relevant mechanical

properties of fruits for testing. Near-infrared spectroscopy is the use of fruit to detect the

absorption, reflection, scattering, transmission, and other characteristics of light. The above four

detection methods are generally for a single detection object, which needs to be judged one by one;

the detection efficiency is relatively low; and the requirements for equipment are high. Moreover,

in order to accurately predict the freshness level of apples, an electronic nose system based on a

gas sensor array and wireless transmission module is designed, and a neural network prediction

model using an improved Sparrow Search Algorithm (SSA) based on chaotic sequence (Tent) to

optimize Back Propagation (BP) is proposed. The odor information emitted by apples is studied to

complete an apple freshness prediction. Furthermore, by fitting the relationship between the

prediction coefficient and the input vector, the accuracy benchmark of the prediction model is set,

which further improves the prediction accuracy of apple odor information. Compared with the

traditional prediction method, the system has the characteristics of simple operation, low cost,

reliable results, mobile portability, and it avoids the damage to apples in the process of freshness

prediction to realize non-destructive testing.

According to Sara Khoshnoudi-Nia & Marzieh Moosavi-Nasab, 2019, studied about

Prediction of various freshness indicators in fish fillets by one multispectral imaging system, On

the study, a simple multispectral imaging (430–1010 nm) system along with linear and non-linear

regressions were used to assess the various fish spoilage indicators for 12 days storage at 4 ± 2 °C.

The indicators included Total-Volatile Basic Nitrogen (TVB-N) Psychotropic Plate Count (PPC)

and sensory score in fish fillets. Immediately, after hyperspectral imaging, the reference values

(TVB-N, PPC, and sensory score) of samples were obtained by traditional method. To simplify

the calibration models, nine optimal wavelengths were selected by genetic algorithm. The
researcher considered Non-linear as a better quantitative model to predict all three freshness

indicators in fish fillets. Among the three spoilage indices, the best predictive power was obtained

for PPC value and the weakest one was acquired for TVB-N content prediction. They said that

Further studies are needed to improve the accuracy and applicability of the HSI system for

predicting the freshness of rainbow-trout fish. Our research focuses on refrigerated tomato

freshness level indicators using machine learning and the said study is a relevant finding to our

study.

Ga-Young Lee & Han-Seung Shin (2016), studied the Development of a freshness

indicator for the quality of skate (Raja kenojei) during storage There is much interest in the fishery

industry in developing a freshness indicator that can reflect the storage history of products and

their quality. Freshness is one of the main considerations for the fishery industry and consumption.

In this study, a freshness indicator of fish products, especially skate (Raja kenojei), was developed.

The release of amines, especially ammonia from decomposing fish is concentrated in the

headspace and they can be detected by a pH-sensitive sensor unit. The sensor unit was organized

with a polymer matrix solution, which contains bromothymol blue-phenol red as a sensitive dye

to monitor visible color changes from yellow to purple. We investigated the sensor unit

formulation, which responds to the ammonia formation in fish products. The color change of the

sensor unit was evaluated as well as the selection of the proper weight of fish products and

packaging material. Results will be useful to establish a basis for the development of a freshness

indicator and to determine the suitability of freshness indicator formulations for intelligent food

packaging applications. Our research focuses on refrigerated tomato freshness level indicators

using machine learning and the said study is a relevant finding to our study.

Machine Learning
According to (Ovelil and Raju et.al, 2023), the fruit freshness detection using Iot and

Machine learning that this project aims to enhance the precision and efficiency of detecting fruits

rot. And also achieves this by utilizing sensors to detect the gases emitted by the fruits and

analyzing images with machine learning models such as VGG 16 to obtain a more comprehensive

evaluation of their freshness level. The models have trained on extensive images and sensor data

datasets, which allows for precise identification of varying degrees of fruit freshness. Real-time

data analysis and reporting to a connected technological ecosystem enables prompt monitoring of

the fruits' freshness. If implemented, this project could decrease wastage and guarantee that top-

quality fruits are delivered to their intended destinations, benefiting the fruit transportation sector.

In a study of (Rajnish Kler et. al., 2022) Machine Learning and Artificial Intelligence in

the Food Industry: A Sustainable Approach, this study goal of this research was to investigate how

artificial intelligence (AI) and machine learning (ML) techniques are being used in the food

industry and to come up with future research directions based on that. This study investigates the

articles available on several scientific platforms that link both AI and supply chain from one side

and ML and the food industry from the other side, using a systematic literature review

methodology. The findings of this research stated that although AI and machine learning

technologies are still in their beginning, the prospective for them to enhance the performance of

the food industry (FI) is quite promising. Various investigators created AI and ML-related models

that were verified and found to be effective in optimizing FI, and so the use of AI and ML in FI

networks provides competitive advantages for improvement. Other academics suggest that AI and

machine learning are both now adding value, while others believe that they are still underutilized

and that their tools and methodologies can harness the overall value of the food business.

According to the findings, AI and machine learning have the potential to reduce economic

losses, thereby supporting the food industry's efficiency and responsiveness. This paper shows the
reader how to move from a conventional approach to the most up-to-date and innovative automated

process in the food sector. Although a variety of techniques have been established to meet the

challenges that have emerged in the food sector, AI and machine learning have provided real-

world opportunities to experience cutting-edge technology. This unique strategy entailed studying

data patterns and adjusting the process to provide output that is correct, reliable, takes fewer

humanoid incomes, is competent, and helps the operator forecast upcoming circumstances over

time. These techniques can be considered as a blessing in terms of filling the hole left by the ever-

increasing number of flaws in the food sector. Drone technology would become a great milestone

in the food supply chain management over time. Sensors are becoming an increasingly significant

part of the food preparation process. The food industry has indeed been able to achieve better,

more efficient, and actual outcome of AI and big data.

According to (Vinda Setya Kartika et al., 2018), proposed a novel approach for detecting—

spoiled meat utilizing semiconductor gas sensors and image processing methods. The traditional

method of detecting spoiled meat involves using the human senses of sight and smell, which can

be subjective and potentially dangerous due to bacterial contamination. To get over these

constraints, the researchers employed a camera with image processing utilizing a Grey Level Co-

Occurrence Matrix and a gas sensor array to identify gases released by decaying meat. Artificial

Neural Networks (ANN) were used to analyze the responses from the gas sensor array and the

Grey Level Co-occurrence Matrix to classify the degree of spoilage. The proposed method

achieved a high percentage of success, with an accuracy of up to 82%. This meant the ANN could

accurately classify the level of spoilage in the meat based on the gas sensor and image data. This

method had the potential to replace the role of human senses in meat classification, making the

process faster, more objective, and safer. This study used cameras and neural networks as image-
processing tools to detect spoiled meat. This study said that using human senses as the traditional

way of detecting spoiled meat could be potentially dangerous due to bacterial contamination.

In a study by (H. Kagaya, K. Aizawa, and M. Ogawa, 2022) A CNN Food Recognition and

Food Waste Estimation UsiRudning a Convolutional Neural Network model for determining the

probability of different food categories based on images was developed with high accuracy (more

than 98%). In this study, the students’ images of plates before and after their meals were analyzed

by masking the background, to calculate the differences between the two images without any

background, which is considered eaten food, and the food waste was calculated as the rest, up to

100%. The calculation efficiency is dependent on the accuracy of the proposed model. The model

showed accurate results when the whole plate is seen in the image, and when the plate is simple,

without irregular colors or shapes. Additionally, any non-food objects (e.g., cutlery) should be

excluded from the images. It was calculated that the food waste of Serbian students amounted to

21.3%. Although the model has its deficiencies, when using the model properly, the food waste is

calculated using a fast and accurate novel approach.

This study proposes a double-track method for the classification of fruit varieties for

application in retail sales. The method uses two nine-layer Convolutional Neural Networks

(CNNs) with the same architecture, but different weight matrices. The first network classifies fruits

according to images of fruits with a background, and the second network classifies based on images

with the ROI (Region of Interest, a single fruit). The results are aggregated with the proposed

values of weights (importance). Consequently, the method returns the predicted class membership

with the Certainty Factor (CF). The use of the certainty factor associated with prediction results

from the original images and cropped ROIs is the main contribution of this paper. It has been

shown that CFs indicate the correctness of the classification result and represent a more reliable
measure compared to the probabilities on the CNN outputs. The method is tested with a dataset

containing images of six apple varieties. The overall image classification accuracy for this testing

dataset is excellent (99.78%). In conclusion, the proposed method is highly successful at

recognizing unambiguous, ambiguous, and uncertain classifications, and it can be used in vision-

based sales systems in uncertain conditions and unplanned situations.

A study by (Rudnik Katarzyna, and Michalski Pawel, 2019) a Vision-Based Method

Utilizing Deep Convolutional Neural Networks for Fruit Variety Classification in Uncertainty

Conditions of Retail Sales, this study proposes a double-track method for the classification of fruit

varieties for application in retail sales. They use method of two nine-layer Convolutional Neural

Networks (CNNs) with the same architecture, but different weight matrices. The first network

classifies fruits according to images of fruits with a background, and the second network classifies

based on images with the ROI (Region of Interest, a single fruit). The results are aggregated with

the proposed values of weights (importance). Consequently, the method returns the predicted class

membership with the Certainty Factor (CF). The use of the certainty factor associated with

prediction results from the original images and cropped ROIs is the main contribution of this paper.

This study shows that CFs indicate the correctness of the classification result and represent a more

reliable measure compared to the probabilities on the CNN outputs. The method is tested with a

dataset containing images of six apple varieties. The overall image classification accuracy for this

testing dataset is excellent (99.78%). In conclusion, the proposed method is highly successful at

recognizing unambiguous, ambiguous, and uncertain classifications, and it can be used in vision-

based sales systems in uncertain conditions and unplanned situations.

In a study by (Zhe Huang et al., 2021) Chai Mobile phone component object detection

algorithm based on improved SSD, the author of this study links an open overlay panel aiming at
the problem of low accuracy of small object detection and poor system robustness in the detection

of mobile phone component image targets, an improved SSD algorithm is proposed to detect

mobile phone component image targets. This article proposes an algorithm, CSP-SSD (Cross Stage

Partial SSD). By improving the network structure, using gradient flow information, using

deconvolution, and using multi-scale transformation, the traditional SSD algorithm is improved,

so that it can better adapt to the detection task of mobile phone components. This study test results

show that when the image size is 300*300, the Map of the algorithm reaches 78.9%. The proposed

method in this study has the characteristics of high detection accuracy for small objects. And by

this, since our study is dealing with small objects it is helpful study for us.

A study by (O. Oulcan et al., 2019) discussed the negative perception of red meat that could

occur under unsuitable sales conditions, such as exposure to heat or poor storage, resulting in a

negative impact on consumer perception. Additionally, it highlighted the loss of nutrients and the

formation of harmful. microorganisms that could occur under such conditions, which posed a risk

to human health. The study focused on monitoring the quality of a tray of meat. cubes, which is a

commonly sold product in the retail sector. To accomplish this, the authors used a stable camera

to capture RGB images of the tray of meat. cubes at two-minute intervals, which allowed the

researchers to track any changes in quality over time. Expert data was also collected and used as

reference labels to help train the deep convolutional neural network architecture. The images

acquired by the camera were pre-processed, and the deep learning. model was trained to classify

them as either "fresh" or "spoiled." The study found. that deep learning methods are successful in

this research field, as 6 evidenced by the experimental results and comparisons conducted. Their

research is more focused on deep learning. This is related to our research question on how machine

learning works to determine the exact level of freshness in tomatoes.


According to (Osisanwo F.Y et. Al, 2017), in their study entitled Supervised Machine

Learning Algorithms: Classification and Comparison, in this study, said that ML classification

requires thorough fine-tuning of the parameters and at the same time a sizeable number of instances

for the data set. It is not a matter of time to build the model for the algorithm only but precision

and correct classification. Therefore, the best learning algorithm for a particular data set does not

guarantee the precision and accuracy for another set of data whose attributes are logically different

from the other. However, the key question when dealing with ML classification is not whether a

learning algorithm is superior to others, but under which conditions a particular method can

significantly outperform others on a given application problem. They said that Meta-learning is

moving in this direction, trying to find functions that map datasets to algorithm performance. To

this end, meta-learning uses a set of attributes, called meta-attributes, to represent the

characteristics of learning tasks and searches for the correlations between these attributes and the

performance of learning algorithms. Some characteristics of learning tasks are the number of

instances, the proportion of categorical attributes, the proportion of missing values, the entropy of

classes, etc. The objective is to utilize the strengths of one method to complement the weaknesses

of another. If we are only interested in the best possible classification accuracy, it might be difficult

or impossible to find a single classifier that performs as well as a good ensemble of classifiers, NB

and RF machine learning algorithms can deliver high precision and accuracy. Regardless of the

number of attributes and data instances. This research shows that time to build a model is one

factor on one hand; and precision with kappa statistic while MAE is another factor on the other

hand. Therefore, ML algorithms require precision, accuracy, and minimum error to have

supervised predictive machine learning. This work recommends that for large data sets, a

distributed processing environment should be considered. This will create room for a high level of

correlation among the variables which will ultimately make the output of the model more efficient.
Machine Learning Algorithms - A Review by Batta Mahesh (2020), Machine learning

(ML) is the scientific study of algorithms and statistical models that computer systems use to

perform a specific task without being explicitly programmed. Learning algorithms in many

applications that we make use of daily. Every time a web search engine like Google is used to

search the internet, one of the reasons that works so well is because of a learning algorithm that

has learned how to rank web pages. These algorithms are used for various purposes like data

mining, image processing, predictive analytics, etc. to name a few. The main advantage of using

machine learning is that, once an algorithm learns what to do with data, I can do its work

automatically. In this paper, a brief review and prospect of the vast applications of machine

learning algorithms has been made. Machine Learning can be Supervised or Unsupervised. If you

have a lesser amount of data and clearly labeled data for training, opt for Supervised Learning.

Unsupervised Learning would generally give better performance and results for large data sets.

This paper also said that if you have a huge data set easily available, go for deep learning

techniques. Aside from this You also have learned Reinforcement Learning and Deep

Reinforcement Learning. You now know what Neural Networks are, their applications, and their

limitations. This paper surveys various machine learning algorithms. Today every person is using

machine learning knowingly or unknowingly. From getting a recommended product in online

shopping to updating photos on social networking sites. This paper gives. an introduction to most

of the popular machine learning algorithms.


Machine Learning relies on different algorithms to solve data problems. Data scientists like

to point out that there’s no single one-size-fits-all type of algorithm that is best to solve a problem.

The kind of algorithm employed depends on the kind of problem you wish to solve, the number of

variables, the kind of model that would suit it best, and so on. Here’s a quick look at some of the

commonly used algorithms in machine learning (ML) according to (Batta Mahesh, 2020).

Supervised Learning

According to (Batta Mahesh, 2019), supervised learning is the machine learning task of

learning a function that maps an input to an output based on example input-output pairs. It infers

a function from labeled training data consisting of a set of training examples. Supervised machine

learning algorithms are those algorithms that need external assistance. The input dataset is divided

into train and test datasets. The training dataset has an output variable which needs to be predicted

or classified. All algorithms learn some kind of patterns from the training dataset and apply them

to the test dataset for prediction or classification. The workflow of supervised machine learning

algorithms is given in Fig below. The most famous supervised machine learning algorithms have

been discussed here.


Figure: Supervised learning Workflow(Batta Mahesh)

Decision Tree

A decision tree according to (Batta Mahesh, 2019), is a graph to represent choices and their

results in the form of a tree. The nodes in the graph represent an event or choice and the edges of

the graph represent the decision rules or conditions. Each tree consists of nodes and branches. Each

node represents attributes in a group that is to be classified and each branch represents a value that

the node can take.

Figure: Decision Tree (Batta Mahesh)


Decision Tree Pseudo Code:

def
decisionTreeLearning(examples, attributes, parent_examples):
if len(examples) == 0:
return pluralityValue(parent_examples)
#return most probable answer as there is no training data left
elif len(attributes) == 0:
return pluralityValue(examples)
elif (all examples classify the same):
return their classification
A = max(attributes, key(a)=importance(a, examples) # choose the most promissing attribute to
condition on tree = new Tree(root=A)
for value in A.values():
exs = examples[e.A == value]
subtree = decisionTreeLearning(exs, attributes.remove(A), examples)
#note implementation should probably wrap the trivial case returns into trees for consistency
tree.addSubtreeAsBranch(subtree, label=(A, value)
return tree

Navie Bayes

According (Batta Mahesh, 2019), it is a classification technique based on Bayes Theorem

with an assumption of independence among predictors. In simple terms, a Naive Bayes classifier

assumes that the presence of a particular feature in a class is unrelated to the presence of any other

feature. Naïve Bayes mainly targets the text classification industry. It is mainly used for clustering

and classification purposes depends on the conditional probability of happening.


Figure: Navie Bayes (Batta Mahesh)

Pseudo Code of Navie Bayes Input:

Training dataset T,
F= (f1, f2, f3,.., fn) // value of the predictor variable in testing dataset.
Output: A class of testing dataset.
Steps:

1) Read the training dataset T;

2) Calculate the mean and standard deviation of the predictor variables in each class;

3) Repeat Calculate the probability of fi using the gauss density equation in each class; Until

the probability of all predictor variables (f1, f2, f3..., fn) has been calculated.

4) Calculate the likelihood for each class;

5) Get the greatest likelihood

Neural Networks

A neural network is a series of algorithms that endeavors to recognize underlying

relationships in a set of data through a process that mimics the way the human brain operates. In

this sense, neural networks refer to systems of neurons, either organic or artificial. Neural networks

can adapt to changing input; so, the network generates the best possible result without needing to

redesign the output criteria. The concept of neural networks, which has its roots in artificial
intelligence, is swiftly gaining popularity in the development of trading systems (Batta Mahesh,

2019).

Figure: Neural Networks (Batta Mahesh)

An artificial neural network behaves the same way. It works on three layers. The input

layer takes input. The hidden layer processes the input. Finally, the output layer sends the

calculated output (Batta Mahesh, 2019).

Supervised Neural Network

In the supervised neural network, the output of the input is already known. The predicted

output of the neural network is compared with the actual output. Based on the error, the parameters

are changed and then fed into the neural network again. A supervised neural network is used in a

feed-forward neural network (Batta Mahesh, 2019).


Figure: Supervised Neural Network (Batta Mahesh)

Unsupervised Neural Network

The neural network has no prior clue about the output of the input. The main job of the

network is to categorize the data according to some similarities. The neural network checks the

correlation between various inputs and groups them (Batta Mahesh, 2019).

Figure: Unsupervised Neural Network (Batta Mahesh)


Reinforced Neural Network

Reinforcement learning refers to goal-oriented algorithms, which learn how to attain a

complex objective (goal) or maximize along a particular dimension over many steps; for example,

maximize the points won in a game over many moves. They can start from a blank slate, and under

the right conditions, they achieve superhuman performance. Like a child incentivized by spankings

and candy, these algorithms are penalized when they make the wrong decisions and rewarded

when they make the right ones – this is reinforcement (Batta Mahesh, 2019).

Figure: Reinforced Neural Network (Batta Mahesh)

This study according to (Batta Mahesh, 2019), said that Machine Learning can be

Supervised or Unsupervised. If you have a lesser amount of data and clearly labeled data for

training, opt for Supervised Learning. Unsupervised Learning would generally give better

performance and results for large data sets. If you have a huge data set easily available, go for deep

learning techniques. You also have learned Reinforcement Learning and Deep Reinforcement

Learning. You now know what Neural Networks are, their applications, and their limitations. This

paper surveys various machine learning algorithms. Today each person is using machine learning
knowingly or unknowingly. From getting a recommended product in online shopping to updating

photos on social networking sites. This paper introduces most of the popular machine learning

algorithms. It answers how machine learning works and it’s a helpful study for us to deepen our

understanding of machine learning.

Osisanwo F.Y et. Al (2017) in their study entitled Supervised Machine Learning

Algorithms: Classification and Comparison, in this study, said that ML classification requires

thorough fine-tuning of the parameters and at the same time a sizeable number of instances for the

data set. It is not a matter of time to build the model for the algorithm only but precision and correct

classification. Therefore, the best learning algorithm for a particular data set does not guarantee

the precision and accuracy for another set of data whose attributes are logically different from the

other. However, the key question when dealing with ML classification is not whether a learning

algorithm is superior to others, but under which conditions a particular method can significantly

outperform others on a given application problem. They said that Meta-learning is moving in this

direction, trying to find functions that map datasets to algorithm performance. To this end, meta-

learning uses a set of attributes, called meta-attributes, to represent the characteristics of learning

tasks and searches for the correlations between these attributes and the performance of learning

algorithms. Some characteristics of learning tasks are the number of instances, the proportion of

categorical attributes, the proportion of missing values, the entropy of classes, etc. The objective

is to utilize the strengths of one method to complement the weaknesses of another. If we are only

interested in the best possible classification accuracy, it might be difficult or impossible to find a

single classifier that performs as well as a good ensemble of classifiers, NB and RF machine

learning algorithms can deliver high precision and accuracy. Regardless of the number of attributes

and data instances. This research shows that time to build a model is one factor on one hand; and

precision with kappa statistic while MAE is another factor on the other hand. Therefore, ML
algorithms require precision, accuracy, and minimum error to have supervised predictive machine

learning. This work recommends that for large data sets, a distributed processing environment

should be considered. This will create room for a high level of correlation among the variables

which will ultimately make the output of the model more efficient.

According to Frederick Livingston (2005), in his study about the Implementation of

Breiman’s Random Forest Machine Learning Algorithm said that Classical machine learning is

developed by collecting samples of data to represent the entire population. This data set is usually

subdivided into two or more datasets. In this study part of the data set is commonly used for

developing the machine learner, and the remaining data is used for evaluation. Often this data set

is imbalanced; the data consists of only a very small minority of the data. Imbalanced machine

learners tend to perform poorly with the classification of fraud detection, network intrusion, rare

disease diagnosing, etc. This is due to imbalanced sampling during the development of the machine

learner. During the testing phase, these rare cases are unseen during the training phase and are

usually misclassified. Leo Breiman, a statistician from the University of California at Berkeley,

developed a machine learning algorithm to improve the classification of diverse data using random

sampling and attribute selection. This project involved the implementation of Breiman’s random

forest algorithm into Weka. Weka is a data mining software in development by The University of

Waikato. He said that many features of the random forest algorithm have yet to be implemented

into this software. The initial goal of this project was to fully implement Bierman’s random forest

algorithm into Weka. Due to the difficulty of his algorithm and the complexity of Weka, only the

variable importance was implemented into Weka, but alternative programs were created. The

Random Forest Java application allows full access to Bierman’s algorithm and is compatible with

Weka’s datasets. This study shows a new way of implementing machine learning, and it might

help us if we adopt this way-gathering technique.


According to the study of C. Lang & T. Hubert’s (2012), a color ripeness Indicator for

Apples, in this study ripeness and senescence of climacteric fruits are strongly related to the

emission of ethylene gas. The ethylene emission of apples can be detected by a newly developed

ripeness indicator. This indicator is based on the reduction effect of ethylene causing color changes

in selected metal ions. The used molybdenum (Mo) chromophores change under the impact of

ethylene in a color spectrum from white/light yellow to blue because of a partial reduction of Mo

(VI) to Mo(V). The sensitivity of molybdenum color change reactions can be varied by

composition and pH values (pH 1.4–pH 1.5) of used ammonium molybdate solution and thus

adopted to different fruits and storage conditions. The indicator can be combined with a color

recognition sensor for quantitative measurements of color change in the frame of the L*a*b*

model. The b*-coordinate reflects changes from yellow to blue, and the luminance L* continuously

varies with increasing ethylene emission. Results obtained with the indicator system were

compared with the direct determination of ethylene concentrations by gas chromatography (GC-

FID). Furthermore, a descriptive sensory test was used to estimate the degree of ripeness. The

indicator can be applied for ripeness gauge on a single fruit or in paperboard crates. This study is

a relevant finding to our study about an indicator used.

Hadi Almasi, Samira Forghani, Mehran Moradi (2022), study Recent advances in

intelligent food freshness indicators; an update on natural colorants and methods of preparation,

consumers’ actual demand to be informed on the quality of food items during storage and

transportation drives researchers to focus on new and innovative systems with the ability to

monitor any changes inside the food pack and notify the user about the quality. This can be mainly

done through a type of packaging system known as food intelligent packaging. Food freshness

indicators (FFI) are a cost-effective intelligent packaging approach that is applied for the real-time

detection and monitoring of the freshness/spoilage status of food and informing food conditions to
the consumers. An appropriate FFI should have the ability to distinguish fresh, medium fresh, and

spoiled food typically by the naked eye. Some important parameters such as the type of

halochromic colorants and polymer used in the FFI and the method of preparation can directly

affect the performance of FFI. Although the production of FFI has a longstanding precedent, the

use of natural dyes from various sources in the development of FFI and the application of novel

methods for preparing FFI has grown due to the exceeding research in this field. This paper

presents an updated review of chemical structure, pH-responsive color change mechanism as well

as advantages and shortcomings of natural colorants recently used for FFI preparation. The context

also aims to provide an update of recent literature on the principles and advantages of current

innovative methods of FFI preparation such as layer-by-layer assembly, sol-gel, electrospinning,

foam/pad development, and 3D printing.

Seunghye Baek et. Al (2020), study about Freshness indicator for monitoring changes in

the quality of packaged kimchi during storage A pH-sensitive dye-based freshness indicator

system was prepared, and visible color changes based on the production of volatile acids and

CO2 during kimchi storage were monitored. During fermentation, the pH of the kimchi, which was

initially 5.4, decreased to moderate values of 4.2–4.4 and reached 4.0 at the end of fermentation.

Based on pH and acidity, three fermentation stages were identified. A good correlation between

the pH and acidity was observed. The highest CO2 concentration (60 %) and organic acid content

(80 mg%) were observed during the optimum fermentation stage. Color changes of the freshness

indicator accurately tracked an increase in CO2 concentration in the package headspace. The tested

indicators all showed visible color changes with the fermentation stages of kimchi, and the values

were significantly correlated with the CO2 concentration, pH, and acidity. Higher TCD values

observed between the stages had a significant correlation with visible color changes. The storage,

survey, and migration test results indicated that the dye did not migrate into the food materials and
is safe for use inside the food package. The results of this study will be useful for developing a

freshness indicator determining the application of freshness indicator formulations and influencing

consumer purchasing decisions. Our research focuses on refrigerated tomato freshness level

indicators using machine learning and the said study is a relevant finding to our study.

According to Chompoonoot Rukchon et. al, (2014), study the Development of a food

spoilage indicator for monitoring the freshness of skinless chicken breasts, A colorimetric mixed-

pH dye-based indicator with the potential for the development of intelligent packaging, as a

“chemical barcode” for real-time monitoring of skinless chicken breast spoilage, is described. Also

investigated was the relationship between the number of microorganisms and the number of

volatile compounds. This on-package indicator contains two groups of pH-sensitive dyes, one of

which is a mixture of bromothymol blue and methyl red, while the other is a mixture of

bromothymol blue, bromocresol green, and phenol red. Carbon dioxide (CO2) was used as a

spoilage metabolite because the degree of spoilage was related to the amount of increased CO2,

which was more than the level of total volatile basic nitrogen (TVB-N) during the storage period.

Characteristics of the two groups of indicator solutions were studied, as well as their response to

CO2. A kinetic approach was used to correlate the response of the indicator label to the changes

in skinless chicken breast spoilage. Color changes, in terms of the total color difference of a mixed-

pH dye-based indicator, correlated well with CO2 levels of skinless chicken breast. Trials on

skinless chicken breast samples have verified that the indicator response correlates with microbial

growth patterns, thus enabling real-time monitoring of spoilage either at various constant

temperatures or with temperature fluctuation. Our research focuses on refrigerated tomato

freshness level indicators using machine learning and the said study is a relevant finding to our

study.
Sara Khoshnoudi-Nia & Marzieh Moosavi-Nasab (2019), studied about Prediction of

various freshness indicators in fish fillets by one multispectral imaging system, On the study, a

simple multispectral imaging (430–1010 nm) system along with linear and non-linear regressions

were used to assess the various fish spoilage indicators for 12 days storage at 4 ± 2 °C. The

indicators included Total-Volatile Basic Nitrogen (TVB-N) Psychotropic Plate Count (PPC) and

sensory score in fish fillets. Immediately, after hyperspectral imaging, the reference values (TVB-

N, PPC, and sensory score) of samples were obtained by traditional method. To simplify the

calibration models, nine optimal wavelengths were selected by genetic algorithm. The researcher

considered Non-linear as a better quantitative model to predict all three freshness indicators in fish

fillets. Among the three spoilage indices, the best predictive power was obtained for PPC value

and the weakest one was acquired for TVB-N content prediction. They said that Further studies

are needed to improve the accuracy and applicability of the HSI system for predicting the freshness

of rainbow-trout fish. Our research focuses on refrigerated tomato freshness level indicators using

machine learning and the said study is a relevant finding to our study.

Ga-Young Lee & Han-Seung Shin (2016), studied the Development of a freshness

indicator for the quality of skate (Raja kenojei) during storage there is much interest in the fishery

industry in developing a freshness indicator that can reflect the storage history of products and

their quality. Freshness is one of the main considerations for the fishery industry and consumption.

In this study, a freshness indicator of fish products, especially skate (Raja kenojei), was developed.

The release of amines, especially ammonia from decomposing fish is concentrated in the

headspace and they can be detected by a pH-sensitive sensor unit. The sensor unit was organized

with a polymer matrix solution, which contains bromothymol blue-phenol red as a sensitive dye

to monitor visible color changes from yellow to purple. We investigated the sensor unit

formulation, which responds to the ammonia formation in fish products. The color change of the
sensor unit was evaluated as well as the selection of the proper weight of fish products and

packaging material. Results will be useful to establish a basis for the development of a freshness

indicator and to determine the suitability of freshness indicator formulations for intelligent food

packaging applications. Our research focuses on refrigerated tomato freshness level indicators

using machine learning and the said study is a relevant finding to our study.

Ce Shi et. Al (2016), studied Developing a machine vision system for simultaneous

prediction of freshness indicators based on tilapia (Oreochromis niloticus) pupil and gill color

during storage at 4 °C, the study assessed the feasibility of developing a machine vision system

based on pupil and gill color changes in tilapia for simultaneous prediction of total volatile basic

nitrogen (TVB-N), thiobarbituric acid (TBA) and total viable counts (TVC) during storage at 4

°C. The pupils and gills were chosen and color space conversion among RGB, HSI and L∗a∗b∗

color spaces was performed automatically by an image processing algorithm. Multiple regression

models were established by correlating pupil and gill color parameters with TVB-N, TVC, and

TBA (R2 = 0.989–0.999). However, assessment of freshness based on gill color is destructive and

time-consuming because the gill cover must be removed before images are captured. Finally,

visualization maps of spoilage based on pupil color were achieved using image algorithms. The

results show that the assessment of tilapia pupil color parameters using machine vision can be used

as a low-cost, online method for predicting freshness during 4 °C storage. This researcher uses a

machine vision system for modeling and simultaneous prediction of TVB-N, TBA, and TVC in

whole tilapia based on pupil and gill color changes during storage at 4 °C. Images of the pupil and

gill were pre-processed, after which color parameter conversion was performed automatically by

an image analysis algorithm. In our research, we are going to use a sample image of our product

and based on that sample it will indicate the freshness of our product and this study is quite relevant

findings to our study.


Fatemeh Rastiani; MSc (2016), studied Monitoring the Freshness of Rainbow Trout Using

Intelligent PH-sensitive Indicator During Storage, they said that the purpose of this study was to

design a packaging that contains a pH indicator for monitoring the freshness of the rainbow trout

fish during storage in a refrigerator. The indicator contained agarose as the carrier, bromocresol

green as the pH indicator, and silica as the surface provider. It was covered by polypropylene film

and attached to the package. The freshness of the trout stored in the refrigerator was assessed by

chemical (total volatile basic nitrogen and pH) and microbiological (total viable count) methods.

The pH of the fish gradually decreased after the third day since the color of the indicator changed

from yellow to green on day 3 and then to blue on day 6. The indicator's response was correlated

with changes in the microbial population and with levels of total volatile basic nitrogen and ph.

The results showed that the designed indicator was sensitive to different pH levels and could be

applied as part of the intelligent packaging system. The freshness indicator worked well before the

expiry date of the fish, which makes it suitable for food quality assessment. So, this indicator can

be used for real-time monitoring of packaged fish freshness. Our research focuses on refrigerated

tomato freshness level indicators using machine learning and the said study is a relevant finding

to our study.

According to Hui-zhi Chen et. al, (2018), studied the applicability of a colorimetric

indicator label for monitoring the freshness of fresh-cut green bell peppers, they said that freshness

is one of the main considerations for the consumption and storage of fresh-cut products. In their

study, a freshness indicator label of packaged fresh-cut green bell pepper has been constructed

based on pH-sensitive indicators. Compared to indicator labels made by bromothymol blue alone,

indicator labels made by mixing methyl red and bromothymol blue solutions (at 3:2 proportion)

with a concentration of 70 mL L−1 in indicator film solution (MB2 formula) could more clearly

monitor pepper decay, where indicator label of MB2 type changed from yellow green to orange.
In this study the label accurately responded to the pepper freshness by significant color change,

due to the increased carbon dioxide concentrations in the package because of deterioration of

pepper at chill temperature. Similarly, the other parameters, such as aerobic plate count, weight

loss, chlorophyll content, malondialdehyde content, membrane permeability, and sensory scores,

were also evaluated. The levels of these parameters reached the threshold of spoilage at day 7 at

7 ± 1 °C. Thus, the results showed that labels made with a mixture of methyl red and bromothymol

blue can be applied as an easy-to-use and promising indicator for freshness monitoring of packaged

fresh-cut green bell peppers. On package indicator label based on methyl red and bromothymol

blue was developed and applied to monitor the freshness of fresh-cut green bell peppers. According

to the test results, the relationship between the color changes of indicator label made by the mixture

of MR and BB at a 3:2 ratio (MB2 formula) and the storage time of bell pepper were in a similar

trend, and the deterioration of the bell pepper could be detected in real-time. This study focuses on

a colorimetric indicator level, and it’s a relevant finding as our research also focuses on an indicator

level but a different approach focuses on the freshness and not the colorimetric quality.
Conceptual Framework

This framework is the overall outline of the study. It can be processed using the input-

process-output (IPO) framework.

Research Paradigm

INPUT PROCESS . OUTPUT

Knowledge Requirement Technical Process


a. Indicator through machine f. Selection of
learning Samples
b. Research on machine g. Data Collection
learning algorithm h. Preservation Process
c. Tomatoes cooling system. i. Monitoring and
d. Freshness level of Observation
tomatoes through neural j. Analytical Testing
network parameters. k. Data Analysis
l. Interpretation and
Hardware Requirement Implications
m. Documentation and a. Indicate the freshness
o. Tech1-12706 level of tomatoes.
Reporting
p. Cooling Chamber
n. Peer Review b. Extend the shell life
q. Temperature Control Unit
r. Humidity Control System of tomatoes.
s. Sensors (temperature and
humidity sensors)
t. Data Logging System System Design
(data logger or data
e. A new controlled
recording system
cooling system with
u. Power Supply
an indicator using
v. Pc/laptop
tomatoes as a
w. Camera
sample product that
Software Requirements can know the
freshness level
a. Python through the use of
b. Sci-kit learn. machine learning.
Testing

Evaluation

Figure 1. Conceptual Framework


Input (I) shows the needed requirement for this study, it involves the knowledge

requirements, that will be needed to accomplish this study. Some software and hardware are also

indicated on this part for hardware this study, tech1-12706 is used as a cooler, a cooling chamber,

a temperature control unit, a humidity sensor, and temperature sensor, a power supply, a laptop,

and a camera, for the software python and sci-kit learn as a machine learning tool for programming.

Process (P) describes the approach taken to achieve the project's goals through system

design, testing, assessment, and implementation.

Output (O) pertains to the desired result that the researcher wants to achieve in this study.

Theoretical Framework:

A study by et. al., G. M. (2021), discussed the system to detect fruit freshness using

machine learning and IoT approach. The study focused on detecting rotten food early and

improving accuracy to reduce food waste by using sensors and analyzing gases released by specific

food products. In this study when a microcontroller detects gases, it communicates data to the

Internet of Things, enabling the necessary action to be taken. The author used machine learning,

IoT, and sensors to anticipate how frequently food will spoil. The author also used a Wi-Fi module

that connects this IoT system to the internet, and it begins reading data from the connected sensors.

The system consists of a microprocessor and electrical and biosensors such as a moisture sensor

and an ethanol gas sensor. This technology detects moisture as well as harmful gases. A

convolutional neural network (CNN) is also used as a deep learning neural network, a type of deep

learning neural network that’s a big step forward in image identification. They’re most usually

utilized to examine visual imagery and are regularly involved in picture categorization behind the

scenes. This study got an accuracy of 89% while using CNN in detecting ripened fruit and 96% in
rotten fruit. The result of both CNN and sensors valve comparing that both the result is declared

as fresh or rotten.

In a study by H. Kagaya, K. Aizawa, and M. Ogawa (2022), A CNN Food Recognition and

Food Waste Estimation Using a Convolutional Neural Network model for determining the

probability of different food categories based on images was developed with high accuracy (more

than 98%). In this study, the students’ images of plates before and after their meals were analyzed

by masking the background, to calculate the differences between the two images without any

background, which is considered eaten food, and the food waste was calculated as the rest, up to

100%. The calculation efficiency is dependent on the accuracy of the proposed model. The model

showed accurate results when the whole plate is seen in the image, and when the plate is simple,

without irregular colors or shapes. Additionally, any non-food objects (e.g., cutlery) should be

excluded from the images. It was calculated that the food waste of Serbian students amounted to

21.3%. Although the model has its deficiencies, when using the model properly, the food waste is

calculated using a fast and accurate novel approach.

This study proposes a double-track method for the classification of fruit varieties for

application in retail sales. The method uses two nine-layer Convolutional Neural Networks

(CNNs) with the same architecture, but different weight matrices. The first network classifies fruits

according to images of fruits with a background, and the second network classifies based on images

with the ROI (Region of Interest, a single fruit). The results are aggregated with the proposed

values of weights (importance). Consequently, the method returns the predicted class membership

with the Certainty Factor (CF). The use of the certainty factor associated with prediction results

from the original images and cropped ROIs is the main contribution of this paper. It has been

shown that CFs indicate the correctness of the classification result and represent a more reliable
measure compared to the probabilities on the CNN outputs. The method is tested with a dataset

containing images of six apple varieties. The overall image classification accuracy for this testing

dataset is excellent (99.78%). In conclusion, the proposed method is highly successful at

recognizing unambiguous, ambiguous, and uncertain classifications.

A study by Rudnik Katarzyna 1, and Michalski Paweł (2019), A Vision-Based Method

Utilizing Deep Convolutional Neural Networks for Fruit Variety Classification in Uncertainty

Conditions of Retail Sales, this study proposes a double-track method for the classification of fruit

varieties for application in retail sales. They use the method of two nine-layer Convolutional

Neural Networks (CNNs) with the same architecture, but different weight matrices. The first

network classifies fruits according to images of fruits with a background, and the second network

classifies based on images with the ROI (Region of Interest, a single fruit). The results are

aggregated with the proposed values of weights (importance). Consequently, the method returns

the predicted class membership with the Certainty Factor (CF). The use of the certainty factor

associated with prediction results from the original images and cropped ROIs is the main

contribution of this paper. This study shows that CFs indicate the correctness of the classification

result and represent a more reliable measure compared to the probabilities on the CNN outputs.

The method is tested with a dataset containing images of six apple varieties. The overall image

classification accuracy for this testing dataset is excellent (99.78%). In conclusion, the proposed

method is highly successful at recognizing unambiguous, ambiguous, and uncertain

classifications, and it can be used in vision-based sales systems in uncertain conditions and

unplanned situations.
E. Operational Definition of Variables

Shelf Life

The shelf-life of tomatoes is based on their ripeness. Commonly mature green tomatoes

have a shelf-life of about 21 to 28 days. Pink tomatoes typically have a shelf-life of about 7 to 14

days. Completely ripe red tomatoes have a shelf-life of 2 to 3 days (Semco 2014).

Machine Learning

Machine learning is an artificial intelligence (AI) that deals with computer systems that

gather specific data. An effective tool for solving problems, automating tasks, and business

operations (Tucci 2023).

Tomato Quality

Many qualities of tomatoes are considered especially in markets, the blossoms scar in

tomatoes should be tiny and dense with no visible zipper in the tomato. A tomato should be smooth

not rough or stiff. The stem scar should be small, and smooth without cracks or breaks. The color

of the tomato should be uniform, and no spots or damage should occur (Nebraska 2007).

Neural Network

A neural network performs machine learning by which a computer absorbs information to

execute the task by analyzing training examples. Neural nets, which are highly interconnected

networks comprising dozens or even millions of simple processing nodes, are loosely modeled

after the structure of the human brain (Hardesty 2017).


Sensor

The image sensor has been used primarily for surveillance in the form of CCTV cameras,

of open outdoor areas or inside buildings containing important goods/information e.g. a bank.

Unlike the sensors, it can provide occupancy information on the presence, location, count, activity,

and even identity in some cases (Erickson, Achleitner, and Cerpa 2013).

You might also like