Perbandingan Kinerja Algoritma K-Nearest Neighbor dan Random Forest untuk Klasifikasi Citra Sampah Organik dan Anorganik Berbasis Web

Penulis

  • Baitul Anam Anam Universitas Ibrahimy Situbondo

Abstrak

Abstrak

Permasalahan pengelolaan sampah organik dan anorganik masih menjadi tantangan di berbagai daerah akibat rendahnya tingkat pemilahan sampah oleh masyarakat. Pemanfaatan teknologi kecerdasan buatan melalui machine learning dapat membantu proses klasifikasi sampah secara otomatis dan lebih efisien. Penelitian ini bertujuan untuk membandingkan kinerja algoritma K-
Nearest Neighbor (KNN) dan Random Forest dalam klasifikasi sampah organik dan anorganik berbasis web. Penelitian ini menggunakan desain penelitian eksperimen dengan pendekatan kuantitatif. Dataset terdiri dari 2.513 citra sampah organik dan anorganik yang dibagi menjadi data latih sebanyak 2.010 data dan data uji sebanyak 503 data menggunakan rasio split 80:20. Teknik pengumpulan data dilakukan melalui dataset citra digital sampah. Variabel independen dalam penelitian ini adalah algoritma KNN dan Random Forest, sedangkan variabel dependen adalah hasil klasifikasi sampah. Analisis data dilakukan menggunakan confusion matrix dengan parameter accuracy, precision, recall, dan F1-score. Hasil penelitian menunjukkan bahwa algoritma Random
Forest memiliki performa lebih baik dibandingkan algoritma KNN. Algoritma KNN memperoleh nilai accuracy sebesar 83.90%, precision 89.64%, recall 80.36%, dan F1-score 84.75%. Sementara itu, algoritma Random Forest memperoleh accuracy sebesar 86.48%, precision 85.10%, recall 91.79%, dan F1-score 88.32%. Hasil confusion matrix menunjukkan bahwa Random Forest mampu mengidentifikasi sampah organik dan anorganik dengan tingkat klasifikasi yang lebih stabil. Algoritma Random Forest memiliki performa klasifikasi yang lebih baik dibandingkan KNN dalam klasifikasi sampah organik dan anorganik berbasis web. Implementasi sistem berbasis web dapat membantu proses identifikasi sampah secara otomatis sehingga mendukung pengelolaan sampah yang lebih efektif.
Kata kunci: Klasifikasi Sampah, K-Nearest Neighbor, Random Forest, Machine Learning

Abstract

The problem of organic and inorganic waste management remains a challenge in various regions due to the low level of waste sorting by the community. The use of artificial intelligence technology through machine learning can help the waste classification process automatically and more efficiently. This study aims to compare the performance of the K-Nearest Neighbor (KNN) and
Random Forest algorithms in web-based organic and inorganic waste classification. This study uses an experimental research design with a quantitative approach. The dataset consists of 2,513 images of organic and inorganic waste divided into 2,010 training data and 503 test data using a split ratio of 80:20. The data collection technique is carried out through a digital waste image dataset. The
independent variables in this study are the KNN and Random Forest algorithms, while the dependent variable is the waste classification results. Data analysis was carried out using a confusion matrix with parameters of accuracy, precision, recall, and F1-score. The results show that the Random Forest algorithm has better performance than the KNN algorithm. The KNN algorithm achieved an accuracy of 83.90%, precision of 89.64%, recall of 80.36%, and F1-score of 84.75%. Meanwhile, the Random Forest algorithm achieved an accuracy of 86.48%, precision of 85.10%, recall of 91.79%, and F1-score of 88.32%. The confusion matrix results show that Random Forest is able to identify organic and inorganic waste with a more stable classification level. The Random Forest
algorithm has better classification performance than KNN in web-based organic and inorganic waste classification. The implementation of a web-based system can help the process of automatic waste identification, thereby supporting more effective waste management.
Keyword: Garbage Classification, K-Nearest Neighbor, Random Forest, Machine Learning

Diterbitkan

2026-07-10