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

Manuscript-Final

The document outlines the development of a Smart Scanner application that utilizes artificial intelligence and machine learning to assess the real-time shelf life of fruits and vegetables, aiming to reduce food waste in Filipino households. The application employs convolutional neural networks (CNNs) to analyze produce appearance and provide users with freshness insights and storage recommendations. By enhancing consumer education and promoting sustainable practices, the project seeks to empower users to make informed decisions about food management.
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)
8 views

Manuscript-Final

The document outlines the development of a Smart Scanner application that utilizes artificial intelligence and machine learning to assess the real-time shelf life of fruits and vegetables, aiming to reduce food waste in Filipino households. The application employs convolutional neural networks (CNNs) to analyze produce appearance and provide users with freshness insights and storage recommendations. By enhancing consumer education and promoting sustainable practices, the project seeks to empower users to make informed decisions about food management.
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/ 56

"Smart Scanner for Fruits and Vegetables using Artificial Intelligence and

Machine Learning Techniques for Real-time Shelf Life Assessment"

College Computer Studies

AMA Computer College – Santiago City

In Partial Fulfilment of the Requirements of the degree of Bachelor of

Science in Computer Science (BSCS)

By:

Camat, Vill Jake U.

Morales, Dirk Daniel M.

Sahagun, Lordjen lee M.


CHAPTER I

PROJECT AND ITS BACKGROUND

This chapter contain and present the project context, purpose and description,

objectives of the study, significance of the study, scope, and limitations.

Project Context

People from all around the world face the ongoing problem of food waste

which affects both local and national Philippine households. Consumer ignorance

about how to store and when to throw away fresh food causes substantial

problems in food waste. Research shows that numerous people dispose of their

foods before time because they mistake normal aging patterns for spoilage

indications. Household losses combine with environmental hazards from food

waste to cost consumers money due to poor food management practices.

The Philippine economy depends heavily on agriculture so reducing food

waste becomes important for the nation. The practice of bulk sales at local

markets prompts customers to buy larger quantities than they can consume right

away. The improper handling of perishable goods leads to spoilage since they

have a limited shelf life. The inability to correctly identify safe edible produce leads

consumers toward more complications because of their insufficient food safety

knowledge.

1
The Smart Scanner for Fruits and Vegetables Using Artificial Intelligence

and Machine Learning Techniques for Real-Time Shelf-Life Assessment works

toward developing an operational solution. The system utilizes convolutional

neural networks (CNNs) to examine produce appearance then predict how much

time it has left before spoiling. Users can use the scanner to get live freshness

details about fruits and vegetables while also receiving educational storage

guidelines that improve product shelf stability. Users can both record their

monitored items through the system while the platform sends alerts for each

product approaching its expiration date.

By integrating AI-driven technology with user-friendly features, this project

seeks to empower consumers with actionable information that promotes informed

consumption. Through improved awareness and effective produce management,

the Smart Scanner aims to contribute to reducing food waste in Filipino

households and fostering a culture of sustainability.

Purpose and Description

The Smart Scanner targets two main functions, assisting consumers with

produce management along with waste reduction and sustainable food usage

promotion. AI image recognition technology enables system users to evaluate

both freshness levels and suitable storage conditions of their fruits and

vegetables. This application enhances consumer education together with waste

reduction of edible produce as it fights Filipino household food waste and other

food waste problems worldwide.

2
AI-based Smart Scanner operates as an android application which

performs real-time shelf-life assessment of fruits and vegetables. CNNs serve as

a foundation for the Smart Scanner application which analyzes visual produce

characteristics including color and texture and visible deterioration features. The

application analyzes smartphone camera images or other compatible device

inputs to determine the estimated shelf life after image processing.

Users get educational recommendations on storage methods which help

prolong the life span of their produce from the Smart Scanner. The system

prompts customers to manage their consumption schedule properly which

decreases waste from spoiled items.

As a solution the Smart Scanner utilizes AI insights paired with

educational tools and automatic alerts and makes a complete system to help

users both learn better choices and decrease their food waste.

Objectives of the Study

The primary objective of this study is to develop and implement the Smart

Scanner for Fruits and Vegetables Using Artificial Intelligence and Machine

Learning Techniques for Real-time Shelf Life Assessment. Specifically, this study

aims to.

1. To create a user-friendly interface that ensures accessibility for a wide range

of users, including those with limited technical expertise.

3
2. To develop an AI-based android application that utilizes convolutional neural

networks (CNNs)

3. To provide real-time insights into the freshness and estimated remaining shelf

life of scanned produce.

4. To implement educational features that offer storage tips and best practices

to help users extend the longevity of their produce.

Significance of the Study

The Smart Scanner for Fruits and Vegetables Using Artificial Intelligence

and Machine Learning Techniques for Real-time Shelf-Life Assessment is

expected to provide significant benefits to various stakeholders.

• To consumers, the application empowers them with accurate information

on the freshness of their produce, enabling informed decisions regarding

consumption and storage. This helps reduce food waste, minimize

expenses, and promote healthier eating habits.

• To households, the system helps better manage food inventory,

preventing premature disposal of produce and promoting sustainable

consumption practices.

• To retailers and grocers, the system can improve inventory management,

ensuring older items are prioritized for sale to reduce spoilage and financial

losses.

4
• To the agricultural sector, farmers and suppliers can benefit from insights

on produce shelf life, allowing better planning for harvest cycles, storage

conditions, and distribution strategies.

• To the environment, the project contributes to conservation efforts by

lowering landfill waste and reducing the carbon footprint associated with

wasted food production.

• To the academic community, this project can serve as a valuable

reference for future research in the fields of artificial intelligence, machine

learning, and sustainable technology development.

Overall, this study aims to address food waste concerns by providing a practical,

technology-driven solution that empowers individuals and businesses to adopt

more sustainable practices.

Scope and Delimitations

The Smart Scanner for Fruits and Vegetables Using Artificial Intelligence

and Machine Learning Techniques for Real-time Shelf Life Assessment develops

an AI application which analyzes produce freshness by processing their visual

properties. The system leverages CNNs to evaluate color parameters along with

textural characteristics and appearance deterioration signs for calculating

predicted shelf life of scanned fruits and vegetables.

The android application delivers a convenient platform for real-time

produce assessments to users through their mobile devices. Users can find

educational content regarding correct storage procedures within the application

5
framework. The project serves to increase produce knowledge among consumers

while it improves storage practices and reduces food waste in domestic locations.

This study is limited to assessing fruits and vegetables that exhibit clear

visual signs of freshness or spoilage. The system may not accurately predict shelf

life for produce with internal damage or hidden deterioration that is not visible on

the surface. Additionally, the android application performance is dependent on the

quality of the captured image, which may be affected by lighting conditions,

camera resolution, and user handling.

As of now, the system is designed to assess only five common fruits and

five common vegetables in the Philippines. The study will focus primarily on

produce commonly found in Filipino markets, while exotic or less common fruits

and vegetables may not be included in the initial dataset. Furthermore, the system

is not intended to provide medical or food safety advice but rather to serve as a

guide for managing produce longevity based on visual assessment.

6
CHAPTER II

RELATED LITERATURE STUDIES

This Chapter complies the related literature and studies, synthesis, and technical

background that the researchers have acquired, both locally and internationally to

serve as evidence and to support the paper’s credibility. The gathered information

by the researchers is relevant to the study.

Foreign Literature

According to Zhang, Yang, Cheng et al. (2024) developed a deep

Convolutional Neural Network (CNN) system for fruit freshness detection, To

boost the accuracy and efficiency in fruit quality examination. Their system

addresses two main subtasks which include freshness assessment and fruit

classification tasks. The model achieves its objectives through a shared CNN

subnet which processes input images after extracting features before sending

them to two separate fully connected task heads. The implementation of this dual-

task design allows the model to extract features once before using them in both

freshness detection and fruit classification simultaneously. Visual semantics

identified by the researchers enable better generalization abilities for the model to

achieve higher accuracy rates in multiple tasks. Tests conducted on open fruit

images produced strong outcomes as the CNN reached significant mean test

accuracy levels for quality inspections and fruit type categorization. The proposed

model achieved superior results than normal single-task learning models because

7
it processed both tasks simultaneously. Statistical analyses executed during

research proved that CNN models delivered performance surpassing other

evaluated methods thus validating their shared feature extraction technique. The

CNN-based model stands out for satisfying high accuracy requirements while

delivering reliable real-time detection ability for fruit freshness which benefits food

industry applications. The authors indicate that their system demonstrates

potential for application in other areas which need simultaneous optimization of

related tasks like inspection for defects along with quality evaluation.

As stated by Yuan, Chen, Polat et al. (2024) deep convolutional neural

network (CNN) developed by researchers operates to detect fresh produce by

enhancing effectiveness for examining quality in fruits and vegetables. The

detection system implements various deep learning architectures to retrieve

image visual characteristics which leads to improved freshness evaluation

precision. Headed images through its CNN framework helps it find important

textural elements and spatial patterns which influence produce quality ratings. A

fully connected network receives the extracted features to sort different ripeness

categories and types of spoilage. The model achieves better accuracy in

identifying fruit and vegetable states through its implementation of common

feature extraction processes between freshness assessment and classification

tasks. The CNN model excelled at publicly available datasets evaluation by

surpassing traditional single-task learning models to achieve major accuracy

developments in freshness classification and produce type recognition. Feasibility

studies backed by statistical evidence proved that CNN-based technology is fit for

8
practical food quality control systems. The findings show deep learning

approaches for freshness inspection create huge advantages for food supply

chain quality control operations. The authors propose that their assessment

method can easily adapt to other real-time evaluation needs including automated

agricultural product quality assessment and fault.

Vijay Baskar, Navya Sri, Lavanya et al. (2024) developed a deep

convolutional neural network (CNN) model to predict the shelf life of fresh fruits

and vegetables using temperature simulation data, aiming to optimize transport

and storage conditions. Their research addresses significant post-harvest losses

in India's fruit and vegetable sector, where a substantial portion of the total

produce is wasted annually, resulting in considerable economic losses. The study

highlights the importance of effective storage and transportation management, as

temperature fluctuations significantly impact the shelf life and quality of perishable

goods. The proposed deep learning model utilizes real-time temperature data

collected from storage facilities and transportation routes, feeding this information

into a CNN framework to generate accurate shelf-life predictions. The researchers

designed the model to analyze critical factors such as humidity, storage duration,

and temperature variations, which directly influence produce degradation. By

leveraging this AI-driven approach, stakeholders, including farmers, retailers, and

supply chain managers, can optimize storage conditions and adjust logistics to

reduce spoilage, enhance food safety, and extend the usability of fresh produce.

Experimental results demonstrated that the CNN-based model outperformed

traditional rule-based and statistical methods, achieving higher accuracy in

9
predicting shelf life under varying environmental conditions. The findings

emphasize that deep learning techniques can significantly improve the decision-

making process in agricultural supply chains by providing real-time, data-driven

insights. The study further suggests that integrating AI-based temperature

monitoring with logistics planning could lead to a more sustainable and cost-

effective approach to food distribution, reducing losses and enhancing overall

efficiency. The researchers conclude that their model can be applied not only in

large-scale agricultural operations but also in small and medium enterprises that

struggle with perishable goods management. Additionally, they propose

extending the framework to other temperature-sensitive commodities, such as

dairy products and pharmaceuticals, where shelf-life prediction is critical. This

study underscores the growing role of artificial intelligence in revolutionizing food

supply chains and improving food security by minimizing post-harvest waste and

optimizing resource allocation.

As indicated by Mishra and Shenoy (2023) introduced a groundbreaking

approach to predicting the shelf life of fruits, particularly focusing on bananas,

using advanced deep learning models. Their research aims to combat the

widespread issue of food waste, which is especially prevalent in perishable goods

such as bananas, which can deteriorate quickly if not properly stored or handled.

By predicting the shelf life of bananas, the study seeks to minimize waste by

providing accurate forecasts of when bananas will become overripe or spoil. To

achieve this, the researchers utilized two cutting-edge object detection algorithms

Faster Region-based Convolutional Neural Network (R-CNN) and You Only Look

10
Once (YOLO) to analyze visual characteristics of bananas at various stages of

ripeness. The researchers curated a comprehensive dataset, capturing images of

bananas at different stages of ripening, from unripe to fully ripe. This dataset was

enhanced using preprocessing and augmentation techniques to ensure that the

deep learning models could generalize effectively across varying lighting

conditions and banana types. Both algorithms were then trained to predict shelf

life based on the visual features extracted from the images, with each algorithm

showing unique strengths. Faster R-CNN demonstrated superior performance in

detecting subtle features related to ripeness, allowing for highly accurate

predictions. Meanwhile, YOLO was favored for its processing speed, making it

particularly suitable for real-time applications where rapid predictions are

necessary. The study found that both models improved the accuracy of shelf life

predictions compared to traditional methods, with YOLO excelling in speed and

Faster R-CNN offering greater precision. These findings highlight the significant

potential of deep learning algorithms in revolutionizing the prediction of shelf life

for perishable products, providing both accuracy and efficiency in real-world

applications. The authors concluded that their methodology could be extended

beyond bananas to other fruits and perishable goods, helping reduce food waste

across various sectors of the food industry. By optimizing storage and

transportation logistics, these deep learning models could contribute to a more

sustainable food supply chain, ultimately reducing waste and enhancing food

security. The researchers emphasized the broader implications of their work,

suggesting that the integration of deep learning models for real-time shelf life

11
prediction can improve the management of perishable goods, benefiting farmers,

retailers, and consumers alike.

Muhamamd Imra, Aamir, Uzair et al. (2021) developed an advanced

technique which uses Convolutional Neural Networks (CNNs) along with transfer

learning to perform fruit freshness classification effectively. The study addresses

fruit spoilage through automated classifying systems which use visual signals to

determine if fruits are fresh or spoiled. A systematic procedure begins with

acquiring numerous fruit images before conducting resizing and color

normalization followed by image augmentation for uniform data which receives

labels during the preparatory stage before classification. The research team

employed transfer learning to optimize an AlexNet model through fine-tuning for

the purpose of fruit freshness identification. The developed model contains

several convolutional layers and fully connected layers that finalize classification

by using a softmax classifier. The implemented model demonstrated its strong

ability to determine fresh from spoiled fruits through its evaluation on three public

datasets using measurements that showed high accuracy performance. This

method delivered fast computation speed through its ability to process images in

just a few milliseconds thus making it ready for real-time use cases. The research

highlights how CNNs and transfer learning approaches make automated fruit

freshness detection possible while creating a sustainable and scalable market

solution against food waste and perishable goods management issues in

commercial operations. The proposed technique shows potential for multiple

12
industries that deal with perishable goods since it promotes sustainable food

practices and optimized inventory control.

Local Literature

Nalupano, Omagap, Fortaleza et al. (2022) developed an innovative

system for classifying Kinalabasa tomatoes using convolutional neural networks

(CNN), specifically employing the MobileNetv2 architecture to classify tomatoes

based on their color features, which are crucial indicators of ripeness and

freshness. The system achieved a remarkable accuracy rate of 94%,

demonstrating the effectiveness of CNNs in classifying produce and highlighting

the potential for machine learning to revolutionize food quality assessment. This

CNN-based model provides a faster, more accurate alternative to traditional

methods of classification, which often rely on subjective visual inspection and can

be prone to human error. The ability of CNNs to analyze and extract complex

visual features from images, such as subtle variations in color, directly correlates

to the freshness of tomatoes, making it easier for farmers, retailers, and

consumers to assess their quality in real-time. This advancement is particularly

valuable in reducing food waste, as produce can be classified more efficiently and

accurately, allowing for better management of ripe and overripe tomatoes.

Additionally, the technology offers significant benefits to the agricultural supply

chain by providing real-time assessments, optimizing inventory management, and

improving shelf life prediction. With the growing demand for more efficient food

13
quality control systems, this study illustrates how AI can transform agricultural

practices by providing data-driven insights and reducing waste, ultimately

contributing to sustainable food systems. The findings also suggest that such

CNN-based systems could be adapted to other fruits and vegetables, further

enhancing the potential of machine learning to improve food safety and

distribution.

Carpio, Dela Cruz, and Dorosan (2021) The Philippines is one of the top

fruit-producing countries in the world. However, despite the significant potential of

the fruit industry, Filipino farmers face the highest poverty incidence in the country

at a substantial rate. This presents a unique challenge—while the fruit industry

holds considerable business potential, the agricultural sector remains in need of

substantial development. The question then arises: How can machine learning

technologies revolutionize the fruit industry? In response to this, the study

demonstrates that machine learning, combined with computer vision, can be

trained to differentiate between good and bad fruit. By utilizing a convolutional

neural network (CNN), the research achieved an impressive accuracy and an

average precision and recall across multiple fruit categories on unseen data from

the same dataset. To enhance the deployment of this solution in the Philippine

context, retraining the model on a local dataset is recommended. Additionally,

incorporating object detection could further optimize the system. The potential

applications of this technology are far-reaching: classifying fruit quality for retail

pricing, identifying optimal harvest times to minimize waste, detecting disease in

crops to prevent further spread, and automating the sorting of export- and non-

14
export-quality fruit. This technological approach has the potential to not only boost

efficiency but also help improve the livelihoods of Filipino farmers and promote

sustainability in the agricultural sector.

Orquia and Bibangco (2020) Manual fruit classification has long been the

traditional method used for sorting fruits, relying on manual contact-labor that is

time-consuming and often results in decreased productivity, inconsistency, and

sometimes even damage to the fruits. As a result, new technologies, such as deep

learning, have paved the way for faster and more efficient methods of fruit

classification. Deep convolutional neural networks (CNN), a machine learning

algorithm that consists of several layers of neural networks stacked together,

create more complex models capable of solving intricate problems. Pre-trained

models, such as AlexNet, GoogLeNet, and ResNet-50, have been widely used in

various applications. However, these models were not explicitly trained for fruit

classification tasks. In response to this limitation, the study aimed to create a new

deep convolutional neural network specifically designed for fruit classification. The

performance of this model was compared to fine-tuned versions of existing

models, focusing on key performance metrics such as accuracy, precision,

sensitivity, and specificity. This research emphasizes the potential of tailored deep

learning models to significantly improve the fruit classification process, offering

greater efficiency and reducing human error in agricultural practices.

Ayllon, Cruz, Mendoza et al. (2020) Determining the ripening stage of a

fruit is crucial for farmers, as the fresher the fruit, the better its price and

marketability. This process is especially important in the Philippines, where fruits

15
are the ninth most exported commodity. In this study, the researchers employed

Convolutional Neural Networks (CNN) through image processing to determine the

fruit maturity of several key varieties, including Banana, Mango, and Calamansi.

The study classified the fruits into three categories based on their maturity stage:

pre-matured, matured, and over-matured. To gather the necessary data, the

researchers used a total of 60 fruits, with 20 fruits per category. Data collection

spanned approximately one to two weeks at room temperature, documenting the

fruits from their unripe/pre-matured stage to their over-matured state. The dataset

comprised 3,681 pieces for Calamansi, 3,270 pieces for Banana, and 5,706

pieces for Mango. The CNN model, developed using Spyder in Anaconda

Navigator, utilized TensorFlow-GPU and Keras, paired with CUDA and cuDNN,

for processing the data and producing results.

Cabañ, Gregorio, Macam et al. (2022) The application of computer vision

in agriculture continues to grow, particularly in the area of fruit classification,

where the diversity and complexity of fruit types present unique challenges. The

intricate visual characteristics of fruits necessitate careful selection of relevant

data features and precise tuning of hyperparameters to ensure classification

accuracy. To address these challenges, this study proposed the use of image

processing as a fast and efficient alternative to manual labor, particularly in the

context of fruit harvesting. The researchers focused on the classification of nipa

fruit into four categories mature, immature, rejected, and damaged through the

implementation of artificial neural networks. Two classification strategies were

examined: the largest method and the sequential method. Both approaches

16
employed binary neural network classifiers, each designed as a three-layer

perceptron responsible for distinguishing between binary categories such as

mature versus not-mature and damaged versus not-damaged. The study

revealed that both methods achieved notable accuracy, significantly

outperforming the human classification benchmark. Additionally, a multiclass

classification model developed within the study attained even higher accuracy,

surpassing the binary methods. These findings underscore the potential of neural

network-based classification systems in enhancing the efficiency and reliability of

agricultural sorting processes, offering a practical, automated solution for fruit

quality assessment.

Foreign Studies

Ying, Wang, Li et al. (2024) Fruits and vegetables are prized for their

nutritional value and flavor, yet their perishable nature and seasonal availability

make storage and marketing particularly challenging. Traditional shelf life

assessment methods often fall short in addressing the complexities of modern

agricultural supply chains. In response, researcher explored the use of machine

learning techniques for predicting the shelf life and quality of fresh produce. These

methods allow for efficient handling of large datasets, detection of intricate

patterns, and the creation of predictive models that improve over time as more

data becomes available. The study highlights the use of non-destructive testing

methods alongside machine learning to assess storage conditions and

physicochemical properties without damaging the produce. Advances in dataset

expansion, model optimization, multi-model fusion, and the integration of deep

17
learning are emphasized as critical developments. These innovations contribute

to reduced resource waste, more intelligent agricultural supply chains, and

environmentally sustainable practices. The research also underscores the

importance of interdisciplinary collaboration in combining artificial intelligence with

food science, providing technical guidance for the future of smart food

management systems.

Rashvand, Sun, Krupitzer et al. (2025) Accurate prediction of food shelf life

is a critical factor in ensuring food safety, reducing waste, and enhancing the

efficiency of supply chains across the food industry. Traditional methods such as

microbial analysis, chemical testing, and sensory evaluation, while reliable, are

often time-consuming, labor-intensive, and unsuitable for real-time or large-scale

applications. In response to these limitations, artificial intelligence (AI) has

emerged as a transformative tool in the prediction of food shelf life. Machine

learning (ML), deep learning (DL), and hybrid AI approaches are now being

applied to analyze complex, multi-source data from advanced non-destructive

techniques like hyperspectral imaging, spectroscopy, machine vision, and

electronic sensors. These AI-powered systems are capable of processing data

related to environmental conditions, microbial growth, and biochemical

transformations, allowing for more accurate, adaptive, and timely predictions. The

review highlights AI’s successful implementation across various food categories,

including fruits, vegetables, meat, dairy, and beverages—each with distinct

spoilage mechanisms and influencing factors. AI-based models not only improve

shelf-life estimations but also contribute to reduced economic losses, better

18
resource allocation, and more sustainable food distribution practices. Despite

challenges such as limited data availability, model generalizability, and

computational requirements, the potential benefits of integrating AI with cloud

technologies and the Internet of Things (IoT) hold promise for future innovations.

This comprehensive approach positions AI as a game-changing technology for

promoting food sustainability, intelligent inventory management, and waste

reduction on a global scale.

Jhanjhi, Yassine, Hossain et al. (2022) This study explores the use of deep

learning (DL) algorithms, particularly Convolutional Neural Networks (CNN) and

AlexNet, to predict the maturity and quality of bananas, which directly impacts

their shelf life and overall agricultural management. Fruit maturity classification is

a critical process for both the food industry and retail markets, as it influences the

quality and shelf life of the fruit. The research utilized two datasets of banana

images: a custom dataset, which was augmented to increase its size through

image augmentation techniques, and the publicly available Fruit 360 dataset from

Kaggle. These images were categorized into three maturity levels: ripe, unripe,

and over-ripe. The models were trained using both datasets, and the CNN model

consistently outperformed AlexNet, achieving higher accuracy, particularly with

the augmented dataset. For the original dataset, CNN also showed superior

performance. The results highlight that CNN is the most effective deep learning

algorithm for fruit maturity classification. By using these models, farmers can

optimize their harvest timings, minimizing over- and under-matured produce,

reducing waste, and improving food quality. The study underscores the

19
significance of integrating advanced deep learning models into agricultural

practices, offering a practical solution to better manage harvests and improve

overall food distribution. This approach not only reduces food wastage but also

enhances the sustainability of agricultural practices by enabling more accurate,

real-time assessments of fruit quality, which is vital for better resource

management in the food industry.

Tapia, Albarran, Arriaga et al. (2023) Food waste is a growing global

concern, with significant environmental and economic impacts. The ability to

accurately classify fruits and vegetables and assess their ripeness is crucial in

reducing waste, especially during the postharvest stage. This research presents

a deep learning-based intelligent system aimed at addressing this challenge by

classifying 32 different types of fruits and vegetables, and assessing the ripeness

of six selected types, including apples, bananas, mangoes, oranges, potatoes,

and tomatoes. The system integrates two models based on MobileNet V2

architecture, with one model focused on classifying the produce and another

dedicated to determining the ripeness level. By using transfer learning with pre-

trained weights from ImageNet, the system can fine-tune the models for higher

accuracy in fruit and vegetable recognition and ripeness evaluation. The

classification model achieved impressive accuracy, precision, recall, and F1-

score, while the ripeness assessment model demonstrated near-perfect

performance, making the system highly effective in both classification and

ripeness detection. The system provides a valuable tool for improving food quality

management by aiding in the identification and ripeness assessment of produce,

20
which can help in better food distribution and reducing the amount of wasted food.

Although the system excels in these areas, it still faces some limitations, such as

its inability to properly detect damaged, obstructed, or poorly illuminated produce,

which may affect its performance in real-world applications. Nevertheless, this

intelligent system has great potential in the food industry, providing an automated,

efficient way to monitor and reduce food waste, thereby contributing to more

sustainable food practices worldwide.

Mi and Yan (2024) The timely and precise assessment of fruit ripeness

plays a pivotal role in optimizing harvest planning, reducing waste, and enhancing

the quality of produce. This research focuses on the integration of advanced deep

learning models to improve the detection of strawberry ripeness, addressing the

challenges of traditional, manual methods that often rely on subjective judgment

and can be time-consuming. The study introduces an innovative approach using

a combination of deep learning techniques, trained and tested on a specially

curated dataset of strawberries, to achieve improved accuracy in detecting

various stages of ripeness. The proposed model outperformed existing models by

demonstrating superior precision and recall metrics, with a significant

improvement in detecting strawberry ripeness consistently across different

stages. By enhancing the ability to detect ripeness more effectively, the model

contributes to making more accurate harvest decisions, ensuring that strawberries

are harvested at their peak quality and reducing the likelihood of spoilage during

the postharvest phase. This is particularly important in the case of strawberries,

as they are highly perishable and sensitive to environmental conditions.

21
Furthermore, the model reduces dependency on human labor and eliminates the

potential for human error, streamlining the harvest process and leading to more

efficient and sustainable agricultural practices. The results of this study suggest

that the application of deep learning can not only improve the accuracy of fruit

ripeness detection but also enable real-time, cost-effective automation for

agricultural practices. These advancements could transform the agricultural

industry by allowing for smarter, more efficient harvesting techniques that are

better aligned with the goals of sustainability, resource optimization, and food

waste reduction.

Local Studies

Baldovino, Billiones, Bugtai et al. (2020) A local study focused on

enhancing the quality control of ‘Carabao’ mangoes—recognized as the leading

mango variety in the Philippines and accounting for the majority of the country’s

total mango production—introduced the use of convolutional neural networks

(CNNs) as a more efficient alternative to manual sorting methods. In the

Philippines, mangoes intended for export are evaluated using the Philippine

National Standard for mangoes, which sets visual criteria such as skin color,

presence of blemishes, and surface defects caused by pests or handling damage.

Traditional manual inspection methods, while widely practiced, are time-

consuming, subjective, and inconsistent. To address these limitations, the

researchers proposed an AI-powered mango classification system that utilizes a

basic setup consisting of a webcam for image capture, a desktop computer for

training, and a Raspberry Pi for lightweight deployment. The core of the system

22
relied on CNNs, which were trained to classify mangoes as either "good" or

"damaged" based on visual indicators such as discoloration, fruit fly damage, mold

presence, and mechanical abrasions. Unlike traditional techniques that require

complex sensor networks or manual feature extraction, CNNs automatically learn

important features from raw image data, enabling real-time application once the

model is trained. While CNN training demands a large image dataset and

extended processing time, the final model enables rapid and consistent

assessments suitable for production environments. The study emphasized that

using CNNs for fruit quality control not only improves classification accuracy and

efficiency but also lowers the operational costs compared to sensor-based

systems. Furthermore, the study connected its findings with related AI

applications in agriculture, including fruit ripeness detection, pest identification,

and canopy size measurement, highlighting CNN’s versatility and growing role in

modernizing agricultural processes. This research aligns with national efforts to

boost agricultural productivity and export quality by integrating artificial

intelligence into traditional farming and post-harvest practices.

Nalupano, Omagap, Fortaleza et al. (2024) Determining the freshness of

tomatoes is crucial for evaluating their quality, as it directly influences consumer

satisfaction and the economic returns for farmers and vendors. Freshness is

traditionally assessed based on external characteristics such as skin color, size,

and shape, with skin color serving as a key indicator of ripeness and shelf life.

Accurately assessing the freshness of tomatoes also plays a significant role in

determining their potential shelf life, ensuring that they are sold at their optimal

23
quality. In response to the growing need for more efficient and accurate methods

of freshness assessment, a local study introduced an accessible and cost-

effective approach to classifying Kinalabasa tomatoes using image processing

and deep learning techniques. The researchers employed MobileNetv2, a

lightweight convolutional neural network, to train and test the dataset, categorizing

tomatoes into three distinct categories based on their color features. Various

evaluation metrics, including accuracy, precision, sensitivity, and specificity, were

used to assess the effectiveness of the model. The results demonstrated that the

model was able to achieve high classification accuracy, suggesting its potential

for real-time applications. However, despite the high accuracy, the model's

specificity was relatively low, indicating some difficulty in identifying non-fresh

tomatoes. The researchers also highlighted the need for further comparisons with

other models, such as ShuffleNet, to improve the classification performance. This

approach provides a promising solution for local farmers, offering a low-cost and

efficient AI-based method to assess tomato freshness, ultimately reducing

postharvest losses and improving marketability.

Magabilin, Fajardo, and Medina (2023) local study explored the application

of Convolutional Neural Networks (CNN) in determining the maturity and quality

of Guyabano fruits, which are traditionally assessed through manual grading

methods that rely on human judgment of color and texture. This manual process

is not only time-consuming but also prone to inconsistencies and human error,

making it unreliable for large-scale or commercial operations. The research aimed

to provide an efficient, accurate, and non-destructive solution by utilizing deep

24
learning, particularly CNN techniques, to automate the classification and grading

of Guyabano fruits. By addressing the limitations of manual inspection, the study

sought to assist farmers and consumers in identifying the optimal harvest and

consumption time based on the external characteristics of the fruit. The

researchers implemented a MobileNetV2 architecture that was pre-trained using

the ImageNet dataset and replaced its top layer with a standard convolutional

layer tailored to the specific classification task. The system was trained and tested

using a dataset of Guyabano fruit images and evaluated based on classification

metrics such as accuracy and loss rate. The results demonstrated a high level of

accuracy in grading, suggesting that CNN-based methods can significantly

enhance the speed and reliability of fruit quality assessment. This study

contributes to the growing body of research advocating for the use of artificial

intelligence in agriculture, particularly in improving post-harvest handling and

reducing dependency on subjective human evaluations

Calinao, Go, Cabatuan et al. (2023) identification of edible wild plants plays

a crucial role in ensuring food security and nutrition, particularly in regions such

as the Philippines. This process, however, is often challenging, as mistakenly

consuming toxic plants can have fatal consequences. The development of an

accurate, reliable identification system is essential for the safety and sustainability

of foraging practices. With advancements in deep learning and computer vision

technologies, innovative systems for identifying edible wild plants are emerging,

contributing to outdoor education, survival training, and environmental

conservation. This study proposes the creation of a mobile platform that utilizes

25
deep Convolutional Neural Networks (CNNs) for the real-time identification of

edible wild plants in the Philippines. The system aims to be lightweight and

efficient, deployable on mobile devices for easy use in the field. The project

involves data collection, preprocessing, and augmentation to improve model

generalization. Using transfer learning, the CNN model is trained on large plant

image datasets, reducing training time and computational costs. Model

optimization for mobile devices will include techniques like compression and

quantization, ensuring high accuracy without compromising efficiency. The mobile

application will allow users to capture plant images and receive real-time feedback

on the species' edibility, nutritional value, and traditional uses. This tool will not

only enhance the understanding and appreciation of edible plants but also

emphasize their conservation for both human and ecosystem well-being.

Marcelo, Ilao, and Cordel II ( Detecting objects in a similarly colored

environment remains a significant challenge in the field of computer vision,

particularly in agricultural applications. Camouflage or color similarity between

objects and their surrounding environments complicates the task of detecting and

localizing fruits or vegetables for purposes such as yield estimation, harvest

planning, and market preparation. These challenges become even more evident

when the object, such as a fruit or vegetable, shares similar colors with the

environment, making it difficult for traditional object detection methods to

distinguish between them. Recent developments in computer vision, particularly

with the use of deep neural networks, have shown promise in improving fruit

detection and counting systems. However, issues such as occlusion (where

26
objects are partially covered), changes in lighting conditions, and the camouflage

effect still present significant barriers to reliable and accurate detection. While

early approaches focused on detecting fruits with high color contrast, which

allowed for more successful object detection with fewer samples, detecting

objects in scenarios involving high color similarity and occlusion remains a difficult

problem. This study investigates the use of region-based convolutional neural

networks (R-CNNs) to address this issue, particularly for detecting sweet peppers,

such as bell peppers and chili peppers, in environments where they blend with

their surroundings. The researchers developed specialized datasets for these

fruits, which were captured under real-world field conditions with varying levels of

illumination and occlusion. Their findings suggest that applying data augmentation

techniques and fine-tuning pre-trained deep learning models significantly

improved detection performance. The proposed system demonstrated its

potential by effectively detecting camouflaged fruits in complex agricultural

environments, thereby making significant strides in fruit detection for agricultural

applications. This work contributes to enhancing the capabilities of AI in

agriculture, where accurate and reliable fruit detection can lead to better planning

and resource management in farming practices.

Synthesis of the Study

The integration of Artificial Intelligence (AI) and Machine Learning (ML) in

agriculture has seen a significant transformation in the ways in which fresh

produce is classified, graded, and assessed for quality. This shift is not only

revolutionizing global agricultural practices but also directly impacts local contexts

27
such as in the Philippines. Studies by Ying et al. (2024) and Rashvand et al.

(2025) have underscored how AI technologies, including non-destructive methods

like hyperspectral imaging and machine vision, are enabling the prediction of shelf

life and improving the efficiency of agricultural supply chains. These technologies

allow for more accurate and adaptive predictions of freshness and shelf life,

helping to reduce food waste while optimizing storage conditions and promoting

sustainable agricultural practices. The ability of AI to process large datasets and

detect subtle patterns is a game-changer for the agricultural industry. It can offer

real-time solutions to the complex problems facing modern agriculture, such as

food spoilage, inefficient distribution, and excess food waste.

This global perspective on AI applications in agriculture is mirrored in the

local studies conducted in the Philippines, where AI is making significant strides

in improving agricultural practices. For example, Baldovino et al. (2020) focused

on improving the quality control of 'Carabao' mangoes by using convolutional

neural networks (CNNs) for automated sorting. The system eliminates the need

for manual sorting, which is time-consuming and often inconsistent, thereby

reducing human error and increasing sorting efficiency. Similarly, Nalupano et al.

(2024) employed a lightweight convolutional neural network, MobileNetV2, to

assess tomato freshness. This study highlights how AI-based solutions can

effectively support local farmers by reducing postharvest losses, improving the

quality of produce, and contributing to the overall sustainability of the agricultural

sector. Magabilin et al. (2023) also contributed to this growing body of research

by developing a CNN-based system for automating the grading of Guyabano

28
fruits. This system improves both the speed and accuracy of fruit grading, making

it possible to identify and classify fruits based on their maturity and quality. These

studies emphasize the growing potential of AI in transforming how produce is

managed and evaluated, and they align well with the objectives of the Smart

Scanner for Fruits and Vegetables Using Artificial Intelligence and Machine

Learning Techniques for Real-time Shelf Life Assessment.

Furthermore, AI's role in enhancing food classification, detection of

ripeness, and real-time shelf life predictions is further demonstrated in studies

such as those by Tapia et al. (2023) and Marcelo et al. (2023). Tapia’s research

on deep learning models for fruit and vegetable ripeness assessment highlights

the importance of accurate ripeness detection in reducing food waste and

ensuring the timely distribution of produce. Similarly, Marcelo’s study on Region-

based Convolutional Neural Networks (R-CNNs) addressed the challenge of

detecting fruits, such as sweet peppers, in environments where they might blend

in with their surroundings due to camouflage or color similarity. This study

demonstrates how deep learning technologies can be applied in complex, real-

world agricultural environments, improving detection accuracy even in challenging

conditions such as occlusion or variable lighting. These advancements in AI

technology are critical in the development of the Smart Scanner system, which

uses CNNs to assess the freshness and shelf life of fruits and vegetables based

on visual characteristics. The research by Tapia and Marcelo supports the idea

that AI can be leveraged not only for accurate shelf life predictions but also for

29
fruit detection in complex environments, ensuring that food waste is minimized

and that produce is used at its optimal freshness.

In conclusion, the integration of AI in agriculture, as demonstrated by both

global and local studies, provides valuable insights that directly inform the

development and potential impact of the Smart Scanner for Fruits and Vegetables

Using Artificial Intelligence and Machine Learning Techniques for Real-time Shelf-

Life Assessment. By harnessing the power of convolutional neural networks

(CNNs) to evaluate the visual properties of produce, the Smart Scanner aims to

solve the growing problem of food waste in Filipino households. Just as global

studies have shown the efficacy of AI in predicting shelf life, improving food

quality, and enhancing supply chain efficiency, local studies in the Philippines

demonstrate how AI-based solutions can directly address postharvest losses,

improve product grading, and support sustainable agricultural practices. The

Smart Scanner draws from these successes and aims to make a tangible

difference in food waste management by offering real-time assessments of

freshness, providing storage recommendations, and empowering consumers with

the knowledge and tools to extend the shelf life of their produce.

The system is particularly relevant in the Philippine context, where food

waste and improper handling of perishable goods are significant issues that

contribute to economic loss and environmental harm. By providing an easy-to-use

platform accessible via Android devices, the Smart Scanner ensures that users,

regardless of their technical expertise, can manage their produce better, reduce

food waste, and make more sustainable food choices. The integration of AI into

30
this application aligns with the broader goals of improving food security, promoting

healthier eating habits, and reducing the environmental footprint of food waste.

As the Smart Scanner continues to evolve, it holds the potential to expand its

capabilities, incorporating more produce types and enhancing its image

recognition algorithms to improve accuracy. This growth aligns with global trends

toward AI-powered solutions for sustainable agriculture and food management,

offering a promising path toward reducing food waste, increasing food security,

and fostering more sustainable consumption practices worldwide.

Technical Background

Smart Scanner for Fruits and Vegetables Using Artificial Intelligence and

Machine Learning Techniques focuses on the cutting-edge integration of AI and

deep learning technologies to combat the pressing issue of food waste in

households, particularly in the Philippines. The core of the system lies in the use

of Convolutional Neural Networks (CNNs), a type of deep learning model widely

known for its efficiency in image recognition tasks. CNNs are employed to process

and analyze visual data of fruits and vegetables, detecting key features such as

color, texture, and visible spoilage indicators like bruising, mold, or discoloration,

to assess the freshness of produce. By training on large datasets of labeled fruit

and vegetable images, the CNN model is able to learn intricate patterns and

relationships within the data that indicate a produce’s freshness, ripeness, or

impending spoilage, allowing for real-time predictions of the remaining shelf life of

items.

31
In order to make this technology widely accessible, the system is built on

a lightweight architecture, using MobileNetV2, which is specifically designed for

mobile and embedded devices. MobileNetV2 provides an efficient balance

between performance and computational resources, making it well-suited for

smartphones with limited processing power, which enables users to run the

system in real-time without the need for a high-end device. The app utilizes the

smartphone’s camera to capture images of fruits and vegetables, which are then

analyzed by the deep learning model. Based on this analysis, users are provided

with actionable insights, including freshness assessments and estimated shelf

life. In addition, the app also provides educational tips on proper storage

techniques to help users prolong the shelf life of their produce and reduce

unnecessary food waste.

Despite its promising capabilities, the system faces several limitations. For

one, the accuracy of freshness predictions heavily depends on the quality of the

images captured by the user. Factors such as lighting conditions, camera

resolution, and the user’s handling of the device can all affect the quality of the

input image, thereby impacting the performance of the model. Furthermore, the

system is initially designed to assess only five common fruits and vegetables in

the Philippines, focusing on local produce that exhibits clear visual indicators of

spoilage. The app does not yet cater to less common or exotic fruits, nor does it

assess internal damage that might not be visible on the surface. These limitations

highlight the need for continuous improvement in the underlying image recognition

32
technology and the expansion of the dataset to include a broader variety of

produce.

The potential for the Smart Scanner to evolve is substantial. As AI

technologies continue to advance, future versions of the app could incorporate

more sophisticated models and a broader range of fruits and vegetables.

Furthermore, with improvements in image recognition techniques and the

inclusion of additional data sources, such as temperature or humidity sensors, the

system could provide even more accurate predictions, leading to a more effective

tool in managing food waste. Ultimately, this project represents a significant leap

toward harnessing AI for practical, everyday applications, offering a solution that

not only reduces food waste but also contributes to promoting more sustainable

consumption patterns, especially in households that are already facing challenges

in managing their food resources effectively.

Technicality of the Project

Smart Scanner for Fruits and Vegetables Using Artificial Intelligence and

Machine Learning Techniques for Real-Time Shelf Life Assessment revolves

around the sophisticated integration of various technologies, including deep

learning models, mobile application development, and image processing

techniques, all designed to deliver real-time freshness assessments of produce.

The core of the system is built upon the use of Convolutional Neural Networks

(CNNs), which are a class of deep learning models particularly effective at

processing visual data. These models are trained to recognize specific features

33
of fruits and vegetables, such as color, texture, and signs of spoilage (e.g.,

bruising, mold, or discoloration). CNNs are capable of learning hierarchical

patterns from large datasets, making them highly effective for tasks like image

classification and regression, which are central to determining the freshness and

remaining shelf life of produce.

The system leverages a pre-trained MobileNetV2 architecture, which is a

lightweight CNN model optimized for mobile devices. MobileNetV2 offers a good

trade-off between computational efficiency and model accuracy, which is crucial

for ensuring that the system can run on smartphones with limited processing

power and memory. This model is fine-tuned using a custom dataset that includes

a variety of fruits and vegetables commonly found in Philippine markets, with each

image labeled based on freshness categories. The fine-tuning process allows the

model to adapt to the specific characteristics of local produce, ensuring that it

provides accurate and reliable predictions of shelf life based on visual indicators.

For real-time application, the system utilizes the camera of a mobile device to

capture images of fruits and vegetables, which are then processed by the deep

learning model. The captured image is passed through the trained CNN model,

which then outputs a prediction regarding the freshness of the item and estimates

its remaining shelf life. This analysis is fast and can be performed directly on the

user's device, eliminating the need for an internet connection or external

computing resources. The system's user interface is designed to be simple and

intuitive, allowing users to easily navigate the app, capture images, and receive

feedback about the freshness of their produce.

34
Additionally, the Smart Scanner provides educational content and storage

tips based on the results of the freshness analysis. This functionality is integrated

into the mobile application, which serves as a one-stop platform for both

assessing food quality and promoting better food management practices. The app

suggests appropriate storage methods for different types of produce, which helps

users extend the shelf life of their items and reduce food waste. This feature is

particularly important for educating consumers about proper food handling

techniques, which is a key factor in minimizing waste in households.

Despite the system’s promising capabilities, there are some technical

limitations to consider. The accuracy of the freshness prediction is highly

dependent on the quality of the input images, which can be influenced by factors

such as lighting conditions, camera resolution, and the handling of the device.

The current model is designed to work with only five common fruits and five

vegetables, which limits the scope of the application in its initial phase. Moreover,

the system is designed to assess visible signs of spoilage, and does not account

for internal damage or deterioration that may not be visible on the surface of the

produce. These technical limitations highlight the need for ongoing research and

improvements to the underlying technology, such as enhancing image recognition

capabilities and expanding the system to accommodate a broader variety of

produce.

In conclusion, the technicality of the Smart Scanner for Fruits and

Vegetables integrates cutting-edge AI and machine learning technologies to

deliver real-time, user-friendly solutions for food waste reduction. The

35
combination of CNNs for image analysis, the lightweight architecture of

MobileNetV2 for mobile device compatibility, and the mobile app interface for

educational purposes make this project a promising tool for sustainable food

management. With ongoing advancements in AI, the system has the potential to

evolve and expand, offering a more comprehensive solution to food waste issues

on a global scale.

36
CHAPTER III

METHODOLOGY RESULT AND DISCUSSION

This chapter deals with methods used by the researcher in conducting the

capstone project. The researchers design, developed, tested, deployed, and

trained users on the system.

Methodology

Figure 3.1 Software Development Life Cycle (SDLC) – RAD Agile

Rapid application development is a software industry approach that helped

the developer build and validate high-quality software through multiple testing

cycles. The Rapid Application Development (RAD) system focuses on building

37
software quality which surpasses all requirements of candidates, judges and

event organizers. The RAD process. The organization's process through data

collection and system observation occurred during the Analysis & Quick Design

phase for immediate analysis and system design. The prototype cycle runs during

system development time. Due to testing system functionality after development

it ensures operational correctness of the system followed by implementation when

researchers deliver software development with system demonstration and user

training and system evaluation.

38
Input and Output Reports and Analysis

This section represents the input-process-output (IPO) diagram of the

system’s registration and algorithm.

Figure 3.2 IPO-User Registration

Figure 3.3 IPO-Search and Image Algorithm

39
Conceptual Design

The Smart Scanner for Fruits and Vegetables is an advanced web-based

platform designed to provide real-time shelf-life assessment using AI-powered

image recognition. This system enables users to upload images of fruits and

vegetables, which are then analyzed by a PyTorch-based AI model to determine

their freshness status and estimated expiration date. The platform streamlines

the process by integrating automated image analysis, confidence scoring, and

database logging, ensuring accurate tracking of produce conditions. By

leveraging machine learning techniques, the system not only enhances

consumer awareness of food quality but also contributes to reducing food waste

by offering real-time insights and storage recommendations for optimal

freshness.

Figure 3.4 Conceptual Design Diagram

40
System Architecture

Figure 3.5 System Architecture

41
Cost Benefit Analysis

This section contains all listed material and its detailed descriptions. The

current materials listed in this section are used during the development of the

application.

Devise Used

• Laptop

• Internet Router

Software Specification

Operation System

• Windows 11

Programming Language

• Python

Development Tools

• Processor:

• Ram: 16.0 GB

• GPU: RTX 3050 4.0 GB

42
Modem/Router

• Network Type: LAN and WLAN

• Connection: Fiber 2.4 and 5Ghz

• Speed: 100mbps

Camera

• Resolution HD 1080p

Requirement Analysis

This section shows the minimum and recommendation specification of

hardware and software requirements for users who to use the application

User Requirements

I. Software Requirements

Browser Minimum Version

Chrome Chrome 66

Microsoft Edge Microsoft Edge 79

Mozilla Firefox Mozilla Firefox

Firefox Firefox 61

Safari Safari

Table 3.1 Software Requirements for User

43
II. Hardware Requirements

Component Minimum Requirement

CPU Quad-Core Processors

RAM 4 GB RAM

Table 3.2 Hardware Requirements

Cost Benefits Analysis

The following are estimated costs for developing the software and creating

the manuscript. To help the proponents monitor and manage budgets for the

software, hardware, and utility expenditures associated with developing the

application, this part displays the entire project cost.

Hardware Cost

Item Specification Quantity Unit Price monthly Pro


rate cost
Laptop Acer Nitro V 1 ₱ 50,999 ₱ 1,699

Desktop Desktop 1 ₱ 15,000 ₱ 500

- -

Table 3.3 Hardware Cost

Source:

44
Operational Cost

Items Specification Annual Cost

- - -

- - -

Table 3.4 Operational Cost

Source:

Summarized Cost

Table 3.5 Summarized Cost

45
System Flow

This section will present the basic flow of the system’s processes using
flowchart and visually through a step-by-step screen grab of website.

Figure 3.6 User’s Flowchart

46
Hierarchy

Figure 3.7 Hierarchical

47
Block Diagram

Figure 3.8 Block Diagram

48
Development and Testing

The Smart Scanner for Fruits and Vegetables is being developed using a

technology stack that includes PyTorch for AI and machine learning, Streamlit for

the frontend, and a database system to store produce logs and user interactions.

This combination allows for an intuitive, AI-driven platform capable of assessing

the shelf life of fruits and vegetables in real-time. Development takes place in

Python, leveraging computer vision and convolutional neural networks (CNNs) to

analyze images. The system is designed for accessibility, ensuring that users can

easily upload images and receive immediate feedback on produce freshness.

The architecture follows a modular design, separating key components

such as image processing, AI-based predictions, and database management.

This ensures scalability and maintainability. User uploads are processed through

the AI model, which predicts the freshness status and estimated expiration date

of the produce. The results are stored in a database, allowing users to track their

produce over time.

During implementation, models are created for users, image uploads, AI

predictions, and produce logs. The frontend is developed using Streamlit,

providing an interactive and user-friendly interface. The backend handles image

processing, AI analysis, and database interactions. The AI model is trained using

PyTorch, ensuring high accuracy in predicting produce shelf life.

Testing involves unit tests for individual system components, integration

tests to verify seamless communication between modules, and user acceptance

testing (UAT) with IT students and teachers at AMACC Santiago City Branch.

49
Performance testing ensures real-time processing, and security measures are

implemented to protect user data. The system is continuously refined based on

feedback and test results before deployment.

To ensure the system functions correctly and efficiently, multiple levels of

testing are implemented:

1. Unit Testing: Individual components such as AI models, database

queries, and image processing functions are tested separately to ensure

they perform as expected.

2. Integration Testing: Verifies the seamless interaction between the AI

model, database, and frontend components to ensure smooth data flow.

3. User Interface (UI) Testing: Ensures that the Streamlit frontend is

responsive, user-friendly, and correctly displays freshness predictions and

produce logs.

4. Image Recognition Testing: Evaluates the accuracy of the AI model in

detecting and classifying fruits and vegetables, as well as predicting shelf

life based on visual features.

5. Security Testing: Assesses vulnerabilities in user authentication, data

storage, and API communications to prevent unauthorized access and

data breaches.

50
6. User Acceptance Testing (UAT): Conducted with IT students and

teachers at AMACC Santiago City Branch to ensure the system meets user

expectations and practical usability.

7. Regression Testing: Ensures that any updates or modifications do not

negatively impact existing functionalities, maintaining the stability of the

application.

Description of the Prototype

The prototype for the Smart Scanner for Fruits and Vegetables is a

functional and interactive representation of the AI-powered shelf life assessment

system. This prototype serves as a preliminary version of the final product,

offering a hands-on experience of its core functionalities, including real-time

image analysis, freshness detection, and expiration prediction. Designed to

showcase the key features, user interactions, and overall interface, the prototype

acts as a visual model that allows stakeholders to explore its capabilities and

provide valuable feedback.

With an intuitive Streamlit-based interface, users can easily upload images

of fruits and vegetables, triggering the PyTorch-powered AI model to analyze

freshness levels. The prototype demonstrates essential system components such

as image recognition, produce logging, and storage recommendations, ensuring

a seamless and informative experience. Through this prototype, the foundation

for an intelligent food management system is laid, aimed at minimizing food waste

and optimizing consumer awareness of produce shelf life.

51
Implementation Plan

1. Planning and Requirements Analysis: The project begins with defining the

scope, objectives, and key functionalities such as image recognition,

freshness prediction, and produce logging. The technology stack is selected,

including PyTorch for AI model development, Streamlit for the frontend, and

PostgreSQL or Firebase for database management. A feasibility study is

conducted to assess the system’s viability.

2. System and AI Model Development: A Convolutional Neural Network (CNN)

is trained in PyTorch using a dataset of fruits and vegetables with different

freshness levels. The model is optimized for high accuracy. The backend is

developed to handle image processing and database storage, while the

frontend integrates a Streamlit-based interface for real-time analysis.

3. Integration and Testing: The system undergoes a series of rigorous testing

processes to ensure its functionality, efficiency, and security. Unit testing is

performed to verify that each individual component, such as the AI model,

database, and user interface, operates correctly. Integration testing follows,

ensuring smooth interaction between different system components, including

frontend-backend communication and database interactions. User interface

(UI) testing evaluates the system’s usability, responsiveness, and accessibility

across different devices and screen sizes. Image recognition testing focuses

on the AI model’s ability to accurately classify produce freshness, ensuring

high precision and reliability. Security testing is implemented to safeguard user

data, covering aspects such as encryption, authentication, and access control.

52
Finally, user acceptance testing (UAT) is conducted with IT students and

teachers at AMACC Santiago City Branch, ensuring the system meets user

expectations and functions as intended in real-world scenarios. Regression

testing is performed after any updates to confirm that new changes do not

negatively impact existing features.

4. Bug Fixes and Refinement: Any issues discovered during testing are

documented and resolved. AI model performance is fine-tuned to improve

prediction accuracy. The user interface is enhanced based on feedback,

ensuring a seamless and efficient experience. Performance optimization is

also carried out for faster processing and real-time analysis.

5. Documentation: Comprehensive documentation is prepared to ensure future

maintainability and usability of the system. User manuals provide step-by-step

guides to assist end-users in navigating the system effectively, covering

features such as image scanning, produce logging, and shelf-life tracking.

Technical documentation includes in-depth details on system architecture,

database schema, API endpoints, and AI model configurations, serving as a

reference for developers. Additionally, testing reports compile the results of all

testing phases, highlighting identified issues, resolutions, and overall system

performance. Proper documentation ensures that the system can be easily

maintained, improved, and expanded in the future.

6. Deployment and Launch: The system is deployed on a cloud platform (AWS,

Heroku, or Google Cloud) to ensure accessibility and scalability. The AI model

is optimized for real-time inference, and monitoring tools are implemented for

53
performance tracking. A soft launch is conducted to gather final feedback

before full deployment.

7. Post-Launch Support: After deployment, ongoing maintenance and support

are provided to fix any unforeseen issues. User feedback is continuously

gathered for future updates. New features, such as IoT integration, expanded

AI capabilities, and mobile compatibility, are planned for future enhancements.

Regular performance reviews and security updates are conducted to keep the

system efficient and secure.

Algorithm Use

The Smart Scanner for Fruits and Vegetables utilizes a Convolutional

Neural Network (CNN) for image recognition and freshness assessment. This AI-

driven system processes images by first applying image preprocessing

techniques, including resizing, normalization, and augmentation, to enhance

model accuracy. The CNN architecture extracts important features such as

textures, colors, and patterns from the input image through convolutional and

pooling layers. Using a softmax activation function, the model then classifies the

produce into categories like Fresh, Near Expiry, or Expired, assigning a

confidence score to indicate prediction certainty. Additionally, the system

incorporates a regression-based prediction model to estimate the remaining shelf

life based on historical data. All results, including freshness status and expiration

estimates, are stored in a database, allowing users to track their scanned items.

Real-time feedback is provided on-screen, and a notification system alerts users

when items are nearing expiration. By leveraging CNNs, the Smart Scanner

54
achieves high accuracy in identifying perishable goods, ultimately helping to

reduce food waste and promote better storage practices.

Figure 3.8 Algorithm Use

55

You might also like