Thesis
Thesis
Computer Vision
by
Mbah Mohamed Omar 147
Moussa Coul
ETete 140
June 2024
Smart Agricultural robot based on computer
vision
Approved by:
——————————————–
Dr. GOLAM SAROWAR
Supervisor and [Associate/Assistant] Professor,
Department of Electrical and Electronic Engineering,
Islamic University of Technology (IUT),
Boardbazar, Gazipur-1704.
Date: . . . . . .
Contents
List of Tables 3
List of Figures 4
List of Acronyms 5
1 Introduction 6
1.0.1 BASIC FUNCTIONALITIES OF AGRICULTURAL HARVESTING ROBOT 6
1.0.2 DIFFERENT ASPECTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.0.3 BACKGROUND AND MOTIVATION . . . . . . . . . . . . . . . . . . . . . . 10
2 Overview 12
2.0.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.0.2 Topic Relevance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.0.3 Research Needs and Gaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.0.4 Disguise and Acquisition Methodologies . . . . . . . . . . . . . . . . . . . . . 14
2.0.5 Autonomy and Decision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.0.6 Integration of Farm Management Systems . . . . . . . . . . . . . . . . . . . 14
2.0.7 Energy efficiency and sustainability . . . . . . . . . . . . . . . . . . . . . . . 14
2.0.8 Economic and Social Implications . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Methodology 16
3.1 The requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.1 Research and Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.2 Requirement Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Design and Hardware Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.1 System Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.2 Integration of Hardware and Software . . . . . . . . . . . . . . . . . . . . . . 20
3.3 Hardware Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.1 Power Supply: 12V Battery of 3300mAh . . . . . . . . . . . . . . . . . . . . . 21
3.3.2 Motor Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3.3 Power Management System . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3.4 ESP32 Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.5 Pan-Tilt Mechanism with SG90 Servo Motors for ESP32-CAM . . . . . . . . 22
3.3.6 Ultrasonic Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3.7 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1
3.4 Software and Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4.1 YOLO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4.2 Example of Online and Real-Time Tracking with Convolutional Neural Net-
works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.4.3 Example : Fruit Detection Using YOLO . . . . . . . . . . . . . . . . . . . . 28
3.4.4 Fruit Counting in Real-Time using an Object Tracking Algorithm and YOLO 29
5 Conclusion 34
5.1 here we go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2
List of Tables
3.1 Model performance evaluation with Raw dataset under 416×416 pixels’ resolution. . 31
3.2 Model performance evaluation with 0.5 dataset under 416×416 pixels’ resolution. . . 32
3.3 Model performance evaluation with 0.25 dataset under 416×416 pixels’ resolution. . 32
6.1 Summary of different types of harvesting robots and their key features. . . . . . . . . 36
6.2 Summary of different types of harvesting robots and their key features. . . . . . . . . 38
6.3 Table summarizing COs, POs, and Explanation/Justification for agricultural har-
vesting robots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.4 Table summarizing the Knowledge Profile (Attribute) for the engineering discipline. 41
6.5 Table summarizing the Explanation/Justification for each Knowledge Profile (K) in
the context of Smart Agricultural Harvesting Robots. . . . . . . . . . . . . . . . . . 42
6.6 Table summarizing the Range of Complex Engineering Problem Solving and corre-
sponding attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.7 Table summarizing the Explanation/Justification for each P attribute in the context
of developing agricultural harvesting robots. . . . . . . . . . . . . . . . . . . . . . . . 44
6.8 Table summarizing the Range of Complex Engineering Activities and corresponding
attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.9 Table summarizing the Explanation/Justification for each A attribute in the context
of developing agricultural harvesting robots. . . . . . . . . . . . . . . . . . . . . . . . 46
3
List of Figures
3.1 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2 Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Robot Arm Modeling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4 ESP 32 PINOUT(source: last minute engineer.com) . . . . . . . . . . . . . . . . . . 22
3.5 Fusion 360 CAD model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.6 Fusion 360 model 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.7 Assembled robot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.8 Assembled robot with With navigation capabilities and image processing . . . . . . . 26
3.9 (Top) General workflow of YOLO ; (Bottom) YOLO Architecture.s. . . . . . . . . . 27
3.10 The architecture of Deep SORT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.11 YOLOv2 architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.12 YOLO-fruits model flowchart for dataset, training and detection process. . . . . . . 30
4
List of Acronyms
CV Computer Vision
IUT Islamic University of Technology
YOLO You Only Look Once
CNN Convolutional Nural Network
PWM Pulse Width Modulation
CPU Central Processing Unit
5
Chapter 1
Introduction
6
agricultural technology. These robots essential features can be combined into several connected
parts.
Vision Systems:
Harvesting robots rely on modern vision systems that use a variety of sensors such as RGB cameras,
multispectral cameras, LiDAR, and depth cameras to perform well. These sensors, when paired
with sophisticated image processing techniques and machine learning algorithms, allow robots to
properly detect and localize fruits in a variety of demanding settings.
Feature extraction and AI integration:
The visual systems extract critical properties such as color, texture, and shape to distinguish
between ripe and unripe fruit. AI and machine learning, particularly neural networks, improve
detection accuracy by responding to changing lighting and occlusions, increasing overall harvesting
efficiency.
Motion Delivery Systems:
Robots can travel fields and orchards with the use of effective mobility devices, including wheeled
or tracked bases. Robust motion planning algorithms guarantee accurate positioning, allowing the
robot to access and retrieve fruits situated in different parts of the surroundings.
Manipulation and Control:
The real harvesting process depends on robotic grippers and arms that are managed by accurate
motion delivery systems. Sophisticated control algorithms and feedback mechanisms are necessary
for these devices to perform the delicate operation of harvesting fruits without causing damage.
7
End-Effectors:
The end-effector, which consists of harvesting tools and grippers, needs to be thoughtfully made
in order to grasp and separate fruits without hurting them. Various end-effector types—such as
vacuum-based or soft grippers—are employed based on the fruit variety and plant structure. It’s
important to make sure that removing the fruit from the plant with as little damage as possible
is done. To do this, there must be a harmonious design between the control systems and the
end-effectors.
Environmental Adaptability:
Harvesting robots need to be able to function well in a variety of environmental settings, including
sun and shade. The robots can continue to operate effectively and adjust to these changes because
of their powerful vision and control systems.
Obstacle Avoidance:
To ensure smooth operation and prevent harm to the robot and the plants, effective obstacle
recognition and avoidance systems are required in the presence of barriers such as leaves, branches,
and support structures.
Artificial Intelligence and Machine Learning:
Artificial intelligence (AI) and machine learning algorithms greatly increase the robot’s capacity to
precisely identify and categorize fruits. Additionally, these technologies improve decision-making
by enabling the robot to modify and optimize its behaviors in response to real-time inputs. During
the harvesting process, fast and effective decision-making is made possible by the integration of
edge computing technologies and high-performance processors.
Hardware and Software Integration:
The harvesting robot’s general architecture comprises the integration of advanced software systems
(control algorithms, data processing frameworks) with a variety of hardware components (sensors,
actuators, and processors). The smooth operation and coordination of many subsystems are guar-
anteed by effective integration. Advanced communication technologies, such as wireless connection
and the Internet of Things (IoT), provide effective data interchange and control commands, guar-
anteeing the harmonious operation of the robot’s systems.
Economic and Practical Considerations:
Cost-Effectiveness and Deployment: Using creative ideas and materials is one way to try to keep
development and deployment costs as low as possible. Maintaining excellent performance under
real-world settings, ease of use, and reliability are necessary for practical deployment in commercial
orchards.
Effects on Farming:
Harvesting robots have the potential to greatly boost labor productivity, lessen the need for seasonal
labor, and enhance overall agricultural efficiency. Maximizing resource utilization and reducing
waste, helps sustainable farming methods and solves the labor crisis.
8
Figure 1.2: Various types of harvesting robots, including those for plums, apples, sweet peppers,
strawberries, litchis, tomatoes, and kiwifruits. Photos reprinted with permission from respective
sources.
Several cutting-edge technologies come together to form harvesting robots, and each one is essen-
tial to enable accurate and productive agricultural operations. Robust motion delivery mechanisms,
finely built end-effectors, advanced AI and machine learning, and sophisticated vision systems are
all integrated into these robots, which provide a practical answer to the labor shortages and re-
source optimization issues facing the agriculture sector. To overcome current obstacles and fully
achieve the promise of harvesting robots in enhancing agricultural productivity and sustainability,
more research and development are necessary.
9
1.0.3 BACKGROUND AND MOTIVATION
BACKGROUND
In an effort to alleviate labor shortages and improve fruit picking efficiency, harvesting robots are
a noteworthy development in agricultural technology. Usually installed on movable platforms, these
robotic systems are outfitted with manipulators and end-effectors and employ advanced machine
vision techniques to precisely choose ripe fruits. This technique, called ”selective harvesting,”
combines the effectiveness of machinery with the pickers’ customary selectivity (Bac et al., 2014b).
Robotic systems have drawn growing attention from academia and industry as the possibility that
they could completely replace human labor grows (Sanders, 2005).
Robotic fruit picking has been an area of research and development since the late 1960s. Practical
implementation in commercial orchards is still limited despite decades of research and development
because of a number of important obstacles. These robots’ relatively sluggish harvesting speeds
and high production costs are the main challenges. The robots’ capacity to recognize and choose
ripe fruits is mostly dependent on machine vision systems, which are frequently inadequate. These
methods are not very good at identifying fruits that are darkened, hidden by branches and leaves,
or green against a green background. They can even mistakenly classify yellow leaves as fruits on
occasion (Bac et al., 2014b).
Recent advancements in robotics and artificial intelligence (AI) are making it possible to create
more effective harvesting machines. The goal of developing modern AI-powered machine vision
systems is to improve fruit identification and selection accuracy. To overcome the limitations of
current machine vision technologies, a key focus is on neural network models trained to distinguish
various fruit features. However, despite these advancements, the technology isn’t yet advanced
enough for widespread commercial application. To match the productivity of human labor, these
robots need to increase in both speed and accuracy. In agriculture, there are numerous potential
benefits of robotic harvesting. It’s still one of the most labor-intensive industries in agriculture,
with only 15% of the work automated and a significant portion done by hand during harvesting.
Because of urbanization, it is now harder to get seasonal labor, which has led to a scarcity of crops
and highlighted the urgent need for automated solutions (FAO, 1976).
Increased yield, a solution to the agricultural shortage, and a significant reduction in labor costs
are all possible with robotic harvesting. Incorporating these robots into existing cultivation systems
could further boost their efficiency, making them a viable and practical solution for agricultural
harvests in the future.
MOTIVATION
A combination of economic, labor market, and technological factors drives the motivation for de-
veloping and deploying harvesting robots.
Labor Shortages:
Horticulture is one of agriculture’s most labor-intensive businesses. The availability of labor for fruit
picking has been dropping due to urbanization and a decrease in the number of seasonal laborers
willing to perform such physically demanding chores (FAO, 1976). This labor scarcity has resulted
in crop shortages and higher production costs, necessitating an urgent need for automated solutions
10
that can consistently substitute human work.
Cost Reduction:
Labor expenses make up a considerable component of total production costs in fruit harvesting,
accounting for up to 40% of the overall value of the crop (Bac et al., 2014b). Farmers may drastically
cut labor expenses by automating the harvesting process, which improves overall profitability and
makes the agricultural industry more sustainable in the long run.
Increased Efficiency and Productivity:
Unlike human workers, harvesting robots can operate continuously without the need for breaks
or rest, leading to a substantial increase in productivity. These robots can work day and night,
maximizing the harvesting window and ensuring that fruits are picked at their optimal ripeness,
thereby reducing waste and improving yield (Shewfelt et al., 2014).
Precision and Quality:
Modern harvesting robots are being developed with advanced AI and machine vision systems that
can accurately assess fruit ripeness, size, and other quality parameters. This precision ensures
that only the best-quality fruits are harvested, maintaining high standards of produce quality and
enhancing market acceptance (Bac et al., 2014b). Such selective harvesting also reduces the risk of
damaging unripe fruits, which can continue to mature for future harvests.
Technological Advancements:
Rapid advancements in AI and robotics are driving improvements in the capabilities of harvesting
robots. Contemporary neural network models and enhanced machine vision systems are being
trained to better recognize and differentiate fruits from their surroundings, addressing some of the
limitations of earlier prototypes. These advancements are gradually making harvesting robots more
reliable and cost-effective, bringing them closer to widespread commercial deployment (Bac et al.,
2014b).
Sustainability and Environmental Impact:
Automating the harvesting process can also contribute to more sustainable agricultural practices.
Robots can be programmed to follow optimized paths and employ precise picking techniques that
minimize damage to plants and the environment. This precision agriculture approach helps in
maintaining the health of orchards and reducing the ecological footprint of farming operations.
11
Chapter 2
Overview
2.0.1 INTRODUCTION
The desire to boost productivity, cut labor costs, and maximize resource utilization is causing a
major upheaval in the agriculture sector. The development of harvesting robots is one of the most
promising advances in this industry. The purpose of these robots is to automate the process of
selecting fruit, which provides a solution to the labor shortage and growing expenses related to
manual harvesting. An intricate combination of hardware and software components make up a
harvesting robot’s architecture, and each one is essential to the machine’s successful and efficient
operation.
A power supply and power management system are among the hardware parts of the harvesting
robot that guarantee a steady and dependable power source for the robot’s operations. The ESP32
module, a potent microcontroller that directs the robot’s movements, is essential to its operation.
The servo motors that control the exact movements of the robot arm assembly, ultrasonic sensors
for obstacle detection, and the ESP32-CAM for image capture all work in tandem with this.
On the software side, powerful tools like Fusion 360, MATLAB Simulink, and Simscape are
used to design and simulate the robot’s physical and dynamic behavior. Fusion 360 helps to
create comprehensive CAD models of the robot structure, whereas Simulink and Simscape allow
for modeling and optimization of the robot arm’s movements. The software suite also contains
advanced image processing and object detection capabilities based on the YOLO v3 model, which
enables the robot to precisely recognize and locate ripe fruits for harvesting.
12
resource management and promotes sustainable farming methods, by incorporating intelligent agri-
cultural robots into their operations.
Addressing the SDGs, or Sustainable Development Goals
Several UN Sustainable Development Goals (SDGs) are directly impacted by intelligent agricultural
robots which are : Goal 2, Zero Hunger: Harvesting robots can help satisfy the world’s growing
food demand without adding more agricultural land, which will increase food security by raising
agricultural productivity and efficiency; Goal 8 (Decent Work and Economic Growth): By lower-
ing physical strain and dangerous surroundings, automation of labor-intensive jobs like harvesting
can enhance working conditions for farmers (UN, 2022); Goal 12 (Responsible Consumption and
Production): Smart agricultural robots reduce waste and maximize resource utilization to sup-
port sustainable production methods, which lessens the environmental impact of agriculture (FAO,
2021).
Technological Progress and Research Areas of Interest
Research on intelligent agricultural robots is moving quickly forward, with the goal of improving
the robots’ capacities for a range of agricultural duties. For example, Saeys et al. (2020) discuss
developments in robotics for fruit harvesting, focusing on the creation of multiple-degree-of-freedom
robotic arms and advanced sensor technologies for precise fruit handling and detection.
Issues Handled in the Agriculture Sector
Several issues that the agriculture industry faces are addressed by intelligent agricultural robots such
as ,Labor Scarcity: Automation lessens the need for seasonal labor, which is frequently expensive
and in short supply, especially during the busiest harvesting seasons (Valente et al., 2020); Climate
Variability: Robots with sensors and AI algorithms built in can function in a range of weather
scenarios, guaranteeing steady output and lowering crop hazards associated with weather (FAO,
2021).
Case Study: Application in Fruit Harvesting
Because fruit harvesting requires careful handling and exact timing, there are unique obstacles
involved. In order to carefully choose and harvest ripe fruits without harming them, robotic arms,
machine learning algorithms, and vision systems are all used in fruit harvesting robots, such those
created by Swarztrauber et al. (2019). This increases crop quality and marketability overall.
13
essential for efficient navigation and harvesting. It is imperative to enhance SLAM (Simultaneous
Localization and Mapping) algorithms specifically designed for agricultural environments.
14
dures, and scalable solutions is required. Labor Dynamics: It is critical to understand how robotic
harvesting affects farm labor dynamics, such as job displacement and the possibility of new types
of employment. Research on how to best incorporate robots into the present workforce can aid in
mitigating harmful social consequences. Barriers to adoption: Identifying and addressing adoption
challenges, such as technological complexity, farmer training, and aversion to change, is critical to
the widespread use of harvesting robots.
ai
15
Chapter 3
Methodology
This chapter describes the full process used in the development of a smart agricultural robot. The
process includes requirement collection via research and analysis, rigorous design, implementation,
testing and validation, and meticulous documenting and reporting. Each phase is critical to the
harvesting robot’s successful design and deployment.
16
3.1.2 Requirement Analysis
According on the findings, particular needs for the harvesting robot are identified. This includes:
Specifying the types of fruits to be picked and their unique features (e.g., size, shape, and delicacy).
Identifying the environmental conditions in which the robot will operate (for example, temperature,
humidity, terrain). Establishing the robot’s technical characteristics, such as precision, speed, and
battery life. Identifying the components required for both hardware (motors, sensors, CPUs) and
software (control algorithms, user interfaces).
17
Figure 3.2: Architecture.
Hardware Components
Power Supply and Power Management System: The power supply is the source of energy for
the entire robot. It typically consists of rechargeable batteries that can provide sufficient power to
operate all the electronic and mechanical components of the robot for an extended period. Power
Management System: This system is responsible for distributing power from the supply to various
parts of the robot. It ensures that each component receives the correct voltage and current, prevents
power surges, and manages battery life to optimize performance and longevity.
ESP32 Module: The ESP32 is a versatile microcontroller with built-in Wi-Fi and Bluetooth
capabilities. It acts as the brain of the robot, coordinating the actions of various sensors and
actuators. It processes input from the camera, ultrasonic sensor, and other inputs, and executes
the necessary control commands.
ESP32-CAM: The ESP32-CAM is a camera module integrated with the ESP32 micro-controller.
It captures high-resolution images and streams video, which are crucial for real-time image pro-
cessing and object detection. This module is compact, low-cost, and capable of capturing detailed
visual information.
Ultrasonic Sensor: This sensor is used for measuring distances to obstacles in the robot’s
18
path. It emits ultrasonic waves and measures the time it takes for the echoes to return, thus
calculating the distance to objects. This helps the robot navigate through the orchard without
colliding with trees, fruits, or other obstacles.
Servo Motors: Servo motors are precise actuators that control the movement of the robot’s
arm and end-effectors. Each joint of the robot arm is driven by a servo motor, allowing for controlled
and precise movements. The servo motors ensure that the robot can reach the desired position and
angle to harvest the fruits without causing damage.
Robot Arm Assembly: The robot arm consists of multiple segments connected by joints.
These segments are typically made from lightweight and durable materials such as aluminum or
carbon fiber. The design of the robot arm allows for a wide range of motion, enabling the robot
to reach fruits at various heights and angles. The end-effector, attached to the arm, is designed to
gently grasp and pick the fruits.
Software Components
CAD Modeling:
Fusion 360: This software is used for designing and simulating the physical structure of the
robot. It allows engineers to create detailed 3D models of the robot arm, sensor placements, and
overall assembly. Simulation features help in testing the design virtually to identify any issues
before physical manufacturing.
Robot Arm Modeling, MATLAB Simulink and Simscape:
These tools are used to model the dynamic behavior of the robot arm. Simulink provides a graph-
19
ical environment for simulating the control algorithms, while Simscape allows for the modeling of
physical systems such as motors and mechanical linkages. This combination helps in optimizing the
arm’s performance and ensuring precise control over its movements.
Image Processing and Object Detection,YOLO v3 : YOLO v3 is an advanced object detec-
tion algorithm that processes images in real-time. It can detect and localize multiple objects within
a single frame with high accuracy. YOLO v3 is used to identify ripe fruits in the images captured
by the ESP32-CAM. The algorithm provides the coordinates of the detected fruits, which are used
by the robot’s control system to position the arm for harvesting.
20
3.3.1 Power Supply: 12V Battery of 3300mAh
The harvesting robot’s major power source is a 12V, 3300mAh rechargeable battery. This battery
supplies enough voltage and current to power the robot’s motors, sensors, and other electronic
components.
-Voltage and Capacity: The 12V rating provides enough power to run a variety of motors and
electronic components, while the 3300mAh capacity strikes a balance between operating duration
and battery size.
-Rechargeability: Using a rechargeable battery lowers operating expenses and reduces envi-
ronmental impact. The battery may be recharged with a compatible charging circuit, allowing the
robot to be deployed several times with minimal downtime.
-Battery Management System (BMS): A BMS is provided to prevent the battery from
overcharging and deep discharge. It monitors the battery’s state and assures safe operation.
21
3.3.4 ESP32 Module
The ESP32 module is the core processor unit, handling all control and communication operations.
It is a powerful microcontroller with Wi-Fi and Bluetooth support, making it suitable for a wide
range of applications.
-Processing Power: The ESP32, which has a dual-core CPU and a variety of peripherals, can
perform complicated tasks including image processing, sensor data analysis, and motor control.
-Connectivity: The built-in Wi-Fi and Bluetooth provide remote monitoring, control, and
data transmission, allowing for real-time updates and modifications. -Programming: The ESP32
may be programmed using either the Arduino IDE or the ESP-IDF framework, which allows for
the development and deployment of bespoke algorithms and control logic.
-Pin Configuration: The ESP32 includes several GPIO pins for connecting to sensors, motors,
and other peripherals. Careful planning of pin assignments is required to eliminate conflicts and
assure dependable functioning.
22
-ESP32-CAM Integration: The ESP32-CAM module is installed to the pan-tilt mechanism,
and the ESP32 micro controller manages the servos, allowing enabling real-time modifications based
on the robot’s needs.
-Control Signals: The servos are controlled using PWM signals from the ESP32. The duty
cycle of these signals controls the angle of the servos, allowing for accurate camera orientation.
-Functionality: The sensor generates ultrasonic waves and measures the time it takes for the
echo to return. This information is utilized to determine the distance between items in the robot’s
route.
-Integration: The sensor connects to the ESP32, which evaluates the distance data and mod-
ifies the robot’s direction or actions to prevent collisions.
-Mounting: The ultrasonic sensor is usually installed on the front of the robot to give a clear
detection path. It may also be installed on a servo motor to scan the surroundings.
-Data Processing: Include algorithms in the ESP32 firmware for processing sensor data and
making navigation decisions.
23
Figure 3.6: Fusion 360 model 2
3.3.7 Implementation
Assembly and Integration
-Power Supply Setup: The 12V battery is connected to the power management system, which
distributes the appropriate voltage to the ESP32, motors, and sensors. correct gauge wiring is
utilized to meet the current demands of the motors and other components. Connectors facilitate
assembly and maintenance,also fuses and protective circuits to prevent short circuits and overloads.
-Motor Driver Connection: The motor driver is connected to both the ESP32 and the
motors. The robot’s wheels and arm move as a result of ESP32 control impulses. PWM Control:
the ESP32 is Set up to generate PWM signals for regulating motor speed and direction using the
motor driver. Feedback: encoders are Install as feedback mechanisms on the motors to give accurate
control and monitoring of the motor’s position and speed. -ESP32 Programming: The ESP32
is programmed to handle ultrasonic sensor inputs, drive the pan-tilt mechanism, and coordinate
the movements of the robot arm. Code Development: firmware is written with the Arduino IDE
or ESP-IDF, including libraries for motor control, sensor data collecting, and camera handling.
- Pan-Tilt Mechanism Assembly: The SG90 servo motors are installed on a frame, and the
ESP32-CAM is connected to enable a complete range of motion. Calibration: Check the servos for
proper movement and alignment of the camera. Integration: the ESP32-CAM is attached to the
pan-tilt mechanism and connected the servo control wires to the ESP32. - Sensor Integration:
The ultrasonic sensor is installed on the robot and connected to the ESP32, allowing for real-
time obstacle detection. Mounting Position: the sensor is aligned to maximize its field of vision and
detect range. Data Processing: algorithms are included in the ESP32 firmware for processing sensor
data and making navigation decisions. -Robot Arm Installation: The robot arm is constructed
and attached to the robot, with each joint motor connected to the ESP32 for precise control.
End-Effector: the end-effector are attached and testing its gripping mechanism to ensure it can
handle the desired fruits without harm. Movement Algorithms: Create and fine-tune algorithms
that regulate the arm’s movements for efficient and precise fruit picking.
24
Figure 3.7: Assembled robot
25
Figure 3.8: Assembled robot with With navigation capabilities and image processing
26
Figure 3.9: (Top) General workflow of YOLO ; (Bottom) YOLO Architecture.s.
The YOLO (Object Detection Loading) model, initially used for detecting small objects and
unusual aspect ratios, faced challenges in detecting objects with unusual aspect ratios and local-
ization errors. In 2017, YOLOv2 was introduced, which improved accuracy through anchor boxes,
batch normalization, and high-resolution classifiers. YOLOv3 followed, with improvements in bi-
nary cross-entropy, logistic regression, and feature extraction. YOLOv4 was introduced in 2020,
more accurate and faster than YOLOv3, running two times faster than EfficientDet and enabling
training on a single conventional GPU. YOLOv4’s structure was modified to enable scaling for
different applications, with YOLOv4-tiny and YOLOv4-CSP being developed to maximize speed
and computational cost. This study compared the performances of YOLOv4, YOLOv4-tiny, and
YOLOv4-CSP in detecting pear fruits. A backup system, such as object tracking, was developed to
ensure accuracy in counting, providing a more reliable measure of object count in case of detection
system failure.
27
3.4.2 Example of Online and Real-Time Tracking with Convolutional
Neural Networks
Deep SORT has shown to be one of the most reliable and quick methods for tracking many objects
[3]. Originally designed as a basic method of detection-based online tracking, the Simple Online
and Real-time Tracking (SORT) algorithm aimed to efficiently associate object detections on each
frame. It made use of convolutional neural networks’ stellar reputation for precise object detection.
Moreover, the tracking components included the Hungarian algorithm and the Kalman filter, two
traditional techniques for motion prediction and data correlation. Because of its low complexity,
SORT outperformed other cutting-edge trackers by a factor of 20. In the MOT (Multiple Object
Tracking) Challenge 2015, it also performed better than the conventional online tracking techniques
using Faster R-CNN [30] as the detector.
The primary limitations of SORT were occlusions and shifting angles of view. Wojke et al. [3]
created Deep SORT, an expanded form of SORT, to address this problem (shown in Figure 2).
Deep SORT incorporates a deep appearance-based metric from the convolutional neural network in
addition to motion-based metrics for data association. Higher robustness from occlusion, viewpoint
changes, and the use of a nonstationary camera for lower identity switches were the outcomes of this
modification. Deep SORT was determined to run at a runtime speed of 25–50 frames per second
on contemporary GPUs [3]. Because of its robustness and adaptability for real-time tracking, In
this work, the tracking method chosen to count the pear fruits in real time was Deep SORT.
28
GPU, their system achieved an AP of 96.28% and a detection speed of 106 FPS. Several other
research assessed how well YOLO-based models performed in identifying different fruits, including
apples, lemons, bananas, and cherries. It is significant to highlight that the majority of the research
did not provide loss curves for their models, making it challenging to confirm whether the dataset
was over- or underfitted. Additionally, without overfitting, it is challenging to verify if they have
attained the best achievable performance criteria
29
Experimental plateforme and Performance Evaluation
In this study, the experiments were conducted on a computer that has AMD Ryzen 5 3500U with
Radeon Vega Mobile Gfx 2.10 GHz quad-core CPUs, and a NVIDIA GeForce GTX 1070Ti GPU.
Figure 3.12: YOLO-fruits model flowchart for dataset, training and detection process.
Rather than creating excessively specialized predictors using the default anchor box configura-
tion provided by YOLOv3, it is vital to determine the size of the anchor box that is most likely to
be counted from the created dataset before training and testing. Based on the three detection layer
scales displayed in Figure3.8, nine clusters measuring 416 × 416 pixels were produced using the
K-mean clustering technique. The YOLO-tomato models were enhanced by assigning the anchors
to each scale in descending order. Three distinct nine clusters were produced as a result of the
tomato datasets being divided into Raw, 0.5 ratio, and 0.25 ratio categories. According to the
average IoU values, the raw ratio is 77.45%, the 0.5 ratio is 78.33%, and the 0.25 ratio is 78.55%.
Images with 416 × 416 pixels are fed into the model. Training loss20 is decreased by adjusting
the learning rate. Given that the input photos consist of two classes—ripe and unripe tomatoes—a
learning rate of 0.001 between 0 and 4000 iterations with a maximum batch size of 4000 was used.
Batch and Subdivision were set to 64 and 16, respectively, to minimize memory use. The weight
decay was set to 0.0005 and the momentum to 0.9. Additionally, the YOLO-Tomato was trained
30
using random initialization, whereas YOLOv3 and YOLOv4 were trained using official pre-trained
weights.
Using Precision, Recall, F1-score, and AP as assessment metrics, the trials performed on the
trained YOLO-tomato, YOLOv3, and YOLOv4 models were found to be effective. The equations
(3.1)–(3.4) illustrate the computation process.
TP
P recision = (3.1)
TP + FP
TP
Recall = (3.2)
TP + FN
2 ∗ P recision ∗ Recall
F1 = (3.3)
P recision + Recall
In these equations, TP, FN, and FP are abbreviations for True Positive (correct detections), False
Negative (missed detections), and False Positive (incorrect detections). F1 score was conducted
as a trade-off between Recall and Precision to show the comprehensive performance of the trained
models8, defined in Eq. (3.3). Average Precision–AP was adopted to show the overall performance
of the models under different confidence thresholds, expressed as follows:
X
AP = (rn+1 − rn ) · max p(f ) (3.4)
n
Table 3.1: Model performance evaluation with Raw dataset under 416×416 pixels’ resolution.
31
Methods Precision (%) Recall (%) F1 (%) AP (%)
Table 3.2: Model performance evaluation with 0.5 dataset under 416×416 pixels’ resolution.
Table 3.3: Model performance evaluation with 0.25 dataset under 416×416 pixels’ resolution.
Based on the assumptions outlined in Tables 1, 2, and 3, we discovered that all approaches
perform exceptionally well because tiny datasets are used.
The assessed performance varies depending on the approach used. According to the AP com-
parison results in the tables, the YOLO-Fruits-A model rose by 0.4% in Table 1, 1.2% in Table
2, and 1.2% in Table 3. This is a result of DenseNet’s feature enhancements, which improve the
model’s ability to identify tiny tomatoes. Precision, Recall, F1-score, and AP all increased when
Mish was activated in the models.
Because Raw, 0.5 ratio, and 0.25 ratio all had the identical configuration file, we saw little to
no variation in their detection times. As a result, Table 4 shows the average detection time of the
YOLO-Tomato model for each image.
32
Chapter 4
4.1 Results
4.2 Discussion
33
Chapter 5
Conclusion
5.1 here we go
34
Chapter 6
6.0.1 INTRODUCTION
The rapid advancement of technology in agriculture, particularly the creation of smart agricultural
robots, has the potential to transform traditional farming practices. In this context, Outcome-Based
Education (OBE) offers a structured framework for aligning educational programs with the skills
needed to design, develop, and implement new solutions such as harvesting robots. This demon-
stration will explain how the OBE approach handles course outcomes (COs), program outcomes
(POs), knowledge profiles, and the characteristics required to solve complex technical challenges in
smart agriculture.
Smart agricultural robots, particularly those developed for harvesting, pose numerous issues that
necessitate a thorough understanding of robotics, automation, sensor technology, artificial intel-
ligence, and sustainable practices. The educational program, which is based on OBE principles,
ensures that students obtain not just theoretical knowledge but also practical skills necessary for
tackling real-world agricultural challenges. This demonstration illustrates the use of OBE in the
development of abilities that are directly applicable to the agriculture sector’s changing needs.
35
Determine functional requirements of the problem consid-
CO2 PO4
ering
36
6.0.3 ASPECTS OF PROGRAM OUTCOMES (POS) ADDRESSED
The following table shows the aspects addressed for certain Program Outcomes (POs) addressed in
EEE 4700/4800 for Project and Thesis.
Put
Different As-
Statement Tick
pects
(✓)
Public health
Environmental
Synthesis of infor-
✓
mation
Societal ✓
Cultural
Environment and sustainability: Understand and evaluate the
sustainability and impact of professional engineering work in the Societal
PO7
solution of complex electrical and electronic engineering
problems in societal and environmental contexts. Environmental
37
Ethics: Apply ethical principles embedded with Religious values
religious values, professional ethics and
PO8 Professional ethics
responsibilities, and norms of electrical and
electronic engineering practice. and responsibilities
Norms
Engineering man-
agement principles
Project management and finance: Demonstrate knowledge and
understanding of engineering management principles and Economic decision-
PO11 economic decision-making and apply these to one’s own work, as making
a member and leader in a team, to manage projects and in
multidisciplinary environments. Manage projects
Multidisciplinary
environmental
38
The following table explains or justifies how the COs and corresponding POs have been addressed
in EEE 4700/4800 (Project and Thesis)
Put
COs Explanation/Justification POs Tick
(✓)
CO3 PO8 ✓
CO5 PO11 ✓
CO6 PO6 ✓
CO7 PO7 ✓
39
The development of agricultural harvesting robots
can impact society, safety, and the environment in
the following ways: Society, Changes in employ-
ment dynamics and labor market. Access to con-
sistent and efficient harvesting in regions with la-
bor shortages; Safety: Reduced risk of injuries and
occupational hazards for agricultural workers. Po-
tential reduction in chemical exposure through tar-
CO8 PO3 ✓
geted harvesting. Environment: Optimization of
resource utilization and reduction of waste. Min-
imization of soil compaction and potential for im-
proved soil health. Contribution to reduced emis-
sions and improved energy efficiency. These impacts
highlight the potential benefits and considerations
associated with the integration of agricultural har-
vesting robots.
CO11 PO12 ✓
40
6.0.4 KNOWLEDGE PROFILES (K3 – K8) ADDRESSED
The following table shows the Knowledge Profiles (K3 – K8) addressed in EEE 4700/4800 (Project
and Thesis).
Put
K Knowledge Profile (Attribute) Tick
(✓)
41
The following table explains or justifies how the Knowledge Profiles (K3 – K8) have been ad-
dressed in EEE 4700/4800 (Project and Thesis).
K Explanation/Justification
K4
K8
42
6.0.5 ATTRIBUTES OF RANGES OF COMPLEX ENGINEERING
PROBLEM SOLVING (P1 – P7) ADDRESSED
The following table shows the attributes of ranges of Complex Engineering Problem Solving (P1 –
P7) addressed in EEE 4700/4800 (Project and Thesis).
Put
P Range of Complex Engineering Problem Solving Tick
(✓)
Put
Complex Engineering Problems have characteristic
Attribute Tick
P1 and some or all of P2 to P7:
(✓)
43
The following table explains or justifies how the attributes of ranges of Complex Engineering
Problem Solving (P1 – P7) have been addressed in EEE 4700/4800 (Project and Thesis).
P Explanation/Justification
Understanding the issues related to agricultural harvesting robots involves considering crop
P4 variability, terrain challenges, labor efficiency, crop health, and integration with existing
agricultural systems.
The applicable codes for agricultural harvesting robots encompass safety standards, envi-
ronmental regulations, product quality standards, data privacy and security regulations,
P5 robotic industry standards, and ethical guidelines. These codes ensure the robot’s safe op-
eration, environmental compliance, product quality, data security, industry compatibility,
and ethical harvesting practices.
The development of agricultural harvesting robot involves diverse stakeholders with varying
P6
needs, including farmers, researchers, policymakers, and technology providers.
Engineering tasks are complex and involve many interconnected components, such as hard-
P7
ware design, software development, and environmental considerations.
44
6.0.6 ATTRIBUTES OF RANGES OF COMPLEX ENGINEERING
ACTIVITIES (A1 – A5) ADDRESSED
The following table shows the attributes of ranges of Complex Engineering Activities (A1 – A5)
addressed in EEE 4700/4800 (Project and Thesis).
Put
A Range of Complex Engineering Activities Tick
(✓)
A1: Involve the use of diverse resources (and for this purpose resources include people,
Range of re- ✓
money, equipment, materials, information and technologies)
sources
A2: Require resolution of significant problems arising from interactions between wide-
Level of interac- ✓
ranging or conflicting technical, engineering or other issues
tion
Familiarity A5: Can extend beyond previous experiences by applying principles-based approaches ✓
45
The following table explains or justifies how the attributes of ranges of Complex Engineering
Activities (A1 – A5) have been addressed in EEE 4700/4800 (Project and Thesis).
A Explanation/Justification
To develop an agricultural harvesting robot, several resources are required, including hardware, software,
data, funding and support and human resources. Considering the complexity of developing an agricultural
A1
harvesting robot, a multidisciplinary approach involving mechanical, electrical, and software engineering,
as well as agricultural expertise, is essential
It is imperative to address significant obstacles that may arise from the interplay of many technical,
engineering, and agricultural concerns. This means resolving conflicts between needs, integrating various
A2
technologies, and optimizing the effectiveness of intelligent agricultural robots in complex agricultural
environments.
Agricultural harvesting robots can impact society by changing employment dynamics and requiring work-
A4 force training, while also affecting the environment through resource conservation and potential soil health
implications.
To extend beyond previous experiences in developing an agricultural harvesting robot, apply principles-
based approaches such as holistic systems thinking, iterative development, data-driven decision making,
A5 risk management, ethical considerations, and regulatory compliance. These approaches will help cre-
ate a robust, adaptable, and socially responsible solution that aligns with established engineering and
agricultural principles.
46