MWMartin Wassim
Return to Selected Work
ARCHITECTURAL DOSSIER // 2024—2026
PROJECT 05Deep Learning & Computer VisionPyTorch & ViT

WASTENET

Computer vision waste classification system comparing Deep CNNs and Vision Transformers.

martinx.work/work/wastenet
WASTENET Architectural Presentation
TIMELINE

2024 — 2026

DISCIPLINE

AI / Computer Vision

ROLE

Lead Software Architect

AFFILIATION

Systemize EG · Cairo

Core Runtime • Engineering Toolchain
PythonPyTorchCNNVision TransformerFlaskOpenCV
01 // Operational & Technical Friction

The Problem Space

Municipal and domestic recycling pipelines fail due to manual sorting errors and varying real-world lighting, reflections, and angles.

02 // The Architected Solution

Systemized Implementation

Trained and fine-tuned deep visual classifiers capable of differentiating complex recyclable materials with sub-second inference and high generalization.

03 // Production Implementation & Workflow

How It Operates in Production

Constructed a modular training and evaluation harness in PyTorch. Trained a custom convolutional baseline, fine-tuned pretrained ResNet-50 and MobileNetV2 backbones, and evaluated a Vision Transformer (ViT-B/16) utilizing self-attention across image patches.

Engineering Depth

Implemented custom PyTorch Dataset loaders, learning rate schedulers, and confusion matrix visualizers to diagnose cross-class ambiguities.

04 // Architectural Flow & State MachineBespoke Pipeline
VISION BENCHMARK

WASTENET // COMPUTER VISION INFERENCE PIPELINE (CNN VS. VIT)

PYTORCH 2.0 • TORCHSCRIPT EDGE
STAGE 01 // BASELINE

Custom 4-Layer ConvNet

Standard 3x3 convolution kernels with batch normalization extracting localized edges with sub-25ms inference.

NODE 01ONLINE
STAGE 02 // TRANSFER BACKBONES

ResNet-50 & MobileNetV2

Residual shortcut connections fine-tuned on ecological waste datasets to overcome vanishing gradients.

NODE 02ONLINE
Core Innovation
STAGE 03 // SPATIAL ATTENTION

Vision Transformer (ViT-B/16)

Linear projection of 16x16 flattened patches with multi-head self-attention resolving complex specular glare.

NODE 03VERIFIED

Data Flow & Infrastructure

Images enter through an OpenCV preprocessing pipeline, undergo normalization, and pass into TorchScript-serialized model weights. The Flask microservice exposes a lightweight REST endpoint returning category probabilities, inference timestamps, and class confidence intervals.

Architectural Highlight

Benchmarked baseline CNNs against Vision Transformers (ViT) to quantify spatial attention vs. localized convolution on diverse lighting conditions.

05 // Key Engineering Decisions
Benchmark methodology: Evaluated models on identical validation splits using precision, recall, F1-score, and per-class confusion matrices rather than top-1 accuracy alone.
Data augmentation pipeline: Employed random perspective transforms, color jitter, and Gaussian blur to simulate real-world conveyor and sorting facility conditions.
Model pruning for inference: Quantized weights to INT8 to enable responsive real-time inference on edge devices without requiring dedicated data center GPUs.
06 // Challenges & Mitigations
High intra-class variance and visual overlap between clear plastic bottles and transparent glass containers.
Imbalanced training distributions across rare trash categories requiring focal loss weighting.
Minimizing inference latency for continuous live webcam feeds.
07 // Verified Capabilities

Core System Features

Six-category ecological waste classification (Cardboard, Glass, Metal, Paper, Plastic, Trash)
Rigorous comparative benchmark (CNN vs. Transfer Learning vs. ViT)
Automated image pre-processing and dynamic tensor augmentations
Local inference REST microservice built with Flask and TorchScript
Interactive evaluation dashboard with confusion matrix & confidence scores