> Markdown version of [/videos/1626-is-it-f-ake-image-classification-with-tensorflow-js?t=1465](https://www.wearedevelopers.com/videos/1626-is-it-f-ake-image-classification-with-tensorflow-js?t=1465). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Is it (F)ake?! Image Classification with TensorFlow.js Is it real, or is it a hyper-realistic cake? Learn how developers can use TensorFlow.js and transfer learning to build accurate computer vision classifiers without an ML background. - **Speakers:** [Carly Richmond](https://www.wearedevelopers.com/@carly-richmond) - **Event:** World Congress 2025 - **Published:** August 20, 2025 - **Duration:** 25:43 - **URL:** https://www.wearedevelopers.com/videos/1626-is-it-f-ake-image-classification-with-tensorflow-js ## Summary Embarking on a journey to demystify machine learning, this presentation explores how software engineers can practically approach computer vision by building a binary classifier to determine if an image is "cake" or "not cake." Inspired by the popular baking show, the project begins with the critical step of data gathering, utilizing Playwright to scrape baker portfolios and the Unsplash API to create a balanced, albeit inherently tricky, dataset. This process highlights a foundational machine learning challenge: curating clean data is difficult, especially when faced with hyper-realistic objects or ambiguous categories that easily confuse early-stage validations. Initial structural attempts rely on pre-trained TensorFlow.js models running in a Node.js environment. Applying MobileNet for baseline image classification and COCO-SSD for object detection yields humorous but inaccurate results, as these models lack the highly specific context required to differentiate a cake disguised as a household object. Attempting to solve this by building a custom Sequential Convolutional Neural Network (CNN) from scratch introduces concepts like tensor conversion, ReLU activation functions, and dimensionality reduction. However, deploying a bespoke model against a small dataset emphasizes that foundational models often require vastly more training data than a solo developer can easily procure, frequently leading to poor validation where everything—or nothing—is identified correctly. The project ultimately finds success through transfer learning, illustrating a highly effective paradigm for engineers exploring artificial intelligence. By extracting feature vectors from the robust, ImageNet-trained MobileNet v3 and appending a custom, lightweight classification head, the model benefits from pre-existing visual understanding combined with domain-specific training. This approach drastically lowers loss rates and boosts accuracy, proving that software engineers do not need to be machine learning experts to build functional AI features. Leveraging established libraries and structural layers allows developers to bypass the steep hurdle of training complex architectures from scratch, making applied machine learning an accessible extension of existing JavaScript workflows. **Keywords:** tensorflow.js architecture, image classification models, transfer learning implementation, convolutional neural networks, mobilenet classification, coco-ssd object detection, custom sequential models, binary classifier training, javascript machine learning, tensor conversion node.js, ai feature vectors, visual dataset balancing, neural network dense layers, softmax activation functions ## Chapters 1. **Exploring machine learning and image classification in JavaScript** (00:00) — An exploration of building and utilizing machine learning models for visual classification using an unconventional dataset. 1. **Building an image dataset for a binary classifier** (03:36) — Extracting images utilizing testing frameworks and external APIs allows for the creation of a balanced training dataset. 1. **Using the predefined MobileNet model for image classification** (05:48) — Decoding images into multi-dimensional tensors enables the evaluation of pre-trained image models for baseline accuracy. 1. **Identifying elements with the COCO-SSD object detection model** (08:27) — Leveraging single-shot multi-box detection draws targeted bounding boxes to isolate and classify specific objects within an image. 1. **Building a custom convolutional neural network in Node.js** (10:22) — Constructing a sequential model with convolution and pooling layers creates custom decision neurons for domain-specific visual predictions. 1. **Applying transfer learning to improve classification dataset accuracy** (16:10) — Combining existing feature vectors with a custom classification head leverages established pre-trained patterns to overcome small dataset limitations. 1. **Comparing human accuracy against machine learning model predictions** (20:22) — An interactive web application demonstrates the difficulty of complex visual parsing tasks for both human logic and algorithmic models. 1. **Lessons learned on understanding how machine learning models work** (24:25) — Investigating layer mechanics and pre-trained model reuse provides software engineers with a practical foundation for working with visual classifiers. ## Related Moments - [Experimenting with JavaScript machine learning for cake detection](https://www.wearedevelopers.com/videos/1305-building-your-own-classification-model-with-javascript-coffee-with-developers-carly-richmond) (from "Building Your Own Classification Model with JavaScript - Coffee with Developers - Carly Richmond") - [Evaluating MobileNet and COCO-SSD pre-trained computer vision models](https://www.wearedevelopers.com/videos/1272-mastering-image-classification-a-journey-with-cakes) (from "Mastering Image Classification: A Journey with Cakes") - [Introduction to image classification and the cake detection challenge](https://www.wearedevelopers.com/videos/1272-mastering-image-classification-a-journey-with-cakes) (from "Mastering Image Classification: A Journey with Cakes") - [Implementing machine learning with Core ML and Vision](https://www.wearedevelopers.com/videos/1515-harnessing-apple-intelligence-live-coding-with-swift-for-ios) (from "Harnessing Apple Intelligence: Live Coding with Swift for iOS") - [Sourcing and preparing custom images for a binary dataset](https://www.wearedevelopers.com/videos/1272-mastering-image-classification-a-journey-with-cakes) (from "Mastering Image Classification: A Journey with Cakes") - [Building a custom Convolutional Neural Network pipeline from scratch](https://www.wearedevelopers.com/videos/1272-mastering-image-classification-a-journey-with-cakes) (from "Mastering Image Classification: A Journey with Cakes") ## Related Articles - [How machine learning can help us tell fact from fiction](https://www.wearedevelopers.com/magazine/509-how-machine-learning-can-help-us-tell-fact-from-fiction) - [Dev Digest 112 - The True Crime of AI Development](https://www.wearedevelopers.com/magazine/421-dev-digest-112-the-true-crime-of-ai-development) - [All the videos of Halfstack London 2024!](https://www.wearedevelopers.com/magazine/521-all-the-videos-of-halfstack-london-2024) - [MLops – Deploying, Maintaining And Evolving Machine Learning Models in Production](https://www.wearedevelopers.com/magazine/115-mlops-deploying-maintaining-and-evolving-machine-learning-models-in-production) ## Related Jobs - [Machine Learning Engineer](https://www.wearedevelopers.com/jobs/ext/1355348-machine-learning-engineer) at **TWILIO** - [Machine Learning Engineer](https://www.wearedevelopers.com/jobs/ext/588393-machine-learning-engineer) at **Twilio** - [Staff, Machine Learning Engineer (L4)](https://www.wearedevelopers.com/jobs/ext/1202639-staff-machine-learning-engineer-l4) at **Twilio** - [Machine Learning Engineer](https://www.wearedevelopers.com/jobs/ext/1377841-machine-learning-engineer) at **Almedia** - [Data Scientist](https://www.wearedevelopers.com/jobs/ext/1351648-data-scientist) at **Almedia** - [Staff Software Engineer, Copilot Experiences](https://www.wearedevelopers.com/jobs/ext/164361-staff-software-engineer-copilot-experiences) at **GitHub**