Going further with Image Classification

TensorFlow · Intermediate ·📐 ML Fundamentals ·5y ago

Key Takeaways

The video demonstrates how to build a custom image classification model using TensorFlow Lite Model Maker and Google Colab, and integrate it into an Android or iOS app using ML Kit's custom model APIs.

Full Transcript

[Music] so you've built an image classifier app that recognizes the contents of an image using the generic model it works really well but you probably want to make it more specific so instead of recognizing this image as a plant with petals you want to go further and have it recognize it as a daisy or this as a rose and these as tulips although maybe similar scenarios maybe to identify different types of bird or dessert or whatever you're going to need your own model to do this so if you feed it in a daisy you'll get back a set of predictions for that flower and recall that the output of the neural network will be the number of values based on the classes that the model is trained for so for example here i have three outputs for the probability of a daisy a rose or a tulip so how would you build a model like this well i'm glad you asked the first thing you'll need to do is collect samples of each of the classes that you want to detect so for example in the codelab later i'll provide a data set with roses daisies tulips sunflowers and dandelions each of these classes are in a folder so all of the roses will be in a folder called roses and all of the daisies in a folder called daisies and so on these folders are then zipped up into what we'll call our data set of flower images then you'll use google colab which is a browser-based development environment that lets you code in python but you don't need to worry about it installing python or any of its dependencies you'll also get powerful gpu-based hardware on the back end to speed up your neural network training this will let you code with a tool called tensorflow lite model maker and its purpose is to simplify the process of coding and training a neural network while encapsulating many of the steps that you'd normally have to write yourself and if you're not a pythonista yet it's okay because this does this in a simple high-level api which greatly reduces the complexity into a piece of code like this and here you can create an image classifier data loader to load in the images from their directories your data scientist friends probably told you not to use all of your data to train the network and you should hold a little bit back for testing later well you can do that by just splitting the data like we do here with 90 of it being used for training and the other 10 being held back and then you can just create an image classifier using the data and then output a model for tensorflow lite that can be used on android like this once you have your model you can then integrate it into your app using ml kit's custom model apis and all of this will be covered in the next two codelabs but before you get to them let's look at your expected results here's the original app that you built using the base model in ml kit and when you try to label the image i see things like pedal flower plant and sky but when i use my own model and update the app with that and then label the image i can see that this image is a daisy with 95.9 probability similarly in ios the original app with the base model if i classify the flower i'll see paddle flower sky and plants but when i update the app with the custom model for flowers and i try that i see that it also detects that this image is a daisy so in the next two code labs you'll first train the model and then you'll see how to integrate it into your app using mlkit's custom models so let's have some fun coding you

Original Description

Previously you saw how to build an Android or iOS app that could read the contents of an image, recognizing several hundred types of item. It had a limitation in that it did poorly at recognizing specific types of objects. So, for example, a picture of a flower might be recognized as a flower, but not as a daisy, a rose, or a tulip. In this video you’ll learn how to create a custom model to recognize those flower types, and then update your app with just a few lines of code! On-Device Machine Learning → http://g.co/on-device-ml Subscribe to TensorFlow → https://goo.gle/TensorFlow
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from TensorFlow · TensorFlow · 0 of 60

← Previous Next →
1 The TensorFlow YouTube Channel is Here!
The TensorFlow YouTube Channel is Here!
TensorFlow
2 Answering Your TF Questions #AskTensorFlow
Answering Your TF Questions #AskTensorFlow
TensorFlow
3 Chatting With the TensorFlow Community (TensorFlow Meets)
Chatting With the TensorFlow Community (TensorFlow Meets)
TensorFlow
4 All About TensorFlow Code (Coding TensorFlow)
All About TensorFlow Code (Coding TensorFlow)
TensorFlow
5 TensorFlow: an ML platform for solving impactful and challenging problems
TensorFlow: an ML platform for solving impactful and challenging problems
TensorFlow
6 Keynote (TensorFlow Dev Summit 2018)
Keynote (TensorFlow Dev Summit 2018)
TensorFlow
7 tf.data: Fast, flexible, and easy-to-use input pipelines (TensorFlow Dev Summit 2018)
tf.data: Fast, flexible, and easy-to-use input pipelines (TensorFlow Dev Summit 2018)
TensorFlow
8 Eager Execution (TensorFlow Dev Summit 2018)
Eager Execution (TensorFlow Dev Summit 2018)
TensorFlow
9 Machine Learning in JavaScript (TensorFlow Dev Summit 2018)
Machine Learning in JavaScript (TensorFlow Dev Summit 2018)
TensorFlow
10 Training Performance: A user’s guide to converge faster (TensorFlow Dev Summit 2018)
Training Performance: A user’s guide to converge faster (TensorFlow Dev Summit 2018)
TensorFlow
11 The Practitioner's Guide with TF High Level APIs (TensorFlow Dev Summit 2018)
The Practitioner's Guide with TF High Level APIs (TensorFlow Dev Summit 2018)
TensorFlow
12 Distributed TensorFlow (TensorFlow Dev Summit 2018)
Distributed TensorFlow (TensorFlow Dev Summit 2018)
TensorFlow
13 Debugging TensorFlow with TensorBoard plugins (TensorFlow Dev Summit 2018)
Debugging TensorFlow with TensorBoard plugins (TensorFlow Dev Summit 2018)
TensorFlow
14 TensorFlow Lite (TensorFlow Dev Summit 2018)
TensorFlow Lite (TensorFlow Dev Summit 2018)
TensorFlow
15 Searching Over Ideas (TensorFlow Dev Summit 2018)
Searching Over Ideas (TensorFlow Dev Summit 2018)
TensorFlow
16 Reconstructing Fusion Plasmas (TensorFlow Dev Summit 2018)
Reconstructing Fusion Plasmas (TensorFlow Dev Summit 2018)
TensorFlow
17 Nucleus: TensorFlow toolkit for Genomics (TensorFlow Dev Summit 2018)
Nucleus: TensorFlow toolkit for Genomics (TensorFlow Dev Summit 2018)
TensorFlow
18 Open Source Collaboration (TensorFlow Dev Summit 2018)
Open Source Collaboration (TensorFlow Dev Summit 2018)
TensorFlow
19 Swift for TensorFlow - TFiwS (TensorFlow Dev Summit 2018)
Swift for TensorFlow - TFiwS (TensorFlow Dev Summit 2018)
TensorFlow
20 TensorFlow Hub (TensorFlow Dev Summit 2018)
TensorFlow Hub (TensorFlow Dev Summit 2018)
TensorFlow
21 Applied AI at The Coca-Cola Company (TensorFlow Dev Summit 2018)
Applied AI at The Coca-Cola Company (TensorFlow Dev Summit 2018)
TensorFlow
22 Real-World Robot Learning (TensorFlow Dev Summit 2018)
Real-World Robot Learning (TensorFlow Dev Summit 2018)
TensorFlow
23 TensorFlow Extended (TFX) (TensorFlow Dev Summit 2018)
TensorFlow Extended (TFX) (TensorFlow Dev Summit 2018)
TensorFlow
24 Project Magenta (TensorFlow Dev Summit 2018)
Project Magenta (TensorFlow Dev Summit 2018)
TensorFlow
25 TensorFlow Dev Summit 2018 - Livestream
TensorFlow Dev Summit 2018 - Livestream
TensorFlow
26 Introducing TensorFlow Lite (Coding TensorFlow)
Introducing TensorFlow Lite (Coding TensorFlow)
TensorFlow
27 TensorFlow Dev Summit 2018 Highlights
TensorFlow Dev Summit 2018 Highlights
TensorFlow
28 Jeff Dean, Head of AI at Google discusses the impact of ML (TensorFlow Meets)
Jeff Dean, Head of AI at Google discusses the impact of ML (TensorFlow Meets)
TensorFlow
29 TensorFlow Mobile vs. TF Lite and More! #AskTensorFlow
TensorFlow Mobile vs. TF Lite and More! #AskTensorFlow
TensorFlow
30 Using TensorFlow to enable research & production across many fields (TensorFlow Meets)
Using TensorFlow to enable research & production across many fields (TensorFlow Meets)
TensorFlow
31 Teaching TensorFlow for Deep Learning at Stanford University (TensorFlow Meets)
Teaching TensorFlow for Deep Learning at Stanford University (TensorFlow Meets)
TensorFlow
32 TensorFlow Lite for Android (Coding TensorFlow)
TensorFlow Lite for Android (Coding TensorFlow)
TensorFlow
33 Using the tf.data API to build input pipelines (TensorFlow Meets)
Using the tf.data API to build input pipelines (TensorFlow Meets)
TensorFlow
34 Training Models in the Cloud & the Benefits of AI Toolkits #AskTensorFlow
Training Models in the Cloud & the Benefits of AI Toolkits #AskTensorFlow
TensorFlow
35 Execute operations immediately with TensorFlow's Eager Execution (TensorFlow Meets)
Execute operations immediately with TensorFlow's Eager Execution (TensorFlow Meets)
TensorFlow
36 TensorFlow Lite for iOS (Coding TensorFlow)
TensorFlow Lite for iOS (Coding TensorFlow)
TensorFlow
37 Get started with TensorFlow's High-Level APIs (Google I/O '18)
Get started with TensorFlow's High-Level APIs (Google I/O '18)
TensorFlow
38 TensorFlow for JavaScript (Google I/O '18)
TensorFlow for JavaScript (Google I/O '18)
TensorFlow
39 TensorFlow in production: TF Extended, TF Hub, and TF Serving (Google I/O '18)
TensorFlow in production: TF Extended, TF Hub, and TF Serving (Google I/O '18)
TensorFlow
40 Get started with TensorFlow's High-Level APIs in 5 mins |  Google I/O 2018
Get started with TensorFlow's High-Level APIs in 5 mins | Google I/O 2018
TensorFlow
41 TensorFlow and deep reinforcement learning, without a PhD (Google I/O '18)
TensorFlow and deep reinforcement learning, without a PhD (Google I/O '18)
TensorFlow
42 TensorFlow Lite for mobile developers (Google I/O '18)
TensorFlow Lite for mobile developers (Google I/O '18)
TensorFlow
43 Advances in machine learning and TensorFlow (Google I/O '18)
Advances in machine learning and TensorFlow (Google I/O '18)
TensorFlow
44 Distributed TensorFlow training (Google I/O '18)
Distributed TensorFlow training (Google I/O '18)
TensorFlow
45 Classification using neural networks & ML regression models #AskTensorFlow
Classification using neural networks & ML regression models #AskTensorFlow
TensorFlow
46 TensorFlow and Keras in R - Josh Gordon meets with J.J. Allaire (TensorFlow Meets)
TensorFlow and Keras in R - Josh Gordon meets with J.J. Allaire (TensorFlow Meets)
TensorFlow
47 Focus on your experiment with TensorFlow Estimators (TensorFlow Meets)
Focus on your experiment with TensorFlow Estimators (TensorFlow Meets)
TensorFlow
48 How to get started with AI/ML, retraining models, & more! #AskTensorFlow
How to get started with AI/ML, retraining models, & more! #AskTensorFlow
TensorFlow
49 TensorFlow - the deep learning solution for mobile platforms (TensorFlow Meets)
TensorFlow - the deep learning solution for mobile platforms (TensorFlow Meets)
TensorFlow
50 MiniGo: TensorFlow Meets Andrew Jackson (TensorFlow Meets)
MiniGo: TensorFlow Meets Andrew Jackson (TensorFlow Meets)
TensorFlow
51 The growth of TensorFlow with added support for JS & Swift (TensorFlow Meets)
The growth of TensorFlow with added support for JS & Swift (TensorFlow Meets)
TensorFlow
52 At the intersection of TensorFlow & nuclear physics (TensorFlow Meets)
At the intersection of TensorFlow & nuclear physics (TensorFlow Meets)
TensorFlow
53 NVidia TensorRT: high-performance deep learning inference accelerator (TensorFlow Meets)
NVidia TensorRT: high-performance deep learning inference accelerator (TensorFlow Meets)
TensorFlow
54 Try TensorFlow.js in your browser (Coding TensorFlow)
Try TensorFlow.js in your browser (Coding TensorFlow)
TensorFlow
55 TensorFlow Hub: reusing machine learning modules (TensorFlow Meets)
TensorFlow Hub: reusing machine learning modules (TensorFlow Meets)
TensorFlow
56 How to use TensorFlow in PyCharm (TensorFlow Tip of the Week)
How to use TensorFlow in PyCharm (TensorFlow Tip of the Week)
TensorFlow
57 Training models faster with TensorFlow Hub (TensorFlow Meets)
Training models faster with TensorFlow Hub (TensorFlow Meets)
TensorFlow
58 Prepare your dataset for machine learning (Coding TensorFlow)
Prepare your dataset for machine learning (Coding TensorFlow)
TensorFlow
59 Using ML to predict insulin use for Type 1 Diabetes (TensorFlow Meets)
Using ML to predict insulin use for Type 1 Diabetes (TensorFlow Meets)
TensorFlow
60 TFX: an end-to-end machine learning platform for TensorFlow (TensorFlow Meets)
TFX: an end-to-end machine learning platform for TensorFlow (TensorFlow Meets)
TensorFlow

This video teaches how to build a custom image classification model and integrate it into a mobile app, allowing for more specific and accurate image recognition. It covers the use of TensorFlow Lite Model Maker, Google Colab, and ML Kit's custom model APIs.

Key Takeaways
  1. Collect samples of each class to detect
  2. Use Google Colab to code in Python
  3. Use TensorFlow Lite Model Maker to simplify neural network training
  4. Split data into training and testing sets
  5. Create an image classifier data loader
  6. Create an image classifier using the data
  7. Output a model for TensorFlow Lite
💡 Using a custom image classification model can significantly improve the accuracy of image recognition in mobile apps, allowing for more specific and detailed classification of objects.

Related Reads

📰
9 Python Concepts That Become Obvious Once You Build Real Applications
Learn 9 essential Python concepts that become clear when building real applications, crucial for production project success
Medium · Programming
📰
9 Python Concepts That Become Obvious Once You Build Real Applications
Learn 9 essential Python concepts that become clear when building real applications, improving your coding skills and productivity
Medium · Python
📰
I Taught an AI to Recognize the Shadows of Four-Dimensional Objects
Learn how a neural network was taught to recognize the shadows of four-dimensional objects, expanding our understanding of high-dimensional geometry
Medium · AI
📰
Java Stream API — Beyond Java 8 Part 1
Learn Java Stream API beyond Java 8 and improve your coding skills
Medium · Programming
Up next
QR Decomposition is Just Gram-Schmidt with Receipts
DataMListic
Watch →