Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dog Breed Classifier

Dog Breed Classifier

website: https://doggie-wiki.com

Techniques
frontend
- HTML/CSS/JavaScript
- Materialize
- Babel
- Webpack

backend
- Python(FastAPI)
- Docker
- GCP(Cloud Run)

deep learning
- PyTorch

Functionalities
1. Users can take or upload a dog photo to learn more about the dog breed.
2. With deep learning, The app can predict 133 dog breeds with up to 86-88% accuracy.
3. The app supports Chinese/English, and you can also learn to speak both languages.

Chih-Yu Yeh

June 21, 2020
Tweet

More Decks by Chih-Yu Yeh

Other Decks in Technology

Transcript

  1. Outline 1. Understand the Problem 2. End goal 3. Data

    Exploration 4. Data Preprocessing and Model Formulation 5. Model Training 6. Model Deployment 7. Simple Demo 8. Further Improvements 9. References
  2. Problem Statement Given an image of a dog, your algorithm

    will identify an estimate of the canine’s breed. Otherwise, your algorithm should return an error message. There are 133 dog breeds in the training dataset. Conclusions 1. This is a computer vision task 2. This is a multi-classification task.
  3. My end goal is to have these models deployed and

    serve the real people in the world. The best condition is to store these models directly inside users’ browsers and they can use the application offline(through progressive web app techniques). Note: 1. Actually there are two versions of my proposed models, and the reason that the second version is raised is because it disobey my end goal. 2. The model I am going to introduce later is the second version.
  4. Model Architecture 1. Dog Detection a. Model: a pretrained MobileNetV2

    model w/o finetuning b. Input: an preprocessed image(224*224*3) c. Output: a boolean that indicates if a dog is inside the image 2. Dog Breed Classification a. Model: a pretrained MobileNetV2 model with finetuning b. Input: an preprocessed image(224*224*3) c. Output: top-3 prediction
  5. Data Preprocessing from PyTorch documentation All pre-trained models expect input

    images normalized in the same way, i.e. mini-batches of 3-channel RGB images of shape (3 x H x W), where H and W are expected to be at least 224. The images have to be loaded in to a range of [0, 1] and then normalized using mean = [0.485, 0.456, 0.406] and std = [0.229, 0.224, 0.225] . It should be complemented with the chosen model. So we’d better follow the same preprocessing step first.
  6. Computing Environment 1. GCP AI Platform Notebook with 1 Nvidia

    P100 GPU 2. Using PyTorch 3. Fine-tuning Time: several hours
  7. Training Problems In order to train faster and prevent neural

    networks from stopping improving, I applied two techniques: learning rate finder and the one cycle policy.
  8. Other tools worth trying 1. Tune: a scalable hyperparameter tuning

    library 2. Weights&Biases: a platform for experiment tracking, model optimization and dataset versioning Note: Above two tools are complementary with each other, and they can be combined together.
  9. Used tools 1. Docker a. Enable easy environment setup b.

    Easy to ship and manage applications c. Suitable for cloud-native applications 2. GCP Cloud Run a. Serverless computing environment using containers b. Minimal effort to manage the infrastructure c. We only need to deploy our built images
  10. 1. Add more training data, for example, more dog breeds

    in Taiwan. 2. Put models to the users’ browsers and enable offline usage. 3. Novel dog breeds detection. 4. Online learning that enables improving the model performance on the fly.