Circular Economy • Edge AI & Logistics

E-Zero: Edge CV & Reverse Logistics for Industrial E-Waste

Over 62 million metric tonnes of electronic waste are discarded annually, yet less than 22% is documented as formally recycled. Here is how we engineered E-Zero: an edge AI platform combining client-side WebGPU component segmentation, algorithmic scrap commodity valuation, and VRPTW dispatch optimization.

Shubham Kulkarni
Shubham Kulkarni Lead AI Systems Engineer
Published December 2025 (Updated Sep 2026)
Tech Stack YOLOv8-Nano, ONNX Runtime Web, OR-Tools, WebGPU

1. The Metallurgy Dilemma in Informal Recycling

Global consumer electronics contain dense concentrations of precious and critical raw materials: 1 tonne of printed circuit boards (PCBs) contains roughly 40 to 800 times more gold and 30 to 40 times more copper than one tonne of mined ore. Despite this economic density, formal recycling suffers from two structural bottlenecks:

  1. Information Asymmetry at Ingestion: Donors and scrap collectors have zero transparency into the actual metal yield of an unbranded PCB or disassembled appliance, leading to predatory informal scrap dumping or acid-bath processing.
  2. Fragmented Reverse Logistics: Dispatching collection vans for ad-hoc 2 kg pickups creates an emissions footprint that completely offsets the carbon savings of recycling the raw copper and tin.

To solve this, E-Zero was designed as a dual-sided engineering stack: a zero-install progressive web application that executes instant component segmentation directly on mobile browsers via ONNX Runtime Web and WebGPU, coupled with a dynamic fleet routing engine that groups pickups based on cumulative heavy metal density and driver road-network travel windows.

42 ms In-Browser YOLOv8-Nano WebGPU Inference
±4.8% Copper/Gold Yield Accuracy vs Lab XRF
38.4% Reverse Fleet Mileage Reduction (VRPTW)
14.2 T Verified E-Waste Diverted from Landfills

2. High-Level Architectural Pipeline

The architecture bypasses costly cloud computer vision APIs by pushing computer vision model execution to the client device, while centralizing spatial clustering and commodity pricing on the backend:

01
On-Device Frame Ingestion & Tiling

Camera feed stream captured via MediaDevices API. Dynamic histogram equalization and perspective rectification applied to isolate planar circuit boards.

02
WebGPU ONNX Runtime Inference

Quantized INT8 YOLOv8-Nano model classifies capacitors, IC chips, heat sinks, copper coils, transformer windings, and battery packs in 42 ms.

03
Metallurgical Valuation Engine

Area estimation and component count combined with London Metal Exchange (LME) spot price APIs to generate instant cryptographic valuation vouchers.

04
Spatial VRPTW Dispatch Optimizer

PostgreSQL/PostGIS cluster matches verified pickup requests against logistics fleet capacity, running Clarke-Wright heuristic with time windows.

3. Edge WebGPU Computer Vision Pipeline

Running real-time object detection on arbitrary mobile browsers requires strict memory budgeting. Transmitting high-resolution video streams to an AWS EC2 GPU cluster incurred unacceptable bandwidth overhead (~$0.012 per scan) and 450 ms network roundtrips over rural 4G connections.

We pruned and distilled a custom YOLOv8 model down to YOLOv8n-EZero (1.92M parameters), trained on our proprietary dataset of 34,000 annotated discarded motherboards, power supplies, lithium battery casings, and CRT deflection yokes:

Model Quantization Strategy: We utilized Post-Training Quantization (PTQ) via ONNX Runtime with asymmetric per-channel INT8 quantization for convolutional weights and FP16 for activation tensors. This reduced the model binary from 14.8 MB to 3.2 MB, allowing instant client caching via Service Workers.

4. Mathematical Formulation: Yield Estimation

To compute fair financial compensation without requiring destructive lab spectrometry at the curb, we formalized a deterministic component yield mapping model:

Let $C$ denote the set of detected components $\{c_1, c_2, \dots, c_k\}$ on a scanned electronic unit. For each component class $c$, the system extracts bounding box area $A_c$, count $n_c$, and associated metallurgical composition vector $\vec{\mu}_c = [\mu_{\text{Cu}}, \mu_{\text{Au}}, \mu_{\text{Ag}}, \mu_{\text{Al}}]$ in grams per unit area:

Yield & Valuation Formula
$$\text{Mass}_{m} = \sum_{c=1}^{K} n_c \cdot \big( \alpha_c \cdot A_c + \beta_c \big) \cdot \mu_{c, m} \cdot \eta_{\text{smelt}, m}$$

$$\text{Valuation}_{\text{total}} = \sum_{m \in \{\text{Cu, Au, Ag, Al, Fe}\}} \text{Mass}_m \cdot P_{\text{LME}, m}(t) \cdot (1 - \gamma_{\text{logistics}})$$

Where:

  • $\eta_{\text{smelt}, m} \in (0, 1]$ represents the industrial pyrometallurgical or hydrometallurgical recovery efficiency for metal $m$ (e.g., $96.5\%$ for electrolytic copper refining, $88.2\%$ for chemical cyanide gold stripping).
  • $P_{\text{LME}, m}(t)$ is the real-time spot commodity price queried every 15 minutes from the London Metal Exchange.
  • $\gamma_{\text{logistics}}$ is an automated operational friction buffer calibrated dynamically by geographic distance to the nearest regional licensed smelting hub.

5. Reverse Logistics: The VRPTW Formulation

Unlike forward logistics where inventory departs from a central hub and decreases monotonically, reverse logistics suffers from stochastic collection volumes. A collection van can reach its maximum cubic payload or hazardous weight threshold prematurely:

Objective Function: Vehicle Routing with Time Windows
$$\min \sum_{k \in V} \sum_{i \in N} \sum_{j \in N} d_{ij} \cdot x_{ijk} + \lambda \sum_{k \in V} \text{CO2}(k)$$

$$\text{Subject to: } \sum_{i \in N} q_i \cdot y_{ik} \le Q_{\text{cap}}, \quad \forall k \in V$$
$$a_i \le t_{ik} \le b_i \quad (\text{Customer Time Window Availability})$$

We resolve this in Python using Google OR-Tools with Guided Local Search (GLS). When new high-value pickup requests (e.g., corporate data center server decomms) are logged, the dispatcher re-optimizes routes without violating existing consumer pickup SLA windows.

6. Production Implementation: Client & Solver

client_inference.js — In-Browser WebGPU Detection Pipeline
import * as ort from 'onnxruntime-web/webgpu';

export class EZeroVisionDetector {
  constructor(modelPath) {
    this.modelPath = modelPath;
    this.session = null;
    this.classNames = [
      'ic_chip', 'electrolytic_cap', 'copper_coil',
      'heat_sink', 'li_ion_battery', 'gold_finger_edge'
    ];
  }

  async initialize() {
    ort.env.wasm.numThreads = navigator.hardwareConcurrency || 4;
    ort.env.wasm.simd = true;

    // Allocate WebGPU execution session with fallback to WASM SIMD
    this.session = await ort.InferenceSession.create(this.modelPath, {
      executionProviders: ['webgpu', 'wasm'],
      graphOptimizationLevel: 'all'
    });
    console.log('[E-Zero] WebGPU session successfully initialized.');
  }

  preprocess(videoElement, targetWidth = 640, targetHeight = 640) {
    const canvas = new OffscreenCanvas(targetWidth, targetHeight);
    const ctx = canvas.getContext('2d');
    ctx.drawImage(videoElement, 0, 0, targetWidth, targetHeight);
    const imgData = ctx.getImageData(0, 0, targetWidth, targetHeight).data;

    // Transpose HWC -> CHW and normalize to [0.0, 1.0]
    const float32Data = new Float32Array(3 * targetWidth * targetHeight);
    const channelSize = targetWidth * targetHeight;

    for (let i = 0; i < channelSize; i++) {
      float32Data[i] = imgData[i * 4] / 255.0;                      // R
      float32Data[channelSize + i] = imgData[i * 4 + 1] / 255.0;      // G
      float32Data[2 * channelSize + i] = imgData[i * 4 + 2] / 255.0;  // B
    }

    return new ort.Tensor('float32', float32Data, [1, 3, targetHeight, targetWidth]);
  }

  async detect(videoFrame) {
    const tensor = this.preprocess(videoFrame);
    const feeds = { images: tensor };
    const results = await this.session.run(feeds);
    const output = results[this.session.outputNames[0]]; // Shape: [1, 10, 8400]

    return this.postprocessNonMaxSuppression(output.data, 0.45, 0.50);
  }

  postprocessNonMaxSuppression(data, confThreshold, iouThreshold) {
    // Non-Maximum Suppression (NMS) matrix reduction implementation
    // Returns array of { classIdx, score, bbox: [x1, y1, x2, y2] }
    // ...
  }
}
vrptw_dispatcher.py — Google OR-Tools Dynamic Fleet Optimizer
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
import numpy as np

def solve_e_waste_vrptw(distance_matrix, time_windows, demands, vehicle_capacities, num_vehicles):
    manager = pywrapcp.RoutingIndexManager(
        len(distance_matrix), num_vehicles, 0
    )
    routing = pywrapcp.RoutingModel(manager)

    # 1. Transit Callback
    def distance_callback(from_index, to_index):
        from_node = manager.IndexToNode(from_index)
        to_node = manager.IndexToNode(to_index)
        return distance_matrix[from_node][to_node]

    transit_callback_index = routing.RegisterTransitCallback(distance_callback)
    routing.SetArcCostEvaluatorOfAllVehicles(transit_callback_index)

    # 2. Add Capacity Constraints (kg of e-waste payload)
    def demand_callback(from_index):
        from_node = manager.IndexToNode(from_index)
        return demands[from_node]

    demand_callback_index = routing.RegisterUnaryTransitCallback(demand_callback)
    routing.AddDimensionWithVehicleCapacity(
        demand_callback_index,
        0,  # null capacity slack
        vehicle_capacities,  # vehicle max loads
        True,  # start cumul to zero
        'Capacity'
    )

    # 3. Add Time Window Constraints
    time_callback_index = routing.RegisterTransitCallback(distance_callback)
    routing.AddDimension(
        time_callback_index,
        30,  # 30 min waiting slack
        480, # 8-hour shift max
        False,
        'Time'
    )
    time_dimension = routing.GetDimensionOrDie('Time')
    for location_idx, (start_tw, end_tw) in enumerate(time_windows):
        index = manager.NodeToIndex(location_idx)
        time_dimension.CumulVar(index).SetRange(start_tw, end_tw)

    # 4. Search Parameters with Guided Local Search
    search_parameters = pywrapcp.DefaultRoutingSearchParameters()
    search_parameters.first_solution_strategy = (
        routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC
    )
    search_parameters.local_search_metaheuristic = (
        routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH
    )
    search_parameters.time_limit.seconds = 5

    solution = routing.SolveWithParameters(search_parameters)
    return manager, routing, solution

7. Real-World Field Benchmarks

We benchmarked E-Zero across 1,400 discarded electronic items against lab-grade XRF (X-ray Fluorescence) spectrometry and baseline unoptimized municipal garbage trucks:

Inference Latency by Engine
CPU WASM (Single Thread)
210 ms
WASM + SIMD (4 Threads)
86 ms
WebGPU Hardware Acceleration
42 ms
Yield Discrepancy vs Lab XRF
Copper Content (Cu)
±3.8% error
Gold Edge Fingers (Au)
±5.1% error
Aluminum Heat Sinks (Al)
±2.2% error
Evaluation Metric Traditional Municipal E-Waste E-Zero Edge AI Platform System Delta
Precious Metal Recovery Rate 12.4% (Informal Landfill Leakage) 78.6% (Verified Smelter Tracking) +66.2% Recovery Gain
Fleet Kilometers per Tonne 184.2 km / tonne collected 113.4 km / tonne collected -38.4% Diesel / Fleet Burn
User Incentive Payout Latency 3 to 7 business days (manual check) Instant UPI / Token Credit (<2s) Real-time Liquidity
Cloud Computer Vision OpEx $12.50 per 1,000 scanned items $0.00 (Zero Server Inference GPU) 100% Client-Side Free

8. Critical Edge Hazards & Failure Modes

Handling industrial electronic scrap introduces significant physical risks that purely academic computer vision models fail to anticipate:

Pouch Battery Swelling & Thermal Runaway: Damaged lithium-polymer battery cells exhibit distinct mechanical bulging before bursting into self-oxidizing thermal flames. We trained a dedicated secondary classifier to detect pouch expansion. When triggered, the system prohibits mixed bin transport and flags the collection for isolated flame-retardant ceramic bins.
High-Voltage Capacitor Residual Charge: Disassembled CRT monitors and large 450V electrolytic capacitors retain lethal dielectric charges for weeks after disconnection. The UI automatically displays safety discharge guides before instructing users to touch high-density boards.
Specular Reflection on Gold Fingers: Bright indoor LED illumination creates intense specular flash on gold-plated PCIe connectors, leading to false-negative edge finger bounding boxes. We integrated an automated frame sharpness and glare filter that prompts the user to rotate the camera by 15 degrees if saturation exceeds 85% of dynamic range.
Production Engineering Notice: Metallurgical recovery factors ($\eta$) and London Metal Exchange spot price multipliers shown in this document reflect anonymized baseline configurations. Production deployments incorporate certified ISO 14001 smelter audit streams.