BreedPaws
Dog breed identification from a single photo, running entirely in the browser, no server required.
// Role
Primary developer across the entire project (model, Flask app, Edge migration), and presented the project solo. Academic team of 3 (Group 12: Fatih, Najla Amelia Putri, Muhammad Yordi Septian).
// Year
2025-2026
// Status
// Stack
Problem
Identifying a dog’s breed from a photo sounds simple, but it’s actually a hard case of fine-grained classification. Two dogs of the same breed can look very different depending on pose, coloring, or angle, while dogs from different breeds can sometimes look nearly identical. Manual identification requires specific expertise and doesn’t scale well.
Yet breed information is genuinely useful in several contexts: veterinary clinics (as initial context for breed-specific health predispositions), shelters (speeding up adoption for strays without paperwork), and educating prospective owners. BreedPaws was built to automate this identification from a single photo.
Process
I started with a transfer-learning classification model. The architecture uses InceptionV3 as the backbone (all layers frozen, used purely as a feature extractor), stacked with a custom two-block classification head: Global Average Pooling, Batch Normalization, a 1024-unit Dense layer with L2 regularization, Dropout, then repeated with a 512-unit Dense layer before a final softmax layer. The model was trained with the Adam optimizer (initial learning rate of 0.001, automatically reduced to 0.0001 mid-training once validation plateaued) and categorical crossentropy loss, for 60 epochs with a batch size of 64. Data augmentation included rotation, position shifting, shear, and zoom, plus horizontal flipping, to help the model generalize from a limited number of samples per breed. This first version ran as a Flask web app with TensorFlow, focused on 10 breeds.
The next stage was both the most challenging and the one I learned the most from: moving the model to run entirely in the user’s browser, with no server at all. I rebuilt this Edge version as an SPA (React + TypeScript + Vite) and ran inference directly on the client using TensorFlow.js, with coverage expanded to 120 breeds.
This migration surfaced two real technical problems I had to solve myself:
- Model format compatibility. The model was exported with Keras 3, and its JSON topology format wasn’t directly loadable by TensorFlow.js. I wrote an in-memory translator (
convertKeras3ToKeras2) that dynamically rewrites the model’s JSON schema before loading, so the Keras 3 model could run on TFJS without retraining. - Preprocessing alignment. Accuracy dropped when running in the browser due to a mismatch in pixel normalization between the Python pipeline and TensorFlow.js. After realigning the client-side image preprocessing function, browser predictions became consistent with the Python version again.
Results
The 10-breed model reached a validation accuracy of 95.55%, measured directly from the final evaluation in the training notebook, not an estimate.
The per-breed breakdown (from the classification report) shows solid, consistent performance across all 10 classes, with F1-scores of 0.90 or higher throughout. Interestingly, the breed the model struggled with most was Shih-Tzu (86% recall, the lowest of the 10 classes), which lines up with the fine-grained classification challenge mentioned in the Problem section, small, fluffy breeds really are prone to being confused with one another, even by the model.
The user experience is straightforward: upload a photo, see a preview, run inference locally in the browser, then get a Top-1 prediction (breed name) along with a confidence score and a visual progress bar. As a real example, the 120-breed Edge model predicted a test photo as “Chihuahua” with 98.79% confidence.
A note so the two numbers don’t get mixed up: 98.79% is a single image’s confidence score from the 120-breed Edge model, different from the 95.55% validation accuracy (the overall performance of the original 10-breed model). Two numbers, two models, two different contexts. Don’t use them interchangeably.
Running the model in the browser brought a few consequences I consider real strengths of this project:
- Zero server cost, since computation runs on the user’s own device.
- No cold start, unlike a serverless API.
- Privacy preserved, since photos are never sent to any server.
- Offline functionality, the app keeps working offline once the model has loaded.
// GALLERY


