Automated Trash Sorting System

Sumiyajid Ulziibayar

First Supervisor: Myagmarjav. B

Second Supervisor: Narangarav.T

November 24, 2025

The Global Waste Crisis

70%

Projected Growth

Global waste production increase by 2050 unless urgent action is taken

60%

Uncollected Waste

Garbage remains uncollected in low- and middle-income countries

7%

Mongolia's Recycling

Only 7% of Mongolia's 3 million tonnes of waste is recycled annually

Mongolia's Waste Challenge

Ulaanbaatar's Burden

The capital contributes nearly 60% of Mongolia's solid waste, with most ending up in open dumpsites like Nalaikh and Tsagaan Davaa landfills.

These sites pose serious environmental and health risks due to leachate contamination and spontaneous combustion.

Behavioral Barriers

Waste segregation is seen as a chore with little reward. Low participation rates stem from lack of incentives and sorting infrastructure.

The Nalaikh District proposed this project to modernize community waste handling through technology and behavioral design.

Project Objectives

01

Automated Classification

Design a system capable of identifying waste materials using computer vision with >90% accuracy

02

Behavioral Incentives

Establish a reward-based system to encourage consistent waste sorting through feedback and competition

03

Technical and economic feasibility

The final model should be easy to maintain with scalable design, and economically feasible.

System Scope

Three-Class Classification

Plastic Bottles, Metal Cans, and Others (paper, cardboard, glass, organic materials)

Precision Actuation

Stepper motor and servo mechanisms for reliable physical separation into designated bins

Data Integration

Camera-based vision system with high-precision weight sensor for enhanced accuracy

Reward System

Server-side framework for user tracking and group-based competition targeting school children

High-Level System Architecture

Raspberry Pi

CNN inference, image processing, main controller

ESP32

Motor control, sensor reading, actuation logic

Web Server

User tracking, reward system, leaderboards

The system uses modular components (Raspberry Pi, ESP32) to ensure scalability and easy replication in similar community settings.

Hardware Components

Raspberry Pi

Main computing unit for user interface, information updates, and upload

ESP32 Microcontroller

Handles motor control, sensor reading, and actuation commands

1080p USB Camera

Captures images for classification with integrated LED lighting

Load Cell

Measures item weight (5kg capacity) for enhanced classification accuracy and user progress tracking

NEMA 17 Stepper

Provides precise positioning for multi-bin sorting mechanism

Servo Motors

Controls trapdoors or latch mechanisms for bin access

Circuit Architecture

Electrical components and drivers

Raspberry pi

ESP-32

A4988

PCA9685

HX711

IR sensors

MPPT controller

Buck convertors

Voltage regulators

Power Management

  • 12V DC for stepper motors
  • 5V for Raspberry Pi and servos
  • 3.3V for ESP32 and sensors
  • Solar backup with 30Ah battery for outdoor deployment

Software Stack

1

Python (Raspberry Pi)

CNN model inference, image preprocessing, server communication, main control logic

2

C++ (ESP32)

Real-time motor control, sensor polling, serial communication handling, actuation sequences

3

Communication Protocols

Serial for Pi-ESP32, HTTP/HTTPS for server, JSON for structured data exchange

4

Web Application

MySQL database, user dashboard, classroom leaderboards, QR code activation system

Data Flow Process

1

QR code access

User interaction

2

Item Detection

IR sensor detects garbage

3

Data Capture

Camera captures image, load cell measures weight simultaneously

4

CNN Classification

Image sent to CNN model, returns classification result in JSON format

5

Actuation Decision

Raspberry Pi sends command to ESP32 based on classification result

6

Data update

The weight of the trash is then sent to the server for user progress tracking

System Requirements

Performance

  • Classification accuracy >90%
  • Inference time <1 second
  • Throughput: 10 items/minute
  • System uptime >95%

Environmental

  • Operating range: -30°C to +30°C
  • Dust/moisture resistant (IP54)
  • Insulated against freezing
  • Weatherproof enclosure

Connectivity

  • Wi-Fi (2.4 GHz) or cellular
  • Data transmission delay <3s
  • HTTPS encryption for security

AI Model & Training

Dataset Overview

Mongolian Waste Database

Custom dataset created specifically for local waste characteristics, addressing the gap in existing datasets.

Public contribution system via web interface allows continuous dataset growth and improvement.

  • 400+ images collected over one month
  • Three categories: Plastic, Metal, Others
  • Images preprocessed automatically upon upload

Initial Training Data

TrashNet dataset used for baseline training with six categories: cardboard, glass, metal, paper, plastic, and trash.

Thousands of labeled images provided foundation for transfer learning approach.

Data Preprocessing Pipeline for training

1

Image Resizing

All images standardized to 224×224 pixels for consistent model input

2

Normalization

Pixel values scaled between 0 and 1 to improve convergence

3

Data Augmentation

Random flipping, rotation, zoom, and brightness adjustments

4

Train/Val Split

80% training data, 20% validation, with separate test set

Augmentation techniques simulate real-world variations in lighting and object positions, making the model more robust to environmental interference.

CNN Architecture Explained

Convolutional Layer

Learnable filters scan input to detect spatial patterns like edges and textures

Activation Function

ReLU introduces non-linearity, enabling complex pattern recognition

Pooling Layer

Down-samples feature maps, reducing dimensions while preserving key features

Dense Layers

Fully connected neurons combine features for final classification

Softmax Output

Converts scores to probability distribution across waste categories

Convolutional Operations

The convolutional layer uses learnable filters (kernels) to scan the input image, generating output feature maps that detect spatial patterns.

Key Concepts

  • Local Connectivity: Each neuron connects only to a small region (receptive field)
  • Weight Sharing: Same filter weights used across all spatial positions
  • Translation Invariance: Detects features regardless of position in image
  • Multi-Channel Processing: Analyzes RGB channels simultaneously for color-dependent patterns

Benefits

Reduces learnable parameters compared to fully connected layers, improving computational efficiency and reducing overfitting risk.

Pooling Operations

Purpose

Pooling layers perform down-sampling to reduce spatial dimensions while maintaining essential features.

Max Pooling

Most commonly used function due to its ability to effectively map features within an image. Selects maximum value from each region.

Advantages

  • Reduces computational load
  • Provides translation invariance
  • Prevents overfitting
  • Maintains important features

Transfer Learning Approach

Base Models Tested

  • EfficientNetB0
  • EfficientNetV2 variants
  • ResNet50
  • MobileNetV2

All models pre-trained on ImageNet, enabling complex feature learning from extensive datasets.

Training Strategy

First half of base model layers frozen to preserve learned features. New classification head added for 6-class waste problem.

Adam optimizer with 1e-4 learning rate, categorical cross-entropy loss function, 15-30 epochs with early stopping.

Class weights computed to handle imbalanced dataset, ensuring fair representation of all waste categories.

Model Training Results

EfficientNetB0 achieved the highest classification accuracy of 91.97% on the test dataset, exceeding the 90% target. It offers the best trade-off between speed and accuracy for deployment.


Performance Metrics

91.97%

Test Accuracy

EfficientNetB0 model performance on held-out test set

0.91

F1-Score

Balanced measure of precision and recall across all classes

0.18

Validation Loss

Low loss indicates good model convergence and generalization

Precision and recall values exceeded 0.90 for main categories, confirming consistent performance. However, the model requires further training on Mongolian-specific waste data for reliable deployment.

Web Application Integration

QR Code Activation

When idle, Raspberry Pi displays QR code on screen. Scanning activates the system and prepares components for waste processing.

Direct camera activation available through web interface for seamless user experience.

Reward System Features

  • Interactive map showing all smart bin locations
  • Individual user contribution dashboard
  • Classroom/school leaderboard rankings
  • Real-time statistics and progress tracking

Behavioral Design Strategy

Competition

Group-based leaderboards motivate consistent participation

Gamification

Points and achievements make sorting engaging and rewarding

Social Recognition

Visible rankings provide peer motivation and accountability

Habit Formation

Targeting children creates long-term behavioral change

Progress Tracking

Real-time feedback reinforces positive sorting behavior

Database Structure

1

Users & Classrooms

Tracks individual contributions and classroom affiliations. Links users to their total recycling weight and classroom rankings.

2

Devices & Bins

Maintains device locations, serial numbers, and bin configurations. Monitors device health and last connection times.

3

Reports

Records every disposal event with classification, weight, image URL, and user ID. Enables analytics and leaderboard generation.

4

Misclassifications

Stores human corrections of AI errors. Creates feedback loop for continuous model improvement.

Mechanical Design Requirements

Structural Integrity

Robust construction to withstand outdoor conditions, resisting corrosion, impact, and fatigue for long-term operation.

Precise Actuation

Accurate sorting mechanisms with controlled movement for reliable separation of different waste categories.

User Safety & Accessibility

Features to prevent injury during interaction, including clear interfaces and easily accessible emergency stop mechanisms.

Weather Resistance

Enclosures and components rated for extreme temperatures, precipitation, and UV exposure for reliable outdoor deployment.

Maintenance Accessibility

Modular design allowing easy access to internal components for quick repairs, cleaning, and preventative maintenance.

Size Constraints

Optimized dimensions for efficient space utilization in various urban and rural deployment scenarios.

Mechanical Configuration

The input bin and integrated weighing system underwent extensive design and testing through multiple iterations.

  1. 1 moving stepper design
  1. 2 servo design
  1. 1 stepper with multi servo design
  1. 1 servo 1 stepper design
  1. 1 servo with 2 stepper design

This iterative approach allowed us to refine the mechanical configuration for optimal performance, durability, and user interaction, resulting in the current design of the prototype.

Figure shows a 3D design drawn on cad.onshape.com that was not completed

Other smaller parts were 3D printed uniquely custom to the project.


Key Achievements

Classification Success

CNN model achieved 91.97% accuracy, exceeding the 90% target requirement

Dataset Creation

Established first public Mongolian waste image database with 400+ labeled images

Modular Architecture

Developed scalable system supporting multiple deployment scenarios and configurations

Web Platform

Created functional reward system with real-time tracking and classroom leaderboards


ESP-32 code functions

Main Functional Flow:

01

Lift up

02

Measure weight

03

Lower lift

04

Move box

05

Open latch

06

Return to positions

System Features & Control Interface

Weighing Functionality

  • Automated lift sensor positioning for precise measurements
  • Real-time weight sampling with HX711 and data averaging
  • Tare functionality for empty box weight calibration

Motor Control

  • Non-blocking stepper motor movements for simultaneous operations
  • Horizontal box positioning and vertical lift control
  • Precise positioning with step-based movement tracking

Demo Mode

  • Automated sequence: move box → unlock latch → wait → lock latch → return
  • Interactive serial command interface for manual control
  • Status reporting for system state monitoring

Current Limitations with future improvements

Partial Integration

System modules functional individually but not yet assembled into unified physical device due to late hardware arrival.

Dataset Size

Mongolian waste dataset still limited (400 images). Model requires retraining with more local data for reliable deployment.

Field Testing

No long-term operational validation yet. System performance under continuous real-world use remains to be evaluated.

Mechanical Design

Enclosure manufacturing and full mechanical assembly pending. Weather protection for outdoor deployment not yet implemented.

Electrical configuration

The final product will be using a custom printed PCB with IR sensors and Limit switches, and possibly other sensors such as NIR.

Connectivity

The model will be recieving A7670E SIM module for LTE connection incase of no WiFi availibility.

Future Work plan until June

Dataset Expansion

Continue collecting Mongolian waste images through public web interface. Target 2000+ images for robust model retraining.

Physical Assembly

Complete hardware integration into cohesive prototype. Manufacture weatherproof enclosure for outdoor deployment.

GMIT Pilot

Deploy system at GMIT to observe user behavior, system reliability, and long-term data consistency.

Optimization

Enhance communication stability, power efficiency, and cloud scalability for broader deployment across schools.

Thank You

This project demonstrates how engineering, AI, and human-centered design can converge to tackle Mongolia's urban waste challenges.

"The Automated Trash Sorting System stands not only as a technical prototype but also as a stepping stone toward building a culture of responsible waste handling in Mongolia."


Questions?

Made with