You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

Intelligent Waste Classification Using Deep Learning for Improved Urban Waste Segregation in Sri Lanka

Research repository for deep learning-based waste classification and cross-geographic generalization analysis using TrashNet and a newly constructed Sri Lankan waste image dataset.

University of Vavuniya, Sri Lanka — 2025


Abstract

This research investigates the geographic generalization limitations of deep learning-based waste classification models trained on foreign benchmark datasets when applied to Sri Lankan urban waste images. A pre-trained model achieving 96.99% accuracy on TrashNet dropped to only 36.84% when evaluated on locally collected Sri Lankan waste images, confirming a significant geographic domain shift. A new locally collected Sri Lankan waste image dataset was constructed under methodology-matched conditions and evaluated across six CNN architectures and ten dataset configurations covering foreign-only, local-only, cross-domain, and mixed-domain training strategies, with and without class-balanced augmentation. Results demonstrate severe cross-domain performance degradation and show that mixed-domain training with class-balanced augmentation substantially improves local classification robustness, with ResNet50+SE achieving 93.68% accuracy on the Sri Lankan test set.

Keywords: Waste classification, deep learning, geographic generalization, Squeeze-and-Excitation blocks, ResNet50, TrashNet, data augmentation


Research Methodology

Research Methodology Diagram


Overview

This repository contains the datasets, training scripts, and experimental results for the research titled "Intelligent Waste Classification Using Deep Learning for Improved Urban Waste Segregation in Sri Lanka." This work investigates the geographic generalization failure of deep learning-based models trained on foreign benchmark datasets when applied to locally collected waste images, and proposes data-centric strategies to overcome this limitation.

To address this gap, a new locally collected waste image dataset was constructed, six state-of-the-art CNN architectures were evaluated across ten dataset configurations, and a data-centric mixed-domain training strategy was proposed and validated — demonstrating that improved generalization can be achieved through data composition alone without architectural modifications.


Research Objectives

# Objective
1 Establish baseline performance on foreign and local waste datasets
2 Quantify cross-geographic generalization failure
3 Isolate contextual differences between foreign and Sri Lankan waste streams
4 Propose and evaluate a data-centric dataset integration strategy
5 Assess whether improved generalization can be achieved solely through data composition
6 Provide empirical evidence for deploying deep learning-based waste classification in Sri Lanka

Datasets

This repository includes two source datasets. The dataset-resized folder contains the TrashNet benchmark dataset with 2,527 images across six waste categories, collected under controlled conditions with a uniform white background. Images follow the original TrashNet naming convention and have not been modified. The sri-lanka-dataset folder contains 1,300 images captured using smartphone cameras in an indoor controlled setting with a white background to match TrashNet's visual presentation. Images are named using the convention lk-{category}-{number}.jpg and augmented versions follow the convention lk-{category}-{number}(AUG.V{version}).jpg. The excluded folder contains 334 images manually removed during curation, provided for reference as they may be useful to other researchers.

Both datasets share the same six waste categories: Cardboard, Glass, Metal, Paper, Plastic, and Trash.

Source Dataset Distribution

Category TrashNet Sri Lankan
Cardboard 403 180
Glass 501 123
Metal 410 206
Paper 594 39
Plastic 482 375
Trash 137 377
Total 2,527 1,300

Data Augmentation

Class-balanced geometric augmentation was applied to address class imbalance. The largest class in each dataset was used as the target count, and all other classes were augmented to match using the following transformations: random horizontal and vertical reflection, random translation up to 30 pixels, random rotation up to 3 degrees, random scaling between 0.8 and 1.2, and random shearing up to 5 percent. After augmentation, all six classes are balanced to 594 images per class in TrashNet and 377 images per class in the Sri Lankan dataset.

Dataset Configurations

Ten dataset configurations were constructed from the two source datasets, organized into standard and augmented subfolders. Each configuration contains train, val, and test splits across the six categories.

Standard Configurations — Image Counts

Dataset Split Cardboard Glass Metal Paper Plastic Trash Total
lk70-lk15-lk15 Train 125 86 144 27 262 263 907
lk70-lk15-lk15 Val 27 18 30 5 56 56 192
lk70-lk15-lk15 Test 28 19 32 7 57 58 201
trashnet70-trashnet15-trashnet15 Train 282 350 287 415 337 95 1,766
trashnet70-trashnet15-trashnet15 Val 60 75 61 89 72 20 377
trashnet70-trashnet15-trashnet15 Test 61 76 62 90 73 22 384
trashnet80-trashnet20-lk100 Train 322 400 328 475 385 109 2,019
trashnet80-trashnet20-lk100 Val 81 101 82 119 97 28 508
trashnet80-trashnet20-lk100 Test 180 123 206 39 375 377 1,300
trashnet80-trashnet20-lk15 Train 322 400 328 475 385 109 2,019
trashnet80-trashnet20-lk15 Val 81 101 82 119 97 28 508
trashnet80-trashnet20-lk15 Test 28 19 32 7 57 58 201
trashnet80+lk70-trashnet20+lk15-lk15 Train 447 486 472 502 647 372 2,926
trashnet80+lk70-trashnet20+lk15-lk15 Val 108 119 112 124 153 84 700
trashnet80+lk70-trashnet20+lk15-lk15 Test 28 19 32 7 57 58 201

Augmented Configurations — Image Counts

Dataset Split Cardboard Glass Metal Paper Plastic Trash Total
lk70-lk15-lk15-augmented Train 263 263 263 263 263 263 1,578
lk70-lk15-lk15-augmented Val 56 56 56 56 56 56 336
lk70-lk15-lk15-augmented Test 58 58 58 58 58 58 348
trashnet70-trashnet15-trashnet15-augmented Train 415 415 415 415 415 415 2,490
trashnet70-trashnet15-trashnet15-augmented Val 89 89 89 89 89 89 534
trashnet70-trashnet15-trashnet15-augmented Test 90 90 90 90 90 90 540
trashnet80-trashnet20-lk100-augmented Train 475 475 475 475 475 475 2,850
trashnet80-trashnet20-lk100-augmented Val 119 119 119 119 119 119 714
trashnet80-trashnet20-lk100-augmented Test 377 377 377 377 377 377 2,262
trashnet80-trashnet20-lk15-augmented Train 475 475 475 475 475 475 2,850
trashnet80-trashnet20-lk15-augmented Val 119 119 119 119 119 119 714
trashnet80-trashnet20-lk15-augmented Test 58 58 58 58 58 58 348
trashnet80+lk70-trashnet20+lk15-lk15-augmented Train 738 738 738 738 738 738 4,428
trashnet80+lk70-trashnet20+lk15-lk15-augmented Val 175 175 175 175 175 175 1,050
trashnet80+lk70-trashnet20+lk15-lk15-augmented Test 58 58 58 58 58 58 348

Scripts

The scripts folder contains three data preparation scripts and six model training notebooks.

dataset-split-70-15-15.py splits a source dataset into 70/15/15 train/val/test splits. dataset-split-80-20.py splits a source dataset into 80/20 train/val splits. dataset-augment-balance.py performs class-balancing geometric augmentation using random reflection, translation, rotation, scaling, and shearing, producing augmented images named in the (AUG.V1) convention.

The six model training notebooks are ConvNeXtTiny.ipynb, DenseNet201.ipynb, EfficientNetV2S.ipynb, InceptionV3.ipynb, MobileNetV2.ipynb, and ResNet50-SE.ipynb. All models were implemented using TensorFlow/Keras with ImageNet pre-trained weights and a custom six-class classification head.


Deep Learning Models

Six CNN architectures were selected for comparative evaluation. All models were initialized with ImageNet pre-trained weights, backbone layers were frozen during training, and a custom classification head was added consisting of a Global Average Pooling layer, a Dropout layer with a rate of 0.3, and a Dense output layer with six units and softmax activation.

Model Architecture Type
ConvNeXtTiny Modern pure ConvNet design
DenseNet201 Dense connectivity with feature reuse
EfficientNetV2S Compound scaling with training-aware design
InceptionV3 Multi-scale feature extraction
MobileNetV2 Lightweight mobile-optimized architecture
ResNet50+SE Residual learning with Squeeze-and-Excitation attention blocks

Training Configuration

Setting Value
Framework TensorFlow 2.19.0 / Keras
Optimizer Adam (lr=0.001, β1=0.9, β2=0.999)
Loss Function Sparse Categorical Crossentropy
Batch Size 32
Epochs 50 (25 for ResNet50+SE)
Transfer Learning ImageNet weights, backbone frozen
Environment Google Colab, Tesla T4 GPU
Python 3.10.12

Experimental Design

A total of 60 independent experiments were conducted: 6 models × 10 dataset configurations (5 standard + 5 augmented). Each experiment was initialized fresh with ImageNet weights to prevent weight leakage across runs.

Configuration Training Validation Test Purpose
lk70-lk15-lk15 Sri Lankan 70% Sri Lankan 15% Sri Lankan 15% Local in-domain baseline
trashnet70-trashnet15-trashnet15 TrashNet 70% TrashNet 15% TrashNet 15% Foreign benchmark baseline
trashnet80-trashnet20-lk100 TrashNet 80% TrashNet 20% Sri Lankan 100% Worst-case cross-domain
trashnet80-trashnet20-lk15 TrashNet 80% TrashNet 20% Sri Lankan 15% Standardized cross-domain
trashnet80+lk70-trashnet20+lk15-lk15 TrashNet 80% + Sri Lankan 70% TrashNet 20% + Sri Lankan 15% Sri Lankan 15% Mixed-domain adaptation

The experiments folder contains results for all 60 runs organized into standard and augmented subfolders, each containing a folder per model. Each result folder contains the training accuracy plot, training loss plot, confusion matrix, classwise metrics CSV, epochwise metrics CSV, overall metrics CSV, and the saved model in .keras format.


Results

Geographic Generalization Failure

Models trained solely on TrashNet suffer severe accuracy drops when tested on locally collected waste images, confirming a strong geographic domain shift.

Model TrashNet Accuracy Cross-Domain Accuracy Performance Drop
ConvNeXtTiny 94.07% 52.01% −42.06%
DenseNet201 74.44% 17.82% −56.62%
EfficientNetV2S 92.78% 54.02% −38.76%
InceptionV3 48.52% 25.29% −23.23%
MobileNetV2 74.63% 23.85% −50.78%
ResNet50+SE 93.70% 40.52% −53.18%

Overall Model Performance — Standard (No Augmentation)

Model LK Only TrashNet Only Cross-Domain (Full) Cross-Domain (15%) Mixed
ConvNeXtTiny 78.61% 89.58% 48.31% 47.26% 76.62%
DenseNet201 59.20% 76.30% 20.23% 21.39% 54.73%
EfficientNetV2S 82.09% 87.76% 49.46% 50.25% 76.12%
InceptionV3 52.24% 39.84% 18.85% 15.92% 36.82%
MobileNetV2 61.69% 74.22% 25.69% 21.89% 55.22%
ResNet50+SE 81.59% 85.16% 36.77% 34.83% 81.59%

Overall Model Performance — Augmented

Model LK Only TrashNet Only Cross-Domain (Full) Cross-Domain (15%) Mixed
ConvNeXtTiny 91.09% 94.07% 46.95% 52.01% 87.64%
DenseNet201 76.15% 74.44% 22.50% 17.82% 62.36%
EfficientNetV2S 92.53% 92.78% 50.09% 54.02% 91.95%
InceptionV3 56.32% 48.52% 17.77% 25.29% 37.36%
MobileNetV2 71.55% 74.63% 25.69% 23.85% 60.06%
ResNet50+SE 92.82% 93.70% 38.82% 40.52% 93.68%

Best Performing Model per Configuration

Type Configuration Best Model Accuracy F1-Score
Standard lk70-lk15-lk15 EfficientNetV2S 82.09% 0.7910
Standard trashnet70-trashnet15-trashnet15 ConvNeXtTiny 89.58% 0.8906
Standard trashnet80-trashnet20-lk100 EfficientNetV2S 49.46% 0.4322
Standard trashnet80-trashnet20-lk15 EfficientNetV2S 50.25% 0.4650
Standard trashnet80+lk70-trashnet20+lk15-lk15 ResNet50+SE 81.59% 0.8027
Augmented lk70-lk15-lk15 ResNet50+SE 92.82% 0.9271
Augmented trashnet70-trashnet15-trashnet15 ConvNeXtTiny 94.07% 0.9408
Augmented trashnet80-trashnet20-lk100 EfficientNetV2S 50.09% 0.4908
Augmented trashnet80-trashnet20-lk15 EfficientNetV2S 54.02% 0.5265
Augmented trashnet80+lk70-trashnet20+lk15-lk15 ResNet50+SE 93.68% 0.9361

Class-Wise Performance — Best Model (ResNet50+SE, Augmented Mixed Training)

Class Precision Recall F1-Score
Cardboard 0.9636 0.9138 0.9381
Glass 0.9508 1.0000 0.9748
Metal 0.9344 0.9828 0.9580
Paper 0.9667 1.0000 0.9831
Plastic 0.8644 0.8793 0.8718
Trash 0.9423 0.8448 0.8909

Key Findings

  1. Geographic generalization failure is significant and consistent across all six architectures, with accuracy drops of up to 53 percentage points when models trained on TrashNet are evaluated on locally collected waste images.
  2. Models trained solely on augmented local data perform best for most architectures, with ResNet50+SE and EfficientNetV2S reaching 92.82% and 92.53% accuracy respectively.
  3. Mixed-domain training is highly effective for high-capacity architectures. ResNet50+SE achieves 93.68% accuracy under augmented mixed training, outperforming even local-only training, demonstrating that TrashNet data can complement local diversity without reducing domain relevance.
  4. Class-balanced data augmentation consistently improves performance across all training strategies and all architectures.
  5. Source-domain augmentation alone does not resolve cross-domain generalization failure. Models trained on augmented TrashNet data still achieve only around 50% accuracy on locally collected waste images.

Requirements

pip install tensorflow==2.19.0 numpy pandas matplotlib scikit-learn pillow openpyxl
Package Version
Python 3.10.12
TensorFlow 2.19.0
Keras bundled with TensorFlow
NumPy latest
Pandas latest
Matplotlib latest
scikit-learn latest
Pillow latest

How to Reproduce

Step 1 — Prepare dataset splits:

python dataset-split-70-15-15.py
python dataset-split-80-20.py

Step 2 — Generate augmented datasets:

python dataset-augment-balance.py

Step 3 — Train models:

Open the desired notebook in Google Colab or Jupyter, set the dataset path, and run. Each notebook trains one model and saves accuracy and loss curves, confusion matrix, overall metrics, classwise metrics, epochwise metrics, and the trained model file.


Research Contributions

  1. Empirical evidence of geographic generalization failure in deep learning-based waste classification, demonstrated through controlled cross-dataset evaluation.
  2. A novel locally collected waste image dataset constructed under methodology-matched conditions for fair cross-domain benchmarking.
  3. A systematic cross-domain evaluation framework separating in-domain performance from cross-domain transfer.
  4. A data-centric dataset integration strategy demonstrating that mixing foreign and local data with class-balanced augmentation significantly improves local classification robustness without architectural modifications.
  5. Practical insights for deploying intelligent waste classification systems in developing countries, with a focus on the Sri Lankan urban context.

Citation

If you use this dataset or any part of this work in your research, please cite:

R. Logeesan, H. M. P. H. S. Herath, R. P. D. Kuruneru, and N. Venuja (Research Advisor), "Intelligent Waste
Classification Using Deep Learning for Improved Urban Waste Segregation in Sri
Lanka," BICT Honours Thesis, Department of Information and Communication
Technology, Faculty of Technological Studies, University of Vavuniya, Sri Lanka,
2025.

Authors

R. Logeesan H. M. P. H. S. Herath R. P. D. Kuruneru

Research Advisor: Ms. N. Venuja, B.Sc.(Special)(UOJ), M.Sc.(UOP) Lecturer (Probationary), Department of Information and Communication Technology Faculty of Technological Studies, University of Vavuniya, Sri Lanka Research Interests: Data Science, Deep Learning, Machine Learning, Image Processing Faculty Profile


License

The TrashNet dataset (dataset-resized) is subject to its original license as published by Gary Thung and Mindy Yang. The locally collected Sri Lankan waste image dataset (sri-lanka-dataset), scripts, and experimental results are copyright © 2025 R. Logeesan, H. M. P. H. S. Herath, and R. P. D. Kuruneru, University of Vavuniya, Sri Lanka. All rights reserved. This dataset is made available for academic review purposes only. Downloading, redistribution, reproduction, or any use of this dataset or any part thereof without explicit written permission from the authors is strictly prohibited. For access requests, please contact the authors through the University of Vavuniya, Department of Information and Communication Technology.


Downloads last month
8