SlideShare a Scribd company logo
HOW I MADE
ZOOM IN AND ENHANCE
CONVOLUTIONAL NEURAL NETWORKS
?
1. SOMEONE ELSE DID IT
2. FINALLY THERE WAS A
LIBRARY I COULD UNDERSTAND
THEORY
THEORY
▸ A way to compute a function inspired by the human brain
▸ Much simpler than the brain!
▸ Input -> Network -> Output
▸ Comprised of many neurons
▸ These neurons are interconnected
▸ Some are “inputs” and some are “outputs”
THEORY
DEEP NETWORKS
▸ Nowadays we have so many neurons that we no longer describe the networks
with them
▸ Instead, we have layers that contain many neurons
▸ When layers are connected to each other, the constituent neurons get
connected
▸ Neurons in different types of layers behave differently from those in other
types
TEXT
CONVOLUTIONAL NEURAL NETWORKS
▸ CNNs use a layer type called a Spatial Convolution to operate on images
▸ This is a way of connecting neurons so that nearby pixels in 2D images are
connected to nearby neurons
▸ The operation the neurons perform is called convolution and is a generalized
technique for manipulating images
▸ The benefits are that local information gets local connections and the
operation itself is very powerful
TEXT
RECURRENT NEURAL NETWORKS
▸ RNNs use feedback to predict the future!
▸ Most networks are pure functions that process inputs and produce outputs
▸ RNNs feed outputs back into the network to model time
▸ It’s scarily effective
THEORY
NETWORK NOTATION
▸ Networks are written like a chemistry formula
▸ Instead of atoms, layer types are used
THEORY
TRAINING
▸ We train the network by showing it a bunch of inputs and desired outputs
▸ The training algorithm is called back propagation and involves a lot of
number crunching
▸ Neurons assign weights to the neurons they’re connected to
▸ These weights control how much the neighbors influence that neuron
▸ Training is the process of determining these weights
▸ The number of times a pair have been reused is called an epoch
THEORY
MINIMIZE ERROR BY ADJUSTING WEIGHTS
THEORY
GENERALIZING
▸ What’s the point of training a network if we already have a bunch of inputs and
outputs?
▸ The hope is that the network will learn how to solve problems it hasn’t yet seen
▸ When we train, we always reserve a batch of validation input and outputs that it
never sees
▸ We then use those inputs and outputs to rate the network
PRACTICE
PRACTICE
NEURAL NETWORK DISTRIBUTION
▸ While the concepts are universal…
▸ Neural networks are released as source code that can train and execute the network
▸ The code can be in any number of languages and use any number of support libraries
▸ Python with TensorFlow
▸ Lua with Torch
▸ Networks may only work with some hardware
▸ NVIDIA CUDA is used a lot (they invest in academia)
▸ Cloud solutions exist varying from virtualized hardware to proprietary languages
PRACTICE
PIX2PIX https://github.com/phillipi/pix2pix
▸ 2 Networks: Generator + Discriminator
PRACTICE
PREREQUISITES - HARDWARE
LOTS OF
PROCESSING
POWER
PRACTICE
INSTALLATION
▸ Install NVIDIA drivers
▸ CUDA - GPU programming SDK
▸ CUDNN - GPU libraries to help writing nets
▸ I did this on Mac and Linux
▸ Install Torch
▸ Lua libraries that can use CUDNN
▸ Install pix2pix
PRACTICE
TRAINING
$ DATA_ROOT=./datasets/facades 
name=facades_generation 
which_direction=AtoB 
th train.lua
PRACTICE
WE’RE TRAINING!
PRACTICE
TRAINING COMPLETE
▸ We get a trained
model file
▸ Contains the
structured of the
network
▸ Along with the
learned weights
PRACTICE
RUNNING THE NETWORK
▸ Now that the network is trained, we can run it against new inputs
▸ Put images you want to test in a special folder
▸ Run test.lua instead of train.lua
▸ Now you have outputs!
PRACTICE
BACK TO
ZOOM AND ENHANCE
ZOOM AND ENHANCE
GOOD TRAINING EXAMPLES
▸ It some fooling around to learn what the network can and can’t do
▸ You can’t just throw images at it and hope for the best
▸ You must spend time to give it good training examples
▸ Inputs and outputs should only differ by what you want the network to
learn
▸ Other differences will cause slow or impossible learning
▸ Examples: aspect ratio, cropping / region of interest, backgrounds
ZOOM AND ENHANCE
FACE ZOOMING EXAMPLE GENERATION
▸ Narrowed the task down to zooming in on faces
▸ Wrote an app that extracts faces from images using Apple’s CoreImage
framework
▸ Wrote another app that down samples those faces by 8x, then 16x
▸ This only simulates the problem of Z&E since noise is drastically reduced by
this downsampling
▸ Ideally, my inputs and outputs would be taken with the same camera using
two different zoom levels. But alas…
ZOOM AND ENHANCE
300 EXAMPLES - NOT JUST ME
ZOOM AND ENHANCE
RESULT
ZOOM AND ENHANCE
RESULT
ZOOM AND ENHANCE
RESULT
ZOOM AND ENHANCE
RESULT
FUTURE
GOTTA GITIT WORKIN
ON MOBILE
FUTURE
MOBILE LIBRARIES
▸ TensorFlow is a C++ library that runs on Android & iOS
▸ Miguel de Icaza is binding TensorFlow to .NET (hope it works on mobile!)
▸ https://github.com/migueldeicaza/TensorFlowSharp
▸ Apple includes Metal Performance Shaders that contains basic CNN routines
▸ I’m porting Torch, for now…

More Related Content

Similar to How I Made Zoom In and Enhance - Seattle Mobile .NET

Unit one ppt of deeep learning which includes Ann cnn
Unit one ppt of  deeep learning which includes Ann cnnUnit one ppt of  deeep learning which includes Ann cnn
Unit one ppt of deeep learning which includes Ann cnn
kartikaursang53
 
deepnet-lourentzou.ppt
deepnet-lourentzou.pptdeepnet-lourentzou.ppt
deepnet-lourentzou.ppt
yang947066
 
Introduction to Deep Learning presentation
Introduction to Deep Learning presentationIntroduction to Deep Learning presentation
Introduction to Deep Learning presentation
johanericka2
 
Deep learning tutorial 9/2019
Deep learning tutorial 9/2019Deep learning tutorial 9/2019
Deep learning tutorial 9/2019
Amr Rashed
 
Deep Learning Tutorial
Deep Learning TutorialDeep Learning Tutorial
Deep Learning Tutorial
Amr Rashed
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
Abhishek Bhandwaldar
 
Neural Networks, Spark MLlib, Deep Learning
Neural Networks, Spark MLlib, Deep LearningNeural Networks, Spark MLlib, Deep Learning
Neural Networks, Spark MLlib, Deep Learning
Asim Jalis
 
Introduction to artificial neural networks
Introduction to artificial neural networksIntroduction to artificial neural networks
Introduction to artificial neural networks
Chetan Ruparel
 
Karan ppt for neural network and deep learning
Karan ppt for neural network and deep learningKaran ppt for neural network and deep learning
Karan ppt for neural network and deep learning
KathiriyaParthiv
 
Build a simple image recognition system with tensor flow
Build a simple image recognition system with tensor flowBuild a simple image recognition system with tensor flow
Build a simple image recognition system with tensor flow
DebasisMohanty37
 
An introduction to Deep Learning
An introduction to Deep LearningAn introduction to Deep Learning
An introduction to Deep Learning
David Rostcheck
 
ANN.ppt[1].pptx
ANN.ppt[1].pptxANN.ppt[1].pptx
ANN.ppt[1].pptx
SrujanaChiliveri
 
[PR12] understanding deep learning requires rethinking generalization
[PR12] understanding deep learning requires rethinking generalization[PR12] understanding deep learning requires rethinking generalization
[PR12] understanding deep learning requires rethinking generalization
JaeJun Yoo
 
Deep Learning: Evolution of ML from Statistical to Brain-like Computing- Data...
Deep Learning: Evolution of ML from Statistical to Brain-like Computing- Data...Deep Learning: Evolution of ML from Statistical to Brain-like Computing- Data...
Deep Learning: Evolution of ML from Statistical to Brain-like Computing- Data...
Impetus Technologies
 
Hard & soft computing
Hard & soft computingHard & soft computing
Hard & soft computing
SCAROLINEECE
 
Neural network
Neural networkNeural network
Neural network
Saddam Hussain
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101
Felipe Prado
 
An Introduction to Deep Learning (May 2018)
An Introduction to Deep Learning (May 2018)An Introduction to Deep Learning (May 2018)
An Introduction to Deep Learning (May 2018)
Julien SIMON
 
deeplearning
deeplearningdeeplearning
deeplearning
huda2018
 
ML Module 3 Non Linear Learning.pptx
ML Module 3 Non Linear Learning.pptxML Module 3 Non Linear Learning.pptx
ML Module 3 Non Linear Learning.pptx
DebabrataPain1
 

Similar to How I Made Zoom In and Enhance - Seattle Mobile .NET (20)

Unit one ppt of deeep learning which includes Ann cnn
Unit one ppt of  deeep learning which includes Ann cnnUnit one ppt of  deeep learning which includes Ann cnn
Unit one ppt of deeep learning which includes Ann cnn
 
deepnet-lourentzou.ppt
deepnet-lourentzou.pptdeepnet-lourentzou.ppt
deepnet-lourentzou.ppt
 
Introduction to Deep Learning presentation
Introduction to Deep Learning presentationIntroduction to Deep Learning presentation
Introduction to Deep Learning presentation
 
Deep learning tutorial 9/2019
Deep learning tutorial 9/2019Deep learning tutorial 9/2019
Deep learning tutorial 9/2019
 
Deep Learning Tutorial
Deep Learning TutorialDeep Learning Tutorial
Deep Learning Tutorial
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
 
Neural Networks, Spark MLlib, Deep Learning
Neural Networks, Spark MLlib, Deep LearningNeural Networks, Spark MLlib, Deep Learning
Neural Networks, Spark MLlib, Deep Learning
 
Introduction to artificial neural networks
Introduction to artificial neural networksIntroduction to artificial neural networks
Introduction to artificial neural networks
 
Karan ppt for neural network and deep learning
Karan ppt for neural network and deep learningKaran ppt for neural network and deep learning
Karan ppt for neural network and deep learning
 
Build a simple image recognition system with tensor flow
Build a simple image recognition system with tensor flowBuild a simple image recognition system with tensor flow
Build a simple image recognition system with tensor flow
 
An introduction to Deep Learning
An introduction to Deep LearningAn introduction to Deep Learning
An introduction to Deep Learning
 
ANN.ppt[1].pptx
ANN.ppt[1].pptxANN.ppt[1].pptx
ANN.ppt[1].pptx
 
[PR12] understanding deep learning requires rethinking generalization
[PR12] understanding deep learning requires rethinking generalization[PR12] understanding deep learning requires rethinking generalization
[PR12] understanding deep learning requires rethinking generalization
 
Deep Learning: Evolution of ML from Statistical to Brain-like Computing- Data...
Deep Learning: Evolution of ML from Statistical to Brain-like Computing- Data...Deep Learning: Evolution of ML from Statistical to Brain-like Computing- Data...
Deep Learning: Evolution of ML from Statistical to Brain-like Computing- Data...
 
Hard & soft computing
Hard & soft computingHard & soft computing
Hard & soft computing
 
Neural network
Neural networkNeural network
Neural network
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101
 
An Introduction to Deep Learning (May 2018)
An Introduction to Deep Learning (May 2018)An Introduction to Deep Learning (May 2018)
An Introduction to Deep Learning (May 2018)
 
deeplearning
deeplearningdeeplearning
deeplearning
 
ML Module 3 Non Linear Learning.pptx
ML Module 3 Non Linear Learning.pptxML Module 3 Non Linear Learning.pptx
ML Module 3 Non Linear Learning.pptx
 

More from Frank Krueger

Open Source CLRs - Seattle Mobile .NET
Open Source CLRs - Seattle Mobile .NETOpen Source CLRs - Seattle Mobile .NET
Open Source CLRs - Seattle Mobile .NET
Frank Krueger
 
Asynchronous Application Patterns in C# - MonkeySpace
Asynchronous Application Patterns in C# - MonkeySpaceAsynchronous Application Patterns in C# - MonkeySpace
Asynchronous Application Patterns in C# - MonkeySpace
Frank Krueger
 
Programming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin EvolveProgramming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin Evolve
Frank Krueger
 
3 Mobile App Dev Problems - Monospace
3 Mobile App Dev Problems - Monospace3 Mobile App Dev Problems - Monospace
3 Mobile App Dev Problems - Monospace
Frank Krueger
 
Algorithms - Future Decoded 2016
Algorithms - Future Decoded 2016Algorithms - Future Decoded 2016
Algorithms - Future Decoded 2016
Frank Krueger
 
Overview of iOS 11 - Seattle Mobile .NET
Overview of iOS 11 - Seattle Mobile .NETOverview of iOS 11 - Seattle Mobile .NET
Overview of iOS 11 - Seattle Mobile .NET
Frank Krueger
 
Functional GUIs with F#
Functional GUIs with F#Functional GUIs with F#
Functional GUIs with F#
Frank Krueger
 
Mocast Postmortem
Mocast PostmortemMocast Postmortem
Mocast Postmortem
Frank Krueger
 
Programming iOS in C#
Programming iOS in C#Programming iOS in C#
Programming iOS in C#
Frank Krueger
 

More from Frank Krueger (9)

Open Source CLRs - Seattle Mobile .NET
Open Source CLRs - Seattle Mobile .NETOpen Source CLRs - Seattle Mobile .NET
Open Source CLRs - Seattle Mobile .NET
 
Asynchronous Application Patterns in C# - MonkeySpace
Asynchronous Application Patterns in C# - MonkeySpaceAsynchronous Application Patterns in C# - MonkeySpace
Asynchronous Application Patterns in C# - MonkeySpace
 
Programming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin EvolveProgramming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin Evolve
 
3 Mobile App Dev Problems - Monospace
3 Mobile App Dev Problems - Monospace3 Mobile App Dev Problems - Monospace
3 Mobile App Dev Problems - Monospace
 
Algorithms - Future Decoded 2016
Algorithms - Future Decoded 2016Algorithms - Future Decoded 2016
Algorithms - Future Decoded 2016
 
Overview of iOS 11 - Seattle Mobile .NET
Overview of iOS 11 - Seattle Mobile .NETOverview of iOS 11 - Seattle Mobile .NET
Overview of iOS 11 - Seattle Mobile .NET
 
Functional GUIs with F#
Functional GUIs with F#Functional GUIs with F#
Functional GUIs with F#
 
Mocast Postmortem
Mocast PostmortemMocast Postmortem
Mocast Postmortem
 
Programming iOS in C#
Programming iOS in C#Programming iOS in C#
Programming iOS in C#
 

Recently uploaded

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 

Recently uploaded (20)

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 

How I Made Zoom In and Enhance - Seattle Mobile .NET

  • 1. HOW I MADE ZOOM IN AND ENHANCE CONVOLUTIONAL NEURAL NETWORKS
  • 2.
  • 3.
  • 4.
  • 5. ?
  • 6. 1. SOMEONE ELSE DID IT 2. FINALLY THERE WAS A LIBRARY I COULD UNDERSTAND
  • 8. THEORY ▸ A way to compute a function inspired by the human brain ▸ Much simpler than the brain! ▸ Input -> Network -> Output ▸ Comprised of many neurons ▸ These neurons are interconnected ▸ Some are “inputs” and some are “outputs”
  • 9. THEORY DEEP NETWORKS ▸ Nowadays we have so many neurons that we no longer describe the networks with them ▸ Instead, we have layers that contain many neurons ▸ When layers are connected to each other, the constituent neurons get connected ▸ Neurons in different types of layers behave differently from those in other types
  • 10. TEXT CONVOLUTIONAL NEURAL NETWORKS ▸ CNNs use a layer type called a Spatial Convolution to operate on images ▸ This is a way of connecting neurons so that nearby pixels in 2D images are connected to nearby neurons ▸ The operation the neurons perform is called convolution and is a generalized technique for manipulating images ▸ The benefits are that local information gets local connections and the operation itself is very powerful
  • 11. TEXT RECURRENT NEURAL NETWORKS ▸ RNNs use feedback to predict the future! ▸ Most networks are pure functions that process inputs and produce outputs ▸ RNNs feed outputs back into the network to model time ▸ It’s scarily effective
  • 12. THEORY NETWORK NOTATION ▸ Networks are written like a chemistry formula ▸ Instead of atoms, layer types are used
  • 13. THEORY TRAINING ▸ We train the network by showing it a bunch of inputs and desired outputs ▸ The training algorithm is called back propagation and involves a lot of number crunching ▸ Neurons assign weights to the neurons they’re connected to ▸ These weights control how much the neighbors influence that neuron ▸ Training is the process of determining these weights ▸ The number of times a pair have been reused is called an epoch
  • 14. THEORY MINIMIZE ERROR BY ADJUSTING WEIGHTS
  • 15. THEORY GENERALIZING ▸ What’s the point of training a network if we already have a bunch of inputs and outputs? ▸ The hope is that the network will learn how to solve problems it hasn’t yet seen ▸ When we train, we always reserve a batch of validation input and outputs that it never sees ▸ We then use those inputs and outputs to rate the network
  • 17. PRACTICE NEURAL NETWORK DISTRIBUTION ▸ While the concepts are universal… ▸ Neural networks are released as source code that can train and execute the network ▸ The code can be in any number of languages and use any number of support libraries ▸ Python with TensorFlow ▸ Lua with Torch ▸ Networks may only work with some hardware ▸ NVIDIA CUDA is used a lot (they invest in academia) ▸ Cloud solutions exist varying from virtualized hardware to proprietary languages
  • 18. PRACTICE PIX2PIX https://github.com/phillipi/pix2pix ▸ 2 Networks: Generator + Discriminator
  • 20.
  • 21. PRACTICE INSTALLATION ▸ Install NVIDIA drivers ▸ CUDA - GPU programming SDK ▸ CUDNN - GPU libraries to help writing nets ▸ I did this on Mac and Linux ▸ Install Torch ▸ Lua libraries that can use CUDNN ▸ Install pix2pix
  • 24. PRACTICE TRAINING COMPLETE ▸ We get a trained model file ▸ Contains the structured of the network ▸ Along with the learned weights
  • 25. PRACTICE RUNNING THE NETWORK ▸ Now that the network is trained, we can run it against new inputs ▸ Put images you want to test in a special folder ▸ Run test.lua instead of train.lua ▸ Now you have outputs!
  • 27. BACK TO ZOOM AND ENHANCE
  • 28. ZOOM AND ENHANCE GOOD TRAINING EXAMPLES ▸ It some fooling around to learn what the network can and can’t do ▸ You can’t just throw images at it and hope for the best ▸ You must spend time to give it good training examples ▸ Inputs and outputs should only differ by what you want the network to learn ▸ Other differences will cause slow or impossible learning ▸ Examples: aspect ratio, cropping / region of interest, backgrounds
  • 29. ZOOM AND ENHANCE FACE ZOOMING EXAMPLE GENERATION ▸ Narrowed the task down to zooming in on faces ▸ Wrote an app that extracts faces from images using Apple’s CoreImage framework ▸ Wrote another app that down samples those faces by 8x, then 16x ▸ This only simulates the problem of Z&E since noise is drastically reduced by this downsampling ▸ Ideally, my inputs and outputs would be taken with the same camera using two different zoom levels. But alas…
  • 30. ZOOM AND ENHANCE 300 EXAMPLES - NOT JUST ME
  • 37. FUTURE MOBILE LIBRARIES ▸ TensorFlow is a C++ library that runs on Android & iOS ▸ Miguel de Icaza is binding TensorFlow to .NET (hope it works on mobile!) ▸ https://github.com/migueldeicaza/TensorFlowSharp ▸ Apple includes Metal Performance Shaders that contains basic CNN routines ▸ I’m porting Torch, for now…