Skip to content

Thesis — Comparison of Machine Learning Frameworks for In-browser Model Execution


Why In Browser?

Everything runs locally — no cloud, no API keys, no install. Short answer: PLOC

  • Privacy


    Data never leaves the device. User inputs stay local.

  • Latency


    No round-trip to server. Instant predictions.

  • Offline


    Works without internet after initial load.

  • Cost


    No server bills. Free inference for everyone.


  • 3 Runtimes


    TensorFlow.js · ONNX Runtime Web · LiteRT.js

    Details
    • TensorFlow.js — Google, largest AI/ML ecosystem, tensor ops
    • ONNX Runtime Web — Microsoft, ONNX format, broad backend support
    • LiteRT.js — Google, next-gen WebAI runtime, .tflite models
  • 3 Frameworks


    Transformers.js · MediaPipe Tasks · ML5.js

    Details
    • Transformers.js — HuggingFace, wraps ONNX Runtime Web, pipeline APIs
    • MediaPipe Tasks — Google, wraps LiteRT, task-specific APIs
    • ML5.js — Community, wraps TensorFlow.js, friendly API
  • 5 Backends


    CPU · WASM · WebGL · WebGPU · WebNN

    Details
    • CPU — Pure JavaScript, universal compatibility
    • WASM — Compiled C++, ~2-3x faster than pure CPU
    • WebGL — GPU via shaders, ~5-10x faster
    • WebGPU — Next-gen GPU, ~10x faster than WebGL
    • WebNN — Neural network interoperable API, the future
  • 6 Metrics


    Load time · First inference · Median latency · Memory · Backend · Accuracy

    Details
    • Load time — Model download + init duration
    • First inference — First timed sample (cold start, shader/JIT compile cost)
    • Median latency — p50 (and p95) over 30 measured runs; warmups timed but excluded
    • Memory delta — Heap usage before/after inference
    • Backend detection — Which backend actually served the inference
    • Accuracy & score — Per-image ground-truth verdicts; composite score = latency × accuracyAt1

Explore the project

  • Components


    Project components: prototype, ml-browser-check, bench-proto, planned app.

  • Research


    Decision logs, deep dives, and architectural findings captured throughout development.

  • Thesis


    Structure, outline, research questions, and comparison criteria for the thesis.


Companion repositories

  • Repository


    All related source code.

  • Paper


    Will be released once the work is complete.