← All projects

A neural network trained from scratch that tells cats from dogs live from the camera, inside the browser and with no backend.

Discipline
Machine learning
Year
2025
Stack
  • Python
  • TensorFlow
  • Keras
  • OpenCV
  • TensorBoard
  • TensorFlow.js
  • WebRTC
  • JavaScript
  • Vercel
  1. ~86%validation accuracy

The problem

Taking a classification model from the notebook to something anyone can use in the browser.

How I solved it

  1. Data

    23,000+ images

    I compared a dense model and two CNNs trained from scratch on more than 23,000 images. The final one has 3 convolutional layers, Dropout and data augmentation (rotation, zoom, shifts and flips), with experiments tracked in TensorBoard.

  2. Training

    TensorFlow · Keras

    The model is exported to TensorFlow.js and runs in the browser itself, with the same preprocessing as in training: crop, 100×100 px, greyscale and normalisation.

  3. Browser

    TensorFlow.js

    Continuous classification from the camera through WebRTC, about 7 predictions per second, freeing tensor memory as it goes. No server: images never leave the device.

Result

A public demo that tells cats from dogs live with ~86% validation accuracy (the dense model stayed at ~50%), with a confidence meter, an "unsure" state and camera switching.

Need something similar?
CestiappNext project · Own product · SaaSCestiapp home page