INTELLIGENT GARBAGE SEGREGATION SORTING MACHINE TAMALA, JAMES LESTER S. UNDERGRADUATE CAPSTONE PROJECT SUBMITTED TO THE FACULTY OF THE DEPARTMENT OF INFORMATION TECHNOLOGY, COLLEGE OF INFORMATION SCIENCES AND COMPUTING, CENTRAL MINDANAO UNIVERSITY, IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY JUNE 2023 i Republic of the Philippines CENTRAL MINDANAO UNIVERSITY Musuan, Maramag, Bukidnon College of Information Sciences and Computing Department of Information Technology APPROVAL SHEET The undergraduate capstone project attached hereto entitled, “INTELLIGENT GARBAGE SEGREGATION SORTING MACHINE” (Research No. 21343), prepared and submitted by JAMES LESTER S. TAMALA, in partial fulfillment of the requirements for the degree Bachelor of Science in Information Technology (Data Network), is hereby endorsed. NATHALIE JOY G. CASILDO Chair, Thesis Advisory Committee Date ROMER IAN O. PASOC Member, Thesis Advisory Committee Date DONAH RAE P. VERULA Member, Thesis Advisory Committee Date Recommending Approval: JOHN D. TAJONES Department Chair Date JINKY G. MARCELO Research Coordinator Date Accepted in partial fulfillment of the requirements for the degree in Bachelor of Science in Information Technology. Approved: KENT LEVI V. BONIFACIO College Dean Date Noted: JUPITER V. CASAS `Director for Research Date ii Copyright © 2023 by James Lester S. Tamala All Rights Reserved ii AUTHOR’S BIOGRAPHICAL SKETCH James Lester S. Tamala was born and raised in their humble home at Purok 1 New Compostela Damulog Bukidnon, Bukidnon on July 25, 2001. He is the only child of Mr. Harvey Tomarong Tamala and Mrs. Aileen Sotto Tamala. Currently, he resides in New Compostela, Damulog Bukidnon with his family. He completed his primary education at New Compostela Elementary School, graduated as the Salutatorian of his class. He pursued his junior high education at Xavier de Damulog High School, where he achieved class honors. In senior high school, he specialized in Humanities and Social Sciences Strand (HUMMS) at Xavier de Damulog High School. He continued his education at Central Mindanao University, pursuing a Bachelor of Science in Information Technology. During his senior high school years, James Lester S. Tamala actively took on leadership roles and served as an officer of Citizenship Advancement Training (CAT) (2017-2019). He has been recognized on the Dean's List during college from 2022 to 2023. JAMES LESTER S. TAMALA iii ACKNOWLEDGEMENT First and foremost, the proponent wishes to thank the Almighty God for the blessings of knowledge, protection, assistance, good health, and unconditional love. This project could not have been completed without the significant assistance of the capstone project adviser and panel. The proponent extends sincere appreciation to their capstone adviser, Ma'am Nathalie Joy G. Casildo, for her unwavering support and dedication. The proponent is immensely grateful for the adviser's investment of time, knowledge, patience, and effort, which greatly assisted in the successful completion of this capstone project. Gratitude is also extended to Sir Romer Ian O. Pasoc and Ma'am Donah Rae P. Verula for generously sharing their knowledge and ideas. Their contributions significantly enriched the project and expanded the proponent's understanding. The proponent extends heartfelt thanks to the three individuals mentioned for their guidance and mentorship throughout this endeavor. Additionally, the proponent would like to express gratitude to Miss Daphne Gonzaga Salomon, for lending her Image Classification Model, which played a vital role in completing the system. The proponent is genuinely thankful for her assistance and support. Lastly, the proponent extends deep appreciation to their beloved parents, Papa Harvey and Mama Aileen, for their unwavering love, patience, joy, and especially their financial support. The proponent acknowledges that their parents' presence and assistance were indispensable in reaching this point. The proponent also expresses gratitude to their friends, relatives, advisers, faculties, classmates, and all those who have been part of their journey. The proponent is immensely grateful for their invaluable help and unwavering support, which played a significant role in successfully concluding this project. The proponent acknowledges and extends heartfelt thanks to all the individuals mentioned above. Their support, guidance, and encouragement have been instrumental in the completion of this project. iv EXECUTIVE SUMMARY Poor waste management was one of the common problems in society. Unsegregated waste materials caused pollution like water contamination, soil pollution, and air pollution which had harmful effects. Even though society provided a garbage container for each different garbage material, people still threw their waste carelessly due to improper disposal. Previous studies from other researchers had also used advanced technology to construct a smart trashcan, with common project features including wet and dry rubbish classifications using a moisture sensor and a metal detector. Other studies, on the other hand, only monitored the garbage levels in the garbage bins. Some researchers included computer visions in their systems by collecting data sets and training them in various methods. To address this problem, a garbage sorting machine was designed to classify the garbage materials, which were biodegradable materials and nonbiodegradable materials, by implementing an image-based classification model on the system. Additionally, the system could notify the user about the level of garbage in the trash can by integrating an ultrasonic sensor and buzzer module into the system. The system was composed of four major components: the microprocessor that processed the collected data, the sensor that was responsible for image classification, the motors that were responsible for motorizing mechanism activities, and lastly, the notification module which was accountable for alerting the users. v Table of Contents TITLE PAGE TITLE PAGE…………………………………………………………………………..i COPYRIGHT PAGE ......................................................................................... ii AUTHOR’S BIOGRAPHICAL SKETCH ........................................................... iii ACKNOWLEDGEMENT .................................................................................. iv EXECUTIVE SUMMARY .................................................................................. v Table of Contents ............................................................................................ vi List of Figures ................................................................................................ viii List of Tables .................................................................................................... x List of Appendices ........................................................................................... xi Chapter I ........................................................................................................... 1 INTRODUCTION .............................................................................................. 1 1. Background of the project .......................................................................... 1 2. Statement of the Problem .......................................................................... 2 3. Objectives of the Project ............................................................................ 3 4. Scopes and Limitations.............................................................................. 3 5. Significance of the Project ......................................................................... 4 CHAPTER II ..................................................................................................... 5 REVIEW OF RELATED LITERATURE/SYSTEMS ........................................... 5 1. Review of related literature about smart dust bin technology .................... 5 2. Review of related literature about Garbage Sensing machines ................. 9 3. Review of related literature about Confusion Matrix ................................ 10 Chapter III ....................................................................................................... 12 TECHNICAL BACKGROUNDS ...................................................................... 12 1. Raspberry Pi ............................................................................................ 12 2. Raspberry Pi Camera Module ................................................................. 12 3. Servo Motor ............................................................................................. 12 4. Tensor Flow Lite ...................................................................................... 12 5. Ultrasonic Sensor .................................................................................... 13 6. Buzzer .................................................................................................... 13 7. Open CV .................................................................................................. 13 8. RGB Light Emitting Diode (LED) ............................................................. 13 Chapter IV ...................................................................................................... 14 METHODOLOGY ........................................................................................... 14 vi 1. Conceptual Diagram ................................................................................ 14 2. Process Block Diagram ........................................................................... 16 3. Architectural Diagram .............................................................................. 18 4. Schematic diagram ................................................................................. 20 5. List of Materials ...................................................................................... 21 6. Cost of Materials ...................................................................................... 22 7. Project Timeline ....................................................................................... 23 8. Dataset model ......................................................................................... 24 9. Hardware Calibration and Test Result ..................................................... 25 I. Development Process ...................................................................... 25 II. Calibration ........................................................................................ 26 10. Process Flow on Testing ....................................................................... 29 Chapter V ....................................................................................................... 30 RESULTS AND DISCUSSION ....................................................................... 30 1. Whole Prototype Machine ..................................................................... 30 2. Receptacles .......................................................................................... 31 3. Enclosure and Electronics .................................................................... 32 4. Garbage Level Detector Module ........................................................... 33 5. Notification Module ............................................................................... 34 6. Separator Flap ...................................................................................... 35 7. Camera Sensor..................................................................................... 36 8. Process of activating the machine using the command line of Linux in Raspberry pi operating system. ................................................................... 37 9. Confusion Matrix ................................................................................... 40 10. Discussion ............................................................................................ 44 Chapter VI ...................................................................................................... 46 CONCLUSION AND RECOMMENDATIONS ................................................. 46 1. Conclusion ............................................................................................ 46 2. Recommendations ................................................................................ 47 References ..................................................................................................... 48 Appendices………………………………………………………………………....52 vii List of Figures FIGURE TITLE PAGE 1 Conceptual Diagram of Garbage Sorting Machine 14 2 Conceptual Diagram of Notification Module 15 3 Process Block Diagram of the Machine 16 4 Process Block Diagram of the Notification Module 17 5 Architectural diagram of the machine 18 6 Architectural Diagram of the Enclosure 19 7 Schematic Diagram of the Motor and Sensor machine 20 8 Process Flow on Testing 29 9 Whole System Prototype Machine 30 10 Receptacles for the garbage container. 31 11 System Enclosure and Electronics 32 12 Level Detector System 33 13 Buzzer module and RGB Light Emitting Diode (LED) 34 14 Servo Motor 35 15 Separator flap powered by motor. 35 16. Raspberry Pi Camera Module 36 17 Opening the tflite1 folder 37 18 Opening the Python Virtual Environment 38 19 Activation of General Pin Input Output (GPIO) library 38 20 Activation of classification of waste program 39 21 The confusion matrix of ResNet152 and the incorrectly classified garbage materials both in false positive and negative 22 The confusion matrix of VGG16 and the incorrectly classified garbage materials both in false positive and negative 23 41 The confusion matrix of MobileNet and the incorrectly classified garbage materials both in false positive and negative 24 40 42 The confusion matrix of Inceptionv3 and the incorrectly classified garbage materials both in false positive and negative 43 25 Raspberry Pi Module 53 26 Raspberry Pi Camera 54 viii FIGURE TITLE PAGE 27 Ultrasonic Distance Sensor 55 28 Jumping Wires 56 29 Resistor 57 30 12 Volts Fan 58 31 12 volts Power Supply 59 32 Breadboard 60 33 Buzzer Module 61 34 Servo Motor 62 35 RGB LED 63 36 Plywood 64 37 Building the Box Frame 66 38 Electronics Installations 67 ix List of Tables TABLE TITLE PAGE 1 The tabular form of Cost of the Materials 22 2 Gantt Chart of the Capstone Project 23 x List of Appendices APPENDIX A TITLE PAGE List of Materials for the Intelligent Garbage Segregation Sorting Machine 52 B Building process of the prototype machine 65 C Relevant Codes 68 D Grammarian Certificate 76 E Plagiarism Evaluation Result 78 xi Chapter I INTRODUCTION 1. Background of the project Garbage is described as materials that had been disposed of or were no longer required (Maritime Safety Queensland). According to the UN, the modern economy's rising amount of garbage posed a severe threat to ecosystems and human health. An estimated 11.2 billion tons of solid trash were collected globally each year, UN (2022). Poor garbage disposal had several harmful impacts on our health and the environment, according to the Metropolitan Transfer Station. The negative effects of improper garbage management included soil contamination, water contamination, and air contamination. This was due to numerous dissolved chemicals from the garbage which could harm our health by inhaling toxic chemicals from the air, as well as generate extreme weather as a result of climate change because hazardous greenhouse gases were produced by decaying waste. These rose to the surface of the earth and trapped heat. Extreme weather reactions, such as storms and typhoons, were a result of this, Metropolitan Transfer Station (2017). Several challenges led to improper garbage disposal, according to Greenbank. Four factors led to poor garbage management, including lack of public awareness, particularly lack of understanding within enterprises, and poor attitudes, which were among the first reasons for inadequate waste management, Greenbank (2020). When something reached the end of its useful life, it was frequently disposed of carelessly, and the lack of proper types of machinery such as balers and compactors made it difficult to implement a truly efficient waste management strategy, Greenbank (2020). In summary, the garbage problem in our society rapidly rose due to many productions in the current period. Poor garbage management could result in health and environmental issues because most people did not care about proper disposal. Even though it had a lot of technology that was applied in society, it lacked the machinery to control and manage the trash in its category. 1 Some technologies were fully automatic and segregated garbage according to its classification. Some of these technologies used the internet of things to address this type of problem by inserting a system into the trashcan and monitoring the state of the trashcan in real-time. Some systems incorporated an image classification program and machine learning to identify garbage components. To address this issue, the community needed a machine that automatically separated garbage into categories, checked the amount of waste in the trashcan, and alerted the user if the trashcan could no longer contain the waste. The project was carried out to create a machine capable of sorting various garbage materials, as well as to create a system that notified the user if the trash bin could no longer be accommodated. 2. Statement of the Problem Poor garbage management is a well-known and common problem not just to society but also to our planet. Although the concept of a garbage sorting machine was popular, it was mostly utilized by industries that recycled resources for other purposes, and aftermarket trash bins were very expensive for their minimum features. Most individuals did not care about dumping their garbage in the trash can, resulting in the mixing of biodegradable garbage materials and non-biodegradable garbage materials, which could lead to improper waste management. However, there was no suitable equipment in the community that was capable of separating different garbage materials, and there was no system that notified the user when the garbage bin was full. 2 3. Objectives of the Project The general objective of the project was to develop a garbage sorting machine prototype. Specifically, this project aims to: i. implement an image-based classification model on the sorting machine; ii. develop a machine that can identify biodegradable garbage materials and non-biodegradable garbage materials; iii. detect trashcan levels, and alert the user about the state of the machine, and evaluate the overall satisfaction of the machine’s performance. iv. 4. Scopes and Limitations This project was conducted to develop a machine that could put garbage into categories: biodegradable materials such as Fruit waste, Paper Waste, and Vegetable waste, as well as non-biodegradable materials such as Glass Bottle Waste, Metal Can Waste, and Plastic Waste. It detected trashcan levels and alerted the user about the state of the machine. The system could only detect one type of garbage in each load and would not accommodate several types of garbage simultaneously. The system was only composed of four major components: sensor components that identified garbage materials, motor components for the separator machine, a microprocessor that processed sensor data and sent commands to the motors, and a notification module that sent users the system's status. The machine would not function if there was no power source because it had no backup power. The garbage sorting machine's sole purpose was to classify garbage and inform and alert the user when the garbage can no longer be accommodated. The machine only tested its capabilities in garbage materials and did not test any materials unless they were garbage components. 3 5. Significance of the Project The use of this machine was important in significantly reducing the current problem of insufficient garbage disposal methods, which was primarily leading to alarming amounts of air and water pollution. By putting this machine into the local garbage disposal system, it provided numerous benefits to the community as a whole. One major advantage was its ability to raise awareness among individuals by alerting them when the garbage container was full, so encouraging proper waste disposal habits. Furthermore, this system was capable of autonomously categorizing sorts of garbage, biodegradable garbage and non-biodegradable garbage, significantly reducing the need for manual monitoring and oversight by community members. 4 CHAPTER II REVIEW OF RELATED LITERATURE/SYSTEMS 1. Review of related literature about smart dust bin technology Several researchers have worked in recent years to build and implement smart dustbin technology in real-world applications. Rajiv Kumar Gurjwar developed a system called Smart Trash Can Using IoT, which is focused on segregating different garbage materials, it is made up of an Arduino based system that includes an Arduino R3 as a micro-controller, a Bluetooth module that acts as a connection or gateway, an ultrasonic sensor that monitors the moisture of the objects, DC motors attached to the conveyor belt to perform, and finally a 9 volts battery to power the system (Gurjwar, n.d.). This is like the research of Kavipriya et al (2020) entitled Intelligent Trashcan Monitoring System Using IoT. The system uses Arduino-based technology as well, but the primary distinction is that this system focuses on checking the dustbin level. Both systems are effective in terms of their functions, and both systems include an application to display the data acquired by the systems (Kavipriya et al., 2020). Some of the researchers include the high-level feature in their system, in the study of Ayush et al., (2020) entitled Voice Controlled Automatic Dustbin with Garbage Level Sensing, it is also using the Arduino based technology, the main feature of this device is that it is voice-controlled that you can give the command, trash level detection as well as the detection of trash. In 2018, Saha et al., (2018) proposed a study titled IoT Based Garbage Monitoring and Clearance Alert System. The system uses normal bins (metal or plastic), ultrasonic sensors, DHT-11 temperature, and humidity sensors, Arduino, GSM module, WiFi module, RGB led lights Breadboards, Jumper wires, and a power supply that is a battery connected to a solar panel. The main feature of this feature is that it is powered by solar energy and has a specialized application that alerts the user when the garbage cans are full. 5 In 2019 Raaju et al., (2019) developed a system entitled IoT Based Smart Garbage Monitoring System, using Zigbee, the system is composed of Arduino Pro Mini and Arduino -nano as micro-controllers, it has Ultrasonic sensor for detecting the objects, and for the gateway they use the ESP 8266 Node MCU, The ultrasonic sensors are installed on the sides of the bins that are used to collect the trash level and frequent monitoring can be done given with the power supply to NODE MCU linked through the solar panel as a power source terminal. Through the GPS module, the position is determined, and the frequency is determined. The nearest municipal workplace is kept informed of the position, and the drivers are notified. The device gathers the waste level of the environment. Dustbins levels are collected using an ultrasonic sensor and sent to the next node. ZigBee is used to transport data from the child node to the parent node. The NodeMCU in the parent node collects the data and sends it to Firebase. It is different from the study of Chinmay, et al., (2018) E-dustbin, the system is included with Esp 8266 for the micro-controller, for a sensor it has a proximity sensor and ultrasonic sensor, the difference is the data from this device is shown in the Liquid Crystal Display and also it only focuses on sensing the level of trash in the dustbin. The height of the rubbish within the dustbin is detected using one ultrasonic sensor. The rubbish level is measured in centimeters. Whenever the height of the rubbish is less than 10cm, the esp8266 is interrupted. The Wi-Fi module will be turned on. ESP uses the secured dns connection to load the data into the web server. The buzzer is also activated, as is the alert message on the LCD. A moveable platform is suggested for the dustbin, which is connected to motors and controlled by the motor driver L293D. The front proximity sensor attached to the trashcan generates an interruption, which is used to regulate the motor driver. Both systems are effective according to rules and provide efficient performance. Researchers from India create a system entitled IoT Based Smart Waste Management System: India prospective, the systems The project makes use of the Internet of Things (IoT) and GSM/GPRS technology, connecting the transmitter and receiver It provides real-time data on trash status, It calculates the percentage of the trash that has been filled and the amount of toxicity. It sends data to a website so that it may be seen afterward. It keeps track of the 6 time and date, as well as the dustbin's percent filling and toxicity level, in a database. When the trash is full or the toxicity level is high, it sends a notice to the person in charge. The Arduino is coupled to an ultrasonic sensor and a gas sensor, which provide data to the municipal corporation through the GSM module, Singhvi, et al., (2019). This study is similar to Dr. Sathish Kumar and his co-workers' IOT Based Smart Garbage Alert System Using Arduino Uno, but it focuses more on dustbin level monitoring. The system has its web application with an embedded system, and it can track the level of the dustbin using an ultrasonic sensor and send the data via Wifi Module on the web. The main difference is that it has an RFID system to monitor the garbage truck when it starts collecting the trash in the bin (Kumar, N. et al., 2016). This research entitled The Design and Implementation of Smart Trash Bin provides a low-cost concept for an intelligent trash container for small-scale applications from the study of Fady E. F. Samann. This system uses an Arduino Nano board and an ultrasonic sensor to monitor the container's fullness level and send SMS notifications using a GSM module. The system is fueled by a lithium battery power bank that is backed up by a solar cell panel. The solution allows you to charge external portable gadgets with the power bank. Furthermore, when the bin is in use, the system will record usage and fullness events on a memory card, which is also utilized to deliver an audio message through a speaker (Fady E. F. Samann, 2017). Also, in the study of Henita Rahmayanti and his co-workers entitled the implementation of smart trash as smart environment concept, The focus of this research was to implement the smart garbage bin idea in schools. This smart trash can identify garbage depending on garbage kind (plastic and metal). Furthermore, smart garbage can serve as an educational tool for pupils. It includes explanations about knowledge and how to utilize the garbage can so that children may understand to maintain environmental cleanliness and attractiveness The research employed the Borg and Gall model's Research and Development approach. This study's focus was on elementary school kids. The Internet of Things (IoT) is a fast-evolving technology that has been extensively researched in order to increase the efficiency of services such as waste management. Recently, research has concentrated on the creation of Internet of Things-based trash machines, which are sophisticated sensors and 7 systems that monitor waste levels in containers and warn operators when such levels reach a given threshold. This paper investigates the present state of the art in the development of IoT-based trash machines, describing several research studies and initiatives linked to this technology. One of the primary advantages of utilizing an IoT-based garbage machine is its capacity to improve waste management efficiency and minimize expenses. For instance, Zou et al., (2020) investigated the possibilities of an IoT-based garbage machine for urban waste management. The authors created a trash machine prototype that could detect and report waste levels in a bin and then activate garbage pickup when the bin reached a specified threshold. According to the authors, the prototype was able to minimize collection expenses by up to 10% while also providing precise data on garbage collection activities. In addition to cost savings, IoT-based waste machines may improve safety and the environment. For example, Wang et al. (2020) created an IoTenabled waste management system capable of detecting the presence of hazardous items in garbage containers. The system was able to identify hazardous compounds and inform operators, lowering the chances of dangerous substance exposure. Furthermore, data acquired by the garbage machine was utilized to give insights into waste management operations, such as detecting locations with higher-than-normal waste levels and providing recommendations on how to minimize waste. Furthermore, waste machines powered by IoT may be utilized to improve customer service. For example, Zhang et al. (2020) created a smart trash machine that could recognize consumers using face recognition and give personalized services depending on their preferences. According to the authors, the approach improved customer satisfaction and reduced the time required for garbage collection operations. Overall, IoT-based garbage machines have the potential to transform waste management operations by offering considerable cost savings, safety, environmental protection, and customer service benefits. As this technology advances, the possibilities for its application in the waste management business will grow. The majority of smart trash bin monitoring systems are based on Arduino technology, with the majority of the systems focusing on 8 waste level monitoring. All of the systems are primarily focused on notification systems and utilize ultrasonic sensors to measure garbage levels. Some of the systems have their application to monitor data from the device, however, no device with advanced technology such as computer vision and deep learning is incorporated. 2. Review of related literature about Garbage Sensing machines The rapid increase in urbanization and population has posed a major challenge to waste management globally. Smart waste management has been proposed as a solution to this challenge. One of the components of smart waste management is the development of smart garbage-level sensing systems. The purpose of this review is to examine the existing literature on smart garbagelevel sensing systems. A smart garbage level sensing system refers to a system that is designed to monitor the level of waste in garbage bins in order to optimize waste management processes. This system is made up of sensors, microcontrollers, and wireless communication systems. The sensors are used to detect the level of waste in the bin and send the data to the microcontroller which then sends the information wirelessly to the waste management authority. Several studies have been conducted on smart garbage-level sensing systems. Gomez Corona, et al. (2016) proposed a smart garbage system that uses an ultrasonic sensor to detect the level of waste in a garbage bin. The system was able to detect the level of waste in the bin with an accuracy of 96%. The system was also able to optimize waste collection routes. Another study by Huang, et al. (2016) proposed a smart waste management system that uses a combination of sensors including ultrasonic sensors, infrared sensors, and temperature sensors to monitor the level of waste in a garbage bin. The system was able to detect the level of waste in the bin with an accuracy of 98% and was able to optimize waste collection schedules. Similarly, Garg et al. (2019) proposed a smart waste management system that uses a combination of technologies including Internet of Things 9 (IoT), cloud computing, and sensors to optimize waste management processes. The system was able to detect the level of waste in the bin accurately and was able to optimize waste collection schedules. In conclusion, smart garbage level sensing systems have been proposed as a solution to waste management challenges caused by urbanization and population growth. Several studies have been conducted on smart garbage level sensing systems, and the studies have shown that the systems are effective in optimizing waste management processes. The reviewed studies can serve as a basis for the development of smart garbage level sensing systems to implement effective waste management in urban areas. 3. Review of related literature about Confusion Matrix A confusion matrix is a popular tool in the field of machine learning used to evaluate the performance of classification algorithms. It is a powerful metric that helps machine learning practitioners to understand the accuracy of their model, identify the types of errors made and improve the model based on the insights gained from the matrix. The use of the confusion matrix has been widely studied in the machine learning literature. In their study of Fawcett (2006), analyzed the effect of varying class imbalance on the performance of the confusion matrix. They showed that when class imbalance is high, metrics like accuracy and precision can be misleading and the confusion matrix can provide deeper insights into the model's performance. Another study by Guyon and Elisseeff (2003) investigated the impact of feature selection on the performance of different classification algorithms. They found that the confusion matrix can be used to compare the performance of different feature selection techniques and help machine learning practitioners to choose the best technique for a particular problem. In addition, Phua, C. et al. (2010) conducted a comparative study of different algorithms based on the confusion matrix in the context of identifying fraudulent financial transactions. They found that the confusion matrix is a 10 powerful tool to assess the performance of fraud detection algorithms and evaluate the trade-off between false positives and false negatives. Overall, the confusion matrix is a powerful and widely used tool in machine learning to evaluate the performance of classification algorithms. Its application has been widely studied and it has been shown to provide valuable insights into the performance of different models. As a result, it is recommended that it be used by machine learning practitioners to evaluate their models and gain insights to improve performance. 11 Chapter III TECHNICAL BACKGROUNDS 1. Raspberry Pi The Raspberry Pi is a microprocessor computer that is capable of processing data sets and could also install software packages such as TensorFlow. The Raspberry Pi served as the system's brain, responsible for processing the received data from sensors and giving commands to motors. 2. Raspberry Pi Camera Module The Raspberry Pi camera module is responsible for object detection and sensing the material components of garbage. It provided data to the Raspberry Pi for data processing. 3. Servo Motor The servo motor is in charge of removing dropped garbage from the system's detecting region. The motorized separator flap could rotate from 0 degrees to a full 360 degrees, allowing the flap mechanism to move up and down. 4. Tensor Flow Lite TensorFlow Lite is a tool that enabled running a model on mobile, embedded, and edge devices, allowing for on-device machine learning. The TensorFlow Lite software was loaded on the system's microprocessor and ran the trained model via image classification. The TensorFlow Lite program was responsible for running the data sets model of different garbage on the Raspberry Pi to perform image classification, enabling the system to detect the garbage components. 12 5. Ultrasonic Sensor The ultrasonic sensor is responsible for detecting the level of the waste receptacle by emitting ultrasonic sound waves. The sensor sent data to the microprocessor for continued monitoring, and it monitored the level of the garbage inside the container. 6. Buzzer The buzzer acts as an alerting module. The passive buzzer was connected to the microcontroller, and if triggered, it emitted a sound to notify the potential user that the garbage containers of the system were full. 7. Open CV OpenCV is a Python package that enabled image processing and computer vision applications. It was intended to provide a shared infrastructure for computer vision applications and accelerate the usage of machine perception. 8. RGB Light Emitting Diode (LED) The RGB Light Emitting Diode (LED) is a type of LED that produced light in three different colors: red, green, and blue. It was used in garbage machines to indicate when the bin was full. The LED would light up when the bin was full, alerting the user that it needed to be emptied. Additionally, RGB LEDs used to indicate different types of waste, such as non-bio and bio waste. 13 Chapter IV METHODOLOGY 1. Conceptual Diagram During the sorting process, the garbage was analyzed using computer vision to determine whether it was biodegradable or non-biodegradable. Once this was determined, the machine's separator flap dropped the garbage into its categories by rotating the motor from 0 degrees to a full 180 degrees. Figure 1 showed the conceptual diagram of the garbage sorting machine. Figure 1. Conceptual Diagram of Garbage Sorting Machine 14 The machine assessed the trash can level using an ultrasonic sensor. The ultrasonic sensor module collected data and delivered it to the computer, while the buzzer module served as an alerting system. Figure 2 showed the conceptual diagram of the notification module. Figure 2. Conceptual Diagram of Notification Module 15 2. Process Block Diagram For the process block diagram of the system, the garbage sorting machine began the process by determining whether the garbage was biodegradable or non-biodegradable. The process then proceeded to the confirmation process, where the system determined the classification. If the garbage was biodegradable, it was placed in the biodegradable trashcan, and if it was nonbiodegradable, it was placed in the nonbiodegradable trashcan. Figure 3. Process Block Diagram of the Machine The sensor evaluated the system's trash level. If it was at its maximum, the system will send a notification to the designated user via a buzzer, which 16 alerted the intended user. If the user cleaned up the garbage container, the system will return to a normal state. However, if the user did not clean up the garbage container, the buzzer will continue to alert. Figure 4 showed the Process Block Diagram of the Notification Module. Figure 4. Process Block Diagram of the Notification Module 17 3. Architectural Diagram For the architectural diagram of the project, the main component of the system was a Raspberry Pi used as the microprocessor. It was accompanied by a camera module for visualization purposes. Additionally, two types of motors, namely the servo motor and the stepper motor, were incorporated. The computer system was powered by the power supply, and the sensors and actuators were directly connected to the microprocessor for data input and output. Figure 5. Architectural diagram of the machine The system's enclosure measured 76.2 centimeters in height and 30.48 centimeters in width. The upper part of the enclosure provided access to where the garbage fell into the sensing area, with the camera module on top responsible for detecting the material components of the garbage. Once the material component of the garbage was identified, the garbage was dropped and segregated using servo motors. The servo motor moved the garbage to one of the containers located at the bottom of the enclosure. The ultrasonic sensor measured the level of garbage in the receptacles, and the buzzer module alerted if the garbage reached its full capacity and could no longer be accommodated. Figure 5 showed the architectural design of the garbage enclosure. 18 Figure 6. Architectural Diagram of the Enclosure 19 4. Schematic diagram For the schematic diagram of the system, the Raspberry Pi microprocessor was connected to the servo motor via GPIO 25. The microprocessor controlled the servo using analog output, while the remaining VCC and GND of the servo were connected to the 3.3 volts power supply. The two ultrasonic distance sensors were connected to the microprocessor via trig into GPIO 27 and GPIO 23, and echo into GPIO 22 and 24. The microprocessor received data from the ultrasonic distance sensors through analog input. For the buzzer module, a 1K resistor was connected to GPIO 17 of the microprocessor and then connected to the transistor. The VCC of the transistor was connected to the GND of the buzzer, and the VCC of the buzzer was connected to the 3.3 volts power supply module. The fan motor was powered by a 12 volts power supply, while the two LED lights were connected to the 3.3 volts power supply module. Figure 7. Schematic Diagram of the Motor and Sensor machine 20 5. List of Materials Hardware Materials ● Raspberry Pi ● Motor Driver ● Raspberry Pi Camera Module ● Servo Motor ● Jumping Wires ● Plywood for enclosure ● Plastic Box ● 12v ac dc charger ● MB102 Solderless Breadboard Power Supply Module ● Ultrasonic Sensor Distance Measuring Module HC-SR04 ● Buzzer module (passive) ● LED ● Transistor ● Resistor Software Materials ● Tensor Flow Lite ● Python ● Open CV 21 6. Cost of Materials Table 1. The tabular form of Cost of the Materials Materials Price Raspberry Pi Model b ₱ 4,049 Raspberry Pi Camera Module ₱ 192 Servo Motor ₱ 127 9 volts Power Supply ₱ 125 Jumping wires ₱ 109 MB102 Solderless Breadboard Power ₱ 68 Supply Module Plastic Box ₱ 30 Plywood for enclosure and Lid ₱ 200 Resistor ₱5 Transistor ₱5 12v ac dc charger ₱ 90 Ultrasonic Sensor Distance ₱ 98 Measuring Module HC-SR04 Buzzer module (passive) ₱ 21 Total ₱ 5,119 22 7. Project Timeline Table 2. Gantt Chart of the Capstone Project 2022 Apr May Jun Apr May Jul May Apr Apr Take Name 04 y n 05 06 n 07 Aug Sep Oct Nov Dec 2023 2023 Jan Feb Mar Dec Jul May Apr 08 09 10 11 12 01 02 03 Project Consultation Project Proposal Project Development Project Consultation Project Finalization Revision Project Development Project Finalization Final Defense The Project consultation occurred throughout the entire month of April, and the project proposal took place in May. The project development spanned four months from June to September. In October, the project consultation started, and the project finalization occurred in September. However, there was 23 a revision on the project in December. The project development and finalization continued in January and February, and finally, in March, the project was defended. 8. Dataset model The project's dataset model was titled "IMAGE CLASSIFICATION OF BIODEGRADABLE AND NON-BIODEGRADABLE WASTE MATERIALS USING CONVOLUTIONAL NEURAL NETWORKS (CNN)", and it was trained by Daphne G. Salomon. The study focused on developing an image classifier that could categorize waste materials into two groups: Biodegradable and NonBiodegradable, utilizing Convolutional Neural Networks (CNN). The CNN model employed in the study processed input images through a sequence of convolutional, pooling, and fully connected layers to generate the output. The performance of the image classifier was evaluated using various metrics and a confusion matrix. The image classification model encompassed six waste classifications, including three biodegradable materials: Fruit Waste, Paper Waste, and Vegetable Waste, as well as three non-biodegradable materials: Glass Bottle Waste, Metal Can Waste, and Plastic Waste. To optimize the model's deployment, four CNN models were converted into TensorFlow Lite models. These models included: - model_ResNet152_v2_epoch50.tflite with a file size of 226 megabytes. - model_VGG16_v3_epoch50.tflite with a file size of 57.1 megabytes. - model_MobileNet_v1_epoch50.tflite with a file size of 14.2 megabytes. - model_inception_v2_epoch50.tflite with a file size of 87.1 megabytes. 24 9. Hardware Calibration and Test Result I. Development Process The next stage of development involved creating a solution process that included both software and hardware components required for system development. This encompassed development tools, programming languages, materials, and apparatus. For the configuration of the microprocessor, which is the Raspberry Pi computer, additional devices such as a monitor, keyboard, and mouse were needed to access and successfully configure the computer. The first step involved installing the latest operating system, which is the Raspberry Pi Operating System based on Debian version 11 (bullseye). Setting up the graphical user interface (GUI) and performing installation updates were essential to ensure the system had the latest package versions. Python package updates were also necessary as the system heavily relied on the Python programming language for its scripts. The camera library was updated last since it was required to support the embedded camera in the microprocessor. The installation of a Python virtual environment was carried out to manage Python packages for different projects. Utilizing a Python virtual environment helped avoid installing Python packages globally, which could potentially conflict with system tools or other projects. Once the virtual environment was set up, TensorFlow and OpenCV were installed. These tools enabled on-device machine learning, allowing the system to run trained models on the Raspberry Pi. The dataset used was obtained from the TensorFlow website's repositories and consisted of an object detection model capable of detecting specific objects. Since the system controlled a motor, the installation of the General-Purpose Input and Output (GPIO) library was necessary, along with the PIGPIO Factory Library, which specialized in controlling the servo motor, within the virtual environment. The hardware component of the system body was constructed using 4x4 wood posts that formed a box frame and were covered with plywood. The 25 bottom part of the system had two drawers for containers of non-biodegradable and biodegradable components. The installation of the separator flap, along with the servo motor, enabled the machine to separate the biodegradable and non-biodegradable components. Ultrasonic distance sensors were attached to the supports in the receptacles to measure the level of garbage. The camera sensor and buzzer were installed in the upper part of the system. The component wires were organized using zip ties and cable clips, while PVC clamps were used for cable management. The system's electronics were placed inside a plastic enclosure to ensure proper protection from heat and moisture. II. Calibration Preparation: • Ensured that the sorting machine was placed in a suitable location with proper lighting and a stable power supply. • Verified that all the components, including the microprocessor, sensor, motors, and notification module, were properly connected and functioning. Initial Configuration: • Set up the image-based classification model on the microprocessor, which was responsible for processing the collected data. • Configured the model to distinguish between biodegradable and nonbiodegradable materials based on visual characteristics. • Established the classification thresholds or parameters to differentiate the two types of materials. Biodegradable Material Calibration: • Gathered a set of known biodegradable materials, such as food waste or plant-based products. • Introduced each biodegradable item, one at a time, into the sorting machine's input area. 26 • Allowed the sensor to capture images of the biodegradable materials and processed them using the image classification model. • Verified that the machine correctly identified and classified each biodegradable item as expected. • Adjusted the classification thresholds or parameters in the model to improve accuracy if there were any misclassifications. Non-biodegradable Material Calibration: • Collected a set of known non-biodegradable materials, such as plastic, glass, or metal objects. • Repeated the process described in step 3, but this time with the nonbiodegradable materials. • Ensured that the machine accurately classified the non-biodegradable items as intended. • Made necessary adjustments to the classification thresholds or parameters if any misclassifications occurred. Integration Calibration (Garbage Level): • Integrated the ultrasonic sensor into the system to measure the garbage level in the trash can. • Determined the appropriate ultrasonic sensor range and positioned it correctly to obtain accurate measurements. • Tested the sensor by filling the trash can with different levels of garbage and confirmed that the readings corresponded to the actual levels. • Adjusted any settings or thresholds related to garbage level detection to ensure reliable and accurate notifications. Validation and Finalization: • Conducted comprehensive tests using a variety of real-world garbage items, including both biodegradable and non-biodegradable materials. • Evaluated the machine's performance by introducing these items and verifying that it correctly classified them based on the established criteria. 27 • Monitored the garbage level measurements and ensured that the notification module provided accurate alerts to the user. Documentation: • Maintained detailed records of the calibration process, including the materials used, adjustments made, and the machine's performance during validation tests. • Documented the final configuration settings, classification thresholds, and any specific instructions or guidelines for future calibration or troubleshooting. 28 10. Process Flow on Testing The first step in process flow testing is to prepare the test plan and the test environment. This ensures that there are no unnecessary failures when executing the test. If additional testing is required, the process will return to the preparation stage. If not, the test results will be analyzed. If the tester is not satisfied with the results, the process will return to the execution stage, and testing will continue until satisfaction is achieved. Once the tester is satisfied with the results, the system will be considered complete and will proceed to the deployment stage. Figure 8 illustrates the process flow in the testing figure. Figure 8. Process Flow on Testing 29 Chapter V RESULTS AND DISCUSSION 1. Whole Prototype Machine The Prototype machine consists of two distinct processes. The first process is the sorting process, which is responsible for segregating the biodegradable and non-biodegradable components of the garbage. This process analyzes the garbage using computer vision to determine its classification and then employs mechanisms such as servo motors to separate and drop the garbage into the appropriate categories. The second process is the monitoring process, which continuously monitors the garbage level inside the receptacles. It utilizes sensors, such as ultrasonic sensors, to measure the level of garbage present. If the garbage reaches a maximum capacity, the system triggers a notification to alert the intended user about the state of the machine. This notification can be in the form of a buzzer or other alerting system. These two processes work together to enable efficient garbage sorting and monitoring in the Prototype machine. Figure 9. Whole System Prototype Machine 30 The System prototype machine is composed of microprocessor, servo motor, camera sensor, power supply, power distributor, jumping wires, buzzers, transistor, resistor, and LED. 2. Receptacles The receptacle of the system is located at the bottom part of the machine and serves as a container for holding the garbage. It is designed with two receptacle, one specifically designated for the biodegradable components and the other for the non-biodegradable components. This segregation allows for efficient sorting and disposal of the garbage. To enhance convenience and ease of maintenance, the receptacles can be installed with trash bags. The trash bags can be placed inside the drawers, providing a practical solution for collecting and disposing of the garbage. This way, when the drawers are full or need to be emptied, the trash bags can be easily removed and replaced, ensuring a hygienic and organized waste management system. Figure 10. Receptacles for the garbage container. 31 3. Enclosure and Electronics The enclosure plays a crucial role in safeguarding the electronic components of the system from potential damage caused by heat and moisture. It is designed with specific features to ensure optimal protection and functionality. To address heat-related concerns, the enclosure is equipped with a built-in fan. The fan helps in reducing the temperature inside the enclosure by promoting air circulation and dissipating heat generated by the electronic components. This cooling mechanism prevents overheating and ensures the components operate within safe temperature ranges. The choice of plastic material for the enclosure is deliberate as plastic is non-conductive and provides insulation. This insulation property helps protect the electronic components from moisture, dust, and other environmental factors that could potentially cause damage. Inside the enclosure, various electronic components are present, including the microprocessor (such as the Raspberry Pi), power supply, power distributor, transistor, resistor, and jumping wires. These components are carefully arranged and connected to ensure proper functioning of the system. Figure 11. System Enclosure and Electronics 32 4. Garbage Level Detector Module The garbage level detection system worked by using two ultrasonic distance sensors facing downward to the receptacles to measure the distance of the contents of the receptacles. In this method, the ultrasonic distance sensor would send signals to the microprocessor to measure the level of garbage. Figure 12. Level Detector System 33 5. Notification Module The system's notification system was made up of two primary components: the Buzzer module and the RGB Light Emitting Diode (LED). When the receptacles were full of garbage, the buzzer would warn the designated user while also blinking the red light. Additionally, when the intended user threw biodegradable garbage, the LED would light up green, and nonbiodegradable garbage would light up blue, to notify and alert the user of the type of garbage they threw. Figure 13. Buzzer module and RGB Light Emitting Diode (LED) 34 6. Separator Flap The Separator flap was powered by a Servo motor. This flap worked for the separation of biodegradable garbage and non-biodegradable garbage. When the garbage was biodegradable, the flap would turn clockwise, and it would turn counterclockwise for the non-biodegradable garbage. Figure 14. Servo Motor Figure 15. Separator flap powered by motor. 35 7. Camera Sensor The system's camera sensor was a Raspberry Pi camera module that would take a picture of the garbage. The optical sensor provided data to the microcontroller for the segregation process. Figure 16. Raspberry Pi Camera Module 36 8. Process of activating the machine using the command line of Linux in Raspberry pi operating system. Figure 17 shows the opening of the "tflite1" folder which contained all the data, including the Python Virtual Environment, Models, and Python Libraries. Figure 17. Opening the tflite1 folder 37 Figure 18 shows the activation of the Python virtual environment, which was done to manage Python packages inside the "tflite1" folder. Figure 18. Opening the Python Virtual Environment Figure 19 shows the activation of the General Pin Input Output (GPIO) library, which was done to enable communication between programs and scripts with the GPIO pins. Figure 19. Activation of General Pin Input Output (GPIO) library 38 Figure 20 shows the activation of the garbage classification program by running the python script "classify.py." The program predicts the top prediction class index, which is a value between 0 and 1, and the top prediction score. These results are then printed on the command line. The frame displayed is composed of 30 by 30 pixels and shows the categorization of the picture. Figure 20. Activation of classification of waste program 39 9. Confusion Matrix For the testing and evaluation of the machine's performance using four CNN models, a confusion matrix is used to assess and test the machine's capabilities. In Figure 21, the confusion matrix result is depicted for the ResNet152 model. Most of the garbage was correctly classified, with only a few instances of incorrect classifications. The ResNet152 model successfully categorized 596 pieces of garbage. Additionally, the model had three false positives, indicating that three biodegradable garbage items were mistakenly classified as non-biodegradable. It also had one false negative, meaning that one non-biodegradable garbage item was predicted as biodegradable. Figure 21. The confusion matrix of ResNet152 and the incorrectly classified garbage materials both in false positive and negative 40 Figure 22 depicts the result of the confusion matrix in the VGG16 model. Most of the garbage was correctly identified, with only a few exceptions. The VGG16 model accurately classified 581 items of garbage. However, it had the highest number of false positive and false negative values among the models. Approximately 14 biodegradable garbage items were projected as non-biodegradable, and 5 non-biodegradable garbage items were predicted as biodegradable. Figure 22. The confusion matrix of VGG16 and the incorrectly classified garbage materials both in false positive and negative 41 Figure 23 depicts the result of the confusion matrix in the MobileNet model. Most of the garbage was correctly identified, with only a few exceptions. The MobileNet model accurately classified 598 items of garbage. It had a low number of false positive and false negative values. Approximately 2 biodegradable garbage items were projected as nonbiodegradable, and no non-biodegradable garbage items were predicted as biodegradable. Figure 23. The confusion matrix of MobileNet and the incorrectly classified garbage materials both in false positive and negative 42 The confusion matrix of the Inceptionv3 model is shown in Figure 24. The Inceptionv3 model correctly categorized 598 pieces of garbage, with around 300 true positives and 298 true negatives. It also has the fewest false positive and false negative results, with about 0 biodegradable waste predicted as non-biodegradable garbage and 2 non-biodegradable garbage forecasted as biodegradable garbage. Figure 24. The confusion matrix of Inceptionv3 and the incorrectly classified garbage materials both in false positive and negative In summary, the evaluation of the four models revealed varying degrees of performance in classifying garbage. The VGG16 model had a relatively high number of misclassifications. The ResNet152 models showed lower rates of false positives and false negatives compared to the VGG16 model. The Inceptionv3 model and MobileNet model exhibited the highest overall accuracy and the fewest misclassifications. Based on these evaluation metrics, both the Inceptionv3 model and MobileNet model proved to be the most reliable and accurate models for garbage classification. 43 10. Discussion The machine consists of two main processes: sorting and monitoring. The sorting process segregates the garbage into biodegradable and nonbiodegradable components, while the monitoring process keeps track of the garbage level inside the receptacles and notifies the user about the machine's status. The prototype machine includes various components such as a microprocessor, servo motor, camera sensor, power supply, power distributor, jumping wires, buzzers, transistors, resistors, and LEDs. The receptacle, located at the bottom of the system, contains two drawers—one for biodegradable components and the other for non-biodegradable components. Trash bags can be installed in the receptacles for convenience. To protect the electronic components from heat and moisture, the machine has a plastic enclosure with a built-in fan for heat reduction. Inside the enclosure, there are electronic components including a microprocessor, power supply, power distributor, transistors, resistors, and jumping wires that connect to the sensors and motors. The garbage level detection system utilizes two downward-facing ultrasonic distance sensors to measure the distance of the contents inside the receptacles. These sensors send signals to the microprocessor, which measures the garbage level based on the received signals. The notification system of the machine consists of a Buzzer module and an RGB LED. When the receptacles are full of garbage, the buzzer sounds an alarm, and the red light on the LED blinks. Additionally, the LED lights up green when biodegradable garbage is thrown, and it lights up blue for non-biodegradable garbage, providing notification and alerting the user about the type of garbage being thrown. The Separator flap, powered by a servo motor, is responsible for separating biodegradable and non-biodegradable garbage. When biodegradable garbage is detected, the flap turns clockwise, and when nonbiodegradable garbage is detected, it turns counterclockwise. 44 In the evaluation of the machine's performance, four different models (ResNet152, VGG16, MobileNet, and Inceptionv3) were analyzed using confusion matrices. These matrices provided insights into the models' performance in classifying garbage as either biodegradable or nonbiodegradable.The ResNet152 model, as shown in Figure 30, exhibited a high level of accuracy, correctly categorizing the majority of the garbage samples. Out of the total garbage items, 596 were successfully classified. The model had three false positives, where three biodegradable garbage items were wrongly identified as non-biodegradable. Additionally, there was one false negative, indicating one non-biodegradable garbage item was mistakenly predicted as biodegradable. The VGG16 model, depicted in Figure 31, demonstrated good overall performance, accurately classifying 581 items of garbage. However, it had the highest number of false positives and false negatives among the evaluated models. Approximately 14 biodegradable garbage items were misclassified as non-biodegradable, and 5 non-biodegradable garbage items were incorrectly identified as biodegradable. The MobileNet model, shown in Figure 32, achieved satisfactory performance by accurately classifying 598 items of garbage. It had a low number of false positives and false negatives, with only around 2 biodegradable garbage items being projected as non-biodegradable. There were no instances of non-biodegradable garbage being predicted as biodegradable.The Inceptionv3 model's confusion matrix, illustrated in Figure 33, exhibited the best performance among the evaluated models. It correctly categorized 598 pieces of garbage, achieving a high number of true positives and true negatives, with approximately 300 instances of each. Notably, this model had the fewest false positives and false negatives. There were no instances of biodegradable waste being predicted as non-biodegradable. 45 Chapter VI CONCLUSION AND RECOMMENDATIONS 1. Conclusion The project "Intelligent Garbage Segregation Sorting Machine" concluded that the development of a prototype of an automatic garbage sorting machine was possible by using the technology of the Raspberry Pi, which was the system's microcomputer, and motors that classified the garbage. By using the image classification model, the computer could categorize nonbiodegradable and biodegradable components. It was also determined that all four models performed reasonably well in classifying garbage, with varying degrees of accuracy. Misclassifications were relatively common in the VGG16 model. When compared to the VGG16 model, the ResNet152 models demonstrated lower false positive and false negative rates. Based on the evaluation metrics provided, both the Inceptionv3 model and the MobileNet model displayed the best overall accuracy and the fewest misclassifications, making them the most dependable and accurate models for garbage categorization. It was also determined that the machine could use the ultrasonic sensor to determine the level of rubbish in the bin and successfully inform the user using the buzzer module. 46 2. Recommendations For future studies aimed at enhancing the mentioned project, it would be preferable to utilize an object detection model specialized in recognizing biodegradable and non-biodegradable garbage. Additionally, incorporating the Google Coral USB Accelerator would be a valuable addition. This small device provides hardware acceleration specifically designed for TensorFlow Lite models, making it ideal for machine learning applications. When used in conjunction with a Raspberry Pi, the Coral USB Accelerator significantly boosts the speed of object detection tasks by offloading computationally intensive operations. The Google Coral USB Accelerator can greatly enhance the performance of object detection tasks on a Raspberry Pi, resulting in faster and more accurate object detection, even for real-time video streams or highresolution images. To improve the machine's functionality, it would be beneficial to increase the height and width of the machine frame and consider using a larger flap to accommodate larger-sized garbage items. Moreover, employing a larger servo motor would generate sufficient power to effectively separate heavy garbage. Since the machine is embedded, it would be advantageous to incorporate Internet of Things (IoT) technology, particularly in the machine's notification module. Furthermore, developing a dedicated application for the machine would enable remote communication, allowing users to issue commands and retrieve data such as the current fill level of the bin and the history of garbage disposed of in the machine. 47 References Ayush, A., et al. (2020). Voice Controlled Automatic Dustbin with Garbage Level Sensing. In 2020 11th International Conference on Computing, Communication (ICCCNT) (pp. and 1-5). Networking IEEE. Technologies doi: 10.1109/ICCCNT49239.2020.9225275 Cockton, G. (2011). Usability evaluation methods for special interest groups: How many users are enough? In A. Marcus (Ed.), Design, User Experience, and Usability. Theory, Methods, Tools and Practice (pp. 231-240). Springer. Fawcett, T. (2006). An introduction to ROC analysis. Pattern Recognition Letters, 27, 861-874. Garg, S., et al. (2019). Smart waste management system using the internet of things. International Journal of Computer Applications, 179(28), 13-18. Gomez Corona, N, et al. (2016). A smart waste management system based on the ultrasonic sensor. IEEE Latin America Transactions, 14(9), 4156-4162. Greenbank. (2020). The challenges of poor waste management. Retrieved from https://www.greenbankwastesolutions.com/the-challenges-ofpoor-waste-management/ Gurjwar, R. K. (n.d.). Smart Trash Can Using IoT. Retrieved from https://www.hackster.io/rajiv-kumar-gurjwar/smart-trash-can-usingiot-6bfa92 48 Guyon, I., & Elisseeff, A. (2003). An introduction to variable and feature selection. Journal of Machine Learning Research, 3, 1157-1182. Hassenzahl, M., Schöbel, M., & Wagner, I. (2010). Tell me a good story and I may lend you my empathy: The influence of narratives on empathic design. Proceedings of the 2010 ACM conference on ComputerHuman Interaction, 207-216. https://doi.org/10.1145/1753326.1753354 Huang, C., & Zhu, W. (2016). A smart waste management system based on integrating technologies of IoT, cloud computing, and big data. In IEEE International Conference on Big Data Analysis (pp. 344-348). Kavipriya, P., Supriya, A., & Meena, S. (2020). Intelligent Trashcan Monitoring System Using IoT. International Journal of Innovative Technology and Exploring Engineering, 9(3), 2902-2906. doi: 10.35940/ijitee.L7893.029320 Kolhatkar, et al. (2018). Smart E-dustbin. 1-3. 10.1109/ICSCET.2018.8537245. Kumar, N., et al. (2016). IOT based smart garbage alert system using Arduino UNO. 1028-1034. doi:10.1109/TENCON.2016.7848162. Maritime Safety Queensland. (n.d.). Marine pollution. Retrieved from https://www.msq.qld.gov.au/Marine-pollution Metropolitan Transfer Station. (2017). Garbage disposal and its harmful effects. Retrieved from https://metropolitantransferstation.com.au/blog/garbage-disposalharmful-effects/ 49 Phua, C., Lee, V., Smith, K., & Gayler, R. (2010). A comprehensive survey of data mining-based fraud detection research. Artificial Intelligence Review, 33, 3-29. Raaju, V. A., Meeran, J. M., & Sasidharan, M. (2019). IoT Based Smart Garbage Monitoring System. In 2019 International Conference on Smart Electronics and Communication (ICOSEC) (pp. 211-215). IEEE. doi: 10.1109/ICOSEC45705.2019.9032985 Rahmayanti, H., Dewi, K. C., & Sari, S. S. (2020). The implementation of smart trash as the smart environment concept. Journal of Physics: Conference Series, 1460(1), 012032. Saha, H. N., Gon, S., & Nayak, A. (2018). IoT Based Garbage Monitoring and Clearance Alert System. International Journal of Innovative Research in Computer and Communication Engineering, 6(4), 2084-2089. Retrieved from https://www.ijircce.com/upload/2018/april/87_IJIRCCE%20%20Vo l%206,%20Issue%204,%20April%202018.pdf Samann, Fady. (2017). The Design and Implementation of Smart Trash Bin. Academic Journal of Nawroz University. 6. 141-148. 10.25007/ajnu.v6n3a103. Singhvi, R., Rishabh, L., Kumar, A., et al. (2019). IoT Based Smart Waste Management System: India prospective. International Journal of Innovative Technology and Exploring Engineering (IJITEE), 8(9), 2819-2822. doi: 10.35940/ijitee.J9198.088919 UN. (2022). Global e-waste monitor 2022. Retrieved from https://www.itu.int/en/ITUD/Environment/Pages/Events/2022/Global-E-waste-Monitor2022.aspx 50 Wang, X. et al. (2020). IoT-enabled waste management system for hazardous waste. Journal of Cleaner Production, 245, 118824. https://doi.org/10.1016/j.jclepro.2019.118824 Zhang, Y., Li, Z., & Zhang, W. (2020). Research on an intelligent garbage collection system based on the Internet of things. Journal of Physics: Conference Series, 1652(1), 012033. https://doi.org/10.1088/1742-6596/1652/1/012033 Zou, L., et al. (2020). IoT-based garbage machine for urban waste management. IEEE Internet of Things Journal, 8(24), 1-11. https://doi.org/10.1109/JIOT.2020.3049967 51 APPENDIX A List of Materials for the Intelligent Garbage Segregation Sorting Machine 52 Figure 25. Raspberry Pi Module 53 Figure 26. Raspberry Pi Camera 54 Figure 27. Ultrasonic Distance Sensor 55 Figure 28. Jumping Wires 56 Figure 29. Resistor 57 Figure 30. 12 Volts Fan 58 Figure 31. 12 volts Power Supply 59 Figure 32. Breadboard 60 Figure 33. Buzzer Module 61 Figure 34. Servo Motor 62 Figure 35. RGB LED 63 Figure 36. Plywood 64 APPENDIX B Building process of the prototype machine 65 Figure 37. Building the Box Frame 66 Figure 38. Electronics Installations 67 APPENDIX C Relevant Codes 68 I. Code for the Classifying Biodegradable Garbage and Non Biodegradable Garbage import cv2 import time import RPi.GPIO as GPIO import tflite_runtime.interpreter as tflite import numpy as np from tflite_support.task import core from tflite_support.task import processor from tflite_support.task import vision import RPi.GPIO as GPIO from gpiozero import Servo from time import sleep import pigpio from gpiozero import Servo from time import sleep from gpiozero.pins.pigpio import PiGPIOFactory factory = PiGPIOFactory() servo = Servo(25, pin_factory=factory) GPIO.setmode(GPIO.BCM) GPin=6 BPin=5 GPIO.setup(BPin,GPIO.OUT) GPIO.setup(GPin,GPIO.OUT) cap = cv2.VideoCapture(0) 69 cap.set(cv2.CAP_PROP_FPS, 30) model_path = '/home/pi/Downloads/model-DenseNet201-epoch67.tflite' interpreter = tflite.Interpreter(model_path=model_path) interpreter.allocate_tensors() input_details = interpreter.get_input_details() output_details = interpreter.get_output_details() while True: ret, img = cap.read() img = cv2.resize(img, (224, 224)) cv2.imshow('Frame', img) key = cv2.waitKey(1) & 0xFF img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) input_shape = input_details[0]['shape'] preprocessed_image = cv2.resize(img, (input_shape[2], input_shape[1])) preprocessed_image = preprocessed_image.reshape(input_shape) preprocessed_image = preprocessed_image.astype('float32') / 255.0 interpreter.set_tensor(input_details[0]['index'], preprocessed_image) interpreter.invoke() output_tensor = interpreter.get_tensor(output_details[0]['index']) # Decode the output tensor a = top_index = output_tensor.argmax() b = top_score = output_tensor[0][top_index] # Print the top prediction class index and score print("Top prediction class index: ", a) print("Top prediction score: ", b) 70 if a == 0: GPIO.output(GPin,1) servo.min() time.sleep(2) GPIO.output(GPin,0) servo.mid() time.sleep(2) elif a == 1: GPIO.output(BPin,1) servo.max() time.sleep(2) GPIO.output(BPin,0) servo.mid() time.sleep(2) cap.release() cv2.destroyAllWindows() 71 II. Code for Identifying the level of Biodegradable Garbage and NonBiodegradable Garbage in the bin. import cv2 import time import RPi.GPIO as GPIO import tflite_runtime.interpreter as tflite import numpy as np from tflite_support.task import core from tflite_support.task import processor from tflite_support.task import vision import RPi.GPIO as GPIO from gpiozero import Servo from time import sleep import pigpio from gpiozero import Servo from time import sleep from gpiozero.pins.pigpio import PiGPIOFactory factory = PiGPIOFactory() servo = Servo(25, pin_factory=factory) GPIO.setmode(GPIO.BCM) GPin=6 BPin=5 GPIO.setup(BPin,GPIO.OUT) GPIO.setup(GPin,GPIO.OUT) import RPi.GPIO as GPIO 72 import time GPIO.setmode(GPIO.BCM) buzzPin=17 trigPin=24 echoPin=23 trigPin1=27 echoPin1=22 RPin=16 GPIO.setup(RPin,GPIO.OUT) GPIO.setup(buzzPin,GPIO.OUT) GPIO.setup(trigPin,GPIO.OUT) GPIO.setup(echoPin,GPIO.IN) GPIO.setup(trigPin1,GPIO.OUT) GPIO.setup(echoPin1,GPIO.IN) try: while True: GPIO.output(trigPin,0) time.sleep(2E-6) GPIO.output(trigPin,1) time.sleep(10E-6) GPIO.output(trigPin,0) while GPIO.input(echoPin)==0: pass echoStartTime=time.time() while GPIO.input(echoPin)==1: pass echoStopTime=time.time() pingTravelTime=echoStopTime-echoStartTime result2=int(pingTravelTime*1E6) GPIO.output(trigPin1,0) time.sleep(2E-6) GPIO.output(trigPin1,1) time.sleep(10E-6) 73 GPIO.output(trigPin1,0) while GPIO.input(echoPin1)==0: pass echoStartTime1=time.time() while GPIO.input(echoPin1)==1: pass echoStopTime1=time.time() pingTravelTime1=echoStopTime1-echoStartTime1 result1=int(pingTravelTime1*1E6) print(result1) if result1<600: GPIO.output(buzzPin,GPIO.HIGH) GPIO.output(RPin,1) time.sleep(1) GPIO.output(buzzPin,GPIO.LOW) GPIO.output(RPin,0) time.sleep(1) if result2<600: GPIO.output(buzzPin,GPIO.HIGH) GPIO.output(RPin,1) time.sleep(1) GPIO.output(buzzPin,GPIO.LOW) GPIO.output(RPin,0) time.sleep(1) if result2>600: time.sleep(.1) if result1>600: time.sleep(.1) except KeyboardInterrupt: GPIO.cleanup() print('goo') 74 cap.release() cv2.destroyAllWindows() 75 APPENDIX D Grammarian Certificate 76 77 APPENDIX E Plagiarism Evaluation Result 78 79