← Back to work
Senior ThesisUniversity of San Carlos · December 2025

C.Scope.AI V2 — Automated Imaging System for Microplastics Sample Classification

Version 2 of C.Scope.AI — a complete redesign of the hardware, software architecture, and established machine learning retraining pipeline of an automated microplastic imaging system originally developed in collaboration with the USC Biology Department and the SEA-MaP / ASEAN regional microplastics program.

42%
Footprint Reduction
55%
Height Reduction
11.71%
Detection Speedup
₱8,934
Unit Cost (from ₱14,500)

The Problem

The initial C.Scope.AI system (V1) proved that automated computer vision could replace manual microplastic microscopy — but the hardware and software introduced new problems. The XY platform was oversized for its micro-movement application: built on heavy aluminum extrusions and a stacked-gantry mechanism, it was too large to integrate with most existing lab microscopes. The software relied on Docker containerization to serve the ML model via HTTP, introducing high memory overhead (~1.9 GB total), serialization latency, and a complex multi-step setup that required developer involvement. Additionally, the model had no mechanism for incorporating new field data — making long-term accuracy improvement impossible without developer-side intervention.

Hardware Redesign — H-Bot XY Platform

The stacked-gantry mechanism was replaced with a planar H-Bot configuration — a belt-driven system where two stationary NEMA 17 stepper motors coordinate to produce XY motion across a single plane. This eliminated the vertical stacking of the original design entirely. The entire platform was designed to be 3D-printable within a standard 220mm printer bed, using 8mm steel rods and LM8UU bearings instead of expensive aluminum extrusions. Five design iterations refined the structure from an initial rack-and-pinion prototype through increasingly refined H-Bot frames, culminating in a unified four-corner base with integrated motor slots and click-fit rod retention. Belt tension was calibrated through systematic testing, establishing an optimal 10-tooth exposure setting that minimized positional error. Results: 42% smaller footprint, 55% lower height profile, cost reduced from ₱14,530 to ₱8,934.

Software Architecture Redesign

The Docker containerization layer was eliminated entirely. The ML model was extracted from its container and embedded directly into the application's runtime using PyTorch's shared memory — allowing raw image tensors to be passed directly to the CPU without serialization overhead. This reduced total memory usage from ~1,910 MB to ~450 MB (a saving of ~1,459 MB / 1.5 GB). Detection speedup on an Intel Core i3-1115G4 was 9.80% for the binary model and 11.71% for the multiclass model. Setup was simplified from a multi-stage Docker/WSL dependency chain to a single standalone executable built with PyInstaller.

Local Retraining Pipeline

A 6-stage automated retraining pipeline was built into the application: (1) Environment & Model Setup, (2) Dataset Mining, (3) Data Filtering, (4) Data Combination, (5) Training Data Preparation, and (6) Training & Evaluation. Hyperparameter optimization used Optuna's Tree-structured Parzen Estimator (TPE) across 40 trials — identifying a base learning rate of 1.51×10⁻⁵ and 1,358 max iterations as optimal (Trial 20, Seed 2025). Transfer learning techniques included Progressive Unfreezing (freezing stem and res2), Differential Learning Rate ("Backbone Chilling" — 0.1× multiplier on res3-res5), and Dynamic Iteration Scaling (maintaining ~32 epochs regardless of dataset size). Difficulty-stratified data selection used a 40% Hard / 40% Medium / 20% Easy split with a 150% anchor ratio. The optimal model achieved a 101% improvement on the retrain set (83.10 AP vs 41.19 AP) while retaining 99.8% of original detection capability on the anchor set.

Validation & Deployment

The system was evaluated by the Biology Department of the University of San Carlos — the primary end-user under the SEA-MaP / ASEAN regional microplastics monitoring program. Feedback was collected through researcher interviews and incorporated into subsequent iterations. The final system was packaged as a standalone Windows executable (PolyVision) distributed via GitHub, with a comprehensive user guide enabling non-technical researchers to operate and retrain the system independently.

What We'd Do Differently

The retraining pipeline was validated against legacy V1 field data rather than new V2 field data — because V2 had not yet been deployed long enough to generate a new dataset. This means real-world generalization beyond the test set is still unproven. GPU acceleration (CUDA/ROCm) would also substantially improve training time; the current pipeline runs CPU-only to match the constrained hardware typical of research labs. Future iterations should also explore newer object detection architectures beyond Faster R-CNN and consider integrating small language models for multimodal classification support.

Team

Piolo Pascual E. Besinga
Software & Hardware Integration
Ivor Louisetyne Canque
Machine Learning
Lysander S. Uy
Hardware & CAD/Design

Advisers

Dr. Luis Gerardo S. Cañete, Jr.
Main Adviser
Dr. Philip Virgil B. Astillo
Assistant Adviser

Tech Stack

PyTorchDetectron2OpenCVPythonPyQt5OptunaGRBLArduino3D Printing / CADSQLiteCOCO Format

Links

← All projectsNext: Mama's Recipe →