SlideShare a Scribd company logo
1 of 107
Is it food
a journey of minds, machines, and meals
@halogenandtoast
Who am I?
Matthew “Goose” Mongeau
Mongeau
ಠ_ಠ
Is it food
a journey of minds, machines, and meals
Why give this talk?
Gradient descent is a first-order
iterative optimization algorithm.
To find a local minimum of a
function using gradient descent,
one takes steps proportional to
the negative of the gradient (or of
the approximate gradient) of the
function at the current point.
Gradient descent is a first-order
iterative optimization algorithm.
To find a local minimum of a
function using gradient descent,
one takes steps proportional to
the negative of the gradient (or of
the approximate gradient) of the
function at the current point.
ಠ_ಠ
Goals
Goals
Practicality
Goals
Practicality
Real World Use Case
Disclaimers
A brief experiment
Is it food?
Is it a photograph of
food?
ಠ_ಠ
Pattern Recognition
Automation
Machine Learning
Unsupervised
Supervised
Reinforcement
Unsupervised
Supervised
Reinforcement
Supervised
Neural Networks
A Brief History of Artificial
Neural Networks
Perceptron
1957 Mark I
Perceptron
1957 Mark I
ಠ_ಠ
TensorFlow2015
A Brief History of Artificial
Neural Networks
Finished
What is TensorFlow?
TensorFlow2015
What is a Tensor?
Inception V3
What is a Inception?
Inception V3
What is a Inception?
Is it food
NSFW
Building a Rails App
Mistake #1
Python
Ruby
tensorflow.rb
Mistake #2
Docker
Docker
“My”
road to success
YMMV
Installation
brew install python
pip install --upgrade virtualenv
virtualenv --system-site-packages targetPath
cd targetPath
source bin/activate
pip install --upgrade tensorflow
Retraining
Transfer Learning
Inception V3
Gather up your training data in a folder called
data
curl
https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/examples/image
_retraining/retrain.py > retrain.py
I changed output_graph and output_labels from tmp to the current directory
python retrain.py --image-dir data
WAIT
WAIT.
WAIT..
WAIT…
Graph
Labels
food
person
flower
other
text
Let’s use it!
https://codelabs.developers.google.com/cod
elabs/tensorflow-for-poets/#4 copy to
label_image.py
change graph and labels to local directory
Making a web server
pip install --upgrade flask
Convert our
label_image.py into a
small server
Let’s use it!
Suggested Reading
Demystifying Deep Neural Nets - Rosie Campbell
Python Machine Learning - Sebastian Raschka
Fin
• https://www.flickr.com/photos/su-may/7416737880/in/photolist-cioHM3-5Br3rt-5Br3ok-azvaWq-f8sGux-
6gk5Am-j3FST-Qmwabr-5YFu4j-9U7YHe-8yXv8U-5Br4h8-8KCB4N-fdMBwB-xpVTew-h1UBMH-aFRh8e-
dTXMzJ-3JEPYY-6ZujYn-dTSa1i-BGK2B-8QaxYe-9XsJWg-EMsLEu-b1YJDM-buKEvA-jECV3W-autnBw-
8KCzMW-cioHBQ-cwCP6q-oZufBa-6KXrdr-auHvXG-yHNtk-dwG2AF-dTS9HV-e9fPXB-f8sPAt-8HLqym-
dTS9jg-py7en9-rykevE-8yvFLb-KQnns-4YWwK7-qLgCEQ-LFUZY-8KCAkN
• https://www.chiefoutsiders.com/hubfs/low-hanging-fruit.jpg
• http://s1036.photobucket.com/user/abby789_2010/media/DSCN8793.jpg.html
• https://www.deltaco.com/files/menu/item/thumb_regulartaco.jpg
• https://thenounproject.com/term/test-tube/13589/
• https://research.googleblog.com/2016/03/train-your-own-image-classifier-with.html
• http://stats.stackexchange.com/questions/203872/what-to-do-when-a-linear-regression-gives-negative-
estimates-which-are-not-possi
• https://en.wikipedia.org/wiki/Tensor
• http://blog.mpacula.com/2011/04/27/k-means-clustering-example-python/
• http://www.bikemaui.com/wp-content/uploads/2016/08/angry-mongoose.jpg
• http://www.eltorocyclingclub.nl/wp-content/uploads/2015/05/Gans.jpg
Questions?
@halogenandtoast
Matthew “Goose” Mongeau

More Related Content

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Is it food?

Editor's Notes

  1. TEST, if I can see this I’m in luck… this time.
  2. I wanted to learn more about machine learning. The talks I watched on machine learning were either way too high level or way too low level for me
  3. I see lots of charts that look like this and talk about things like Linear Regression, Gradient Descent, etc.
  4. With definitions that look like this.
  5. And this summarizes how I feel
  6. I have two main goals with this talk
  7. I like practicality, so I want to take a problem, solve it, and share the experience so others can do it as well
  8. And I want to show something in the context of a real world use case. Really by the end of my talk, I hope some audience members go “Oh, that’s neat, looks easy, I’ll try it out myself”
  9. I’m going to do my best to balance between practical and technical and as a result I might end up oversimplifying some stuff. To be honest this is meant to be a really high level overview. Hopefully, this will coincide with my goals to keep things practical.
  10. Let’s start with a brief experiment
  11. I want you all to tell me whether or not something is food.
  12. Or more specifically, “Is it a photographer food” since some people are quick to point out fallacy of my question. Easy enough right? Let’s hope this will be a fruitful experiment
  13. Is this food? Well of course it is, It’s a fruit and therefor food. But how do we truly know. For many of us, the answer is simple, we’ve probably eaten an apple before. But that doesn’t really get to the meat of our problem now does it
  14. Is this food? I speculate that not everyone here has specifically eaten Yakitori, but it’s fairly likely you’ve eaten something similar to it. Therefor we can probably easily identify this as food, and most likely we all instantaneously recognized this as food. Pretty sweet huh?
  15. Is this food? I think we’d all say yes, but this represents an interesting edge case. No food is actually visible in this picture and yet when I see this I immediately associate it with food. However,
  16. When I see this, I’m just a little sad. But I also don’t think of this as food, clearly when I see this I think of garbage. And again this is an interesting edge case. Alright just a couple more examples.
  17. Okay nothing really new here, I’m pretty sure we’ve all a hard shelled taco before, and therefore can clearly identify this as food, but what about
  18. this.
  19. I really hope no one said yes
  20. This is many ways was core to our survival. Being able to see these patterns and take specific actions in response. It’s one of the key factors that has let us develop language, develop tools, let us escape predators, etc. But while we’re exceptional at it, we’re slow, and we hate menial tasks
  21. So like many problems we want to automate this kind of problem. But automating is difficult because as humans we can recall information in an extraordinary fuzzy way and make similarities between past experiences to extract new information, but programming this kind of process is very difficult
  22. Machine learning can be used as an approximation of this kind of behavior.
  23. Clustering, for example if you have an image we can group colors based on their proximity to determine the dominant color in an image.
  24. Classification, we provide buckets or categories for data to fall as well as examples to train with in order to classify some new data into a category.
  25. Train as you go, provide some positive effect that you feed back into the system so it can improve over iterations
  26. Using Machine learning is one means of solving this problem
  27. The perceptron algorithm was invented in 1957 by Frank Rosenblatt. This machine was designed for image recognition. One of the problems with this style of image recognition was that it couldn’t learn an XOR function and so it could only learn linearly separable patterns.
  28. This problem actually caused research and development of neural networks to stagnate quite a bit. However, let’s fast forward to 2015.
  29. In 2015, we get the first public release of TensorFlow.
  30. And thus ends a brief history of artificial neural networks
  31. Developed by Google as a system capable or building and training Neural networks which are represented with something called a Data Flow Graph.
  32. Which might look something like this. Each layer in this graph takes in a tensor and returns a tensor. Performing some operation on the tensor.
  33. Looking at this image, one would assume you the answer is simply “You will never know”, but the simple answer is that a Tensor is just an n-dimensional array of values.
  34. Which might look something like this. Each layer in this graph takes in a tensor and returns a tensor.
  35. Which might look something like this. Each layer in this graph takes in a tensor and returns a tensor.
  36. Which might look something like this. Each layer in this graph takes in a tensor and returns a tensor.
  37. Now this particular Data Flow Graph represents a trained Neural Network which has been labeled Inception.
  38. Specifically Inception V3
  39. Inception is a pre built data flow graph useful for categorizing images
  40. Specifically it was designed to categorize image from ImageNet. <<read description>>. You can also download whole sets of data from ImageNet which you could use for training purposes yourself.
  41. Let’s return to our Problem, is it food. I mentioned at the start of my talk that I wanted to focus on a real world use case.
  42. At Cookpad where I work, we have this exact problem. We want to be able to tell which photos are actually photos of cooked recipes.
  43. We want to do this for a number of reasons. First we want to make sure the content we’re showing is what the user expects to see. Users love to break systems, and love to be malicious
  44. We need to protect ourselves and our users from these kinds of abuses of the system.
  45. So I want to recreate some of the functionality that system employs. When I started doing this I decided I was going to build a rails app that could do this, but I made a few mistakes along the way.
  46. I started by trying to user tensorflow.rb, but I wasn’t able to get it to properly build on my machine running OSX. My guess is this is an issue with clang, but I didn’t have any luck trying to compile it with GCC either. One of the suggestions given in the README is to use Docker.
  47. After setting up the docker image, I tried to compile a program that would let me retrain Inception V3 for my image set, but I couldn’t get that program to compile either. After many attempts I ran into my favorite “Docker” issue.
  48. So I’d like to talk about “My” road to success with one small note
  49. So let’s start with installation. Getting everything setup can actually be pretty simple.
  50. Use python. <<speak about why python/ruby>>.
  51. The next step was to take Inception and figure out how to retrain it.
  52. In order to train imagenet, we want to do something called transfer learning. This is where we reuse most of what the neural network has already learned, and we just retrain the last layer.
  53. In order to do this, we need a bunch of images for the cases in our problem. This was easy because I was able to just reuse the images that my company used, but if you need to collect your own images it could take a while. To be honest this is probably the hardest part.
  54. Your data set is extremely important. You not only need good examples for things that match your desired categories, but you also need good examples of things that aren’t. If all you’ve ever seen is food, then everything looks like food.
  55. Each folder has between 1000 to 2000 images (except text which has around 600). The images can be small since inception will end up resizing them to a maximum of 299x299px before running any operations on the image. If you have non-square images, you might want to do the resizing yourself in order to make sure the subject is fully in the picture.
  56. I was never able to get the C++ script to work, but Python is here to rescue again. Now I don’t want to go through the retrain.py script line by line since it’s around 1000 lines, but in general, it downloads inception, pops off the last layer and retrains it with the images in our directory based on the folder structure.
  57. A bottleneck is an “informal term” referring to the output of the previous layer. Since this process will want to refer to different images many times we want to cache these values. The output above is from running the retrain functionality with the bottlenecks already calculated so it was fast.
  58. Tensorflow will split your data three ways - training, validation and testing. 70:20:10 - Training is the data you tune your model on, testing is the data your model never sees as a final set to test accuracy. - Validation is used to avoid overfitting - making sure improvements in training accuracy actually appear in an unseen dataset. - Cross entropy is your loss metric - it’s the metric the model is trying to minimize, rather than focusing directly on accuracy. That’s why it’s not a percentage.
  59. AFTER: There is a label_image application written in C++, but I had no luck with that one
  60. until with tf.Session()
  61. And that’s the end, hopefully that was some food for thought for everyone