E-Book, Englisch, 421 Seiten
Gad Practical Computer Vision Applications Using Deep Learning with CNNs
1. ed
ISBN: 978-1-4842-4167-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
With Detailed Examples in Python Using TensorFlow and Kivy
E-Book, Englisch, 421 Seiten
ISBN: 978-1-4842-4167-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
Deploy deep learning applications into production across multiple platforms. You will work on computer vision applications that use the convolutional neural network (CNN) deep learning model and Python. This book starts by explaining the traditional machine-learning pipeline, where you will analyze an image dataset. Along the way you will cover artificial neural networks (ANNs), building one from scratch in Python, before optimizing it using genetic algorithms.
For automating the process, the book highlights the limitations of traditional hand-crafted features for computer vision and why the CNN deep-learning model is the state-of-art solution. CNNs are discussed from scratch to demonstrate how they are different and more efficient than the fully connected ANN (FCNN). You will implement a CNN in Python to give you a full understanding of the model.
After consolidating the basics, you will use TensorFlow to build a practical image-recognition model that you will deploy to a web server using Flask, making it accessible over the Internet. Using Kivy and NumPy, you will create cross-platform data science applications with low overheads.
This book will help you apply deep learning and computer vision concepts from scratch, step-by-step from conception to production.
What You Will Learn Understand how ANNs and CNNs work Create computer vision applications and CNNs from scratch using PythonFollow a deep learning project from conception to production using TensorFlowUse NumPy with Kivy to build cross-platform data science applications
Who This Book Is ForData scientists, machine learning and deep learning engineers, software developers.
Ahmed Fawzy Gad is a teaching assistant who received his M.Sc. degree in 2018 after receiving his 2015 excellent with honors B.Sc. in information technology from the Faculty of Computers and Information (FCI), Menoufia University, Egypt. Ahmed is interested in deep learning, machine learning, computer vision, and Python. He aims to add value to the data science community by sharing his writings and preparing tutorials.
Autoren/Hrsg.
Weitere Infos & Material
1;Table of Contents;5
2;About the Author;10
3;About the Technical Reviewers;11
4;Acknowledgments;12
5;Introduction;13
6;Chapter 1: Recognition in Computer Vision;19
6.1;Image Recognition Pipeline;20
6.2;Feature Extraction;22
6.2.1;Color Histogram;23
6.2.1.1;Histogram of a Real-World Image;25
6.2.1.2;HSV Color Space;26
6.2.2;GLCM;29
6.2.2.1;D Values;30
6.2.2.2;? Values;30
6.2.2.3;GLCM Normalization;32
6.2.3;HOG;35
6.2.3.1;Image Gradients;36
6.2.3.2;Gradient Direction;37
6.2.3.3;Contributing to Histogram Bins;37
6.2.3.4;HOG Steps;39
6.2.4;LBP;54
6.3;Feature Selection & Reduction;57
6.3.1;Filter;58
6.3.2;Wrapper;59
6.3.3;Embedded;61
6.3.4;Regularization;61
7;Chapter 2: Artificial Neural Networks;63
7.1;Introduction to ANNs;64
7.1.1;Linear Models Are the Base of ANNs;65
7.1.2;Graphing ANNs;70
7.2;Adjusting Learning Rate for Training ANN;75
7.2.1;Filter Example;75
7.2.1.1;ANN Architecture;76
7.2.1.2;Activation Function;77
7.2.1.3;Python Implementation;77
7.2.2;Learning Rate;80
7.2.3;Testing the Network;81
7.3;Weight Optimization Using Backpropagation;82
7.3.1;Backpropagation for NN Without Hidden Layer;82
7.3.2;Weights Update Equation;85
7.3.3;Why Is the Backpropagation Algorithm Important?;87
7.3.4;Forward vs. Backward Passes;87
7.3.4.1;Partial Derivative;88
7.3.4.1.1;Change in Prediction Error wrt Weights;89
7.3.4.1.2;Prediction Error to Weights Chain;89
7.3.4.2;Calculating Chain Partial Derivatives;91
7.3.4.3;Interpreting Results of Backpropagation;94
7.3.4.4;Updating Weights;94
7.3.5;Backpropagation for NN with Hidden Layer;95
7.3.5.1;Partial Derivatives;98
7.3.5.2;Updating Weights;106
7.4;Overfitting;107
7.4.1;Understand Regularization Based on a Regression Example;109
7.4.2;Model Capacity/Complexity;112
7.4.3;L1 Regularization;113
7.5;Designing ANN;115
7.5.1;Example 1: ANN Without Hidden Layer;116
7.5.2;Example 2: ANN with a Single Hidden Layer;120
8;Chapter 3: Recognition Using ANN with Engineered Features;125
8.1;Fruits 360 Dataset Feature Mining;125
8.1.1;Feature Mining;126
8.1.2;Feature Reduction;133
8.1.3;Filtering Using ANN;136
8.2;ANN Implementation;138
8.3;Engineered Feature Limitations;144
8.4;Not the End of Engineered Features;145
9;Chapter 4: ANN Optimization;147
9.1;Introduction to Optimization;148
9.1.1;Single- vs. Multiobjective Optimization;148
9.2;GA;152
9.2.1;Best-Parents Selection;155
9.2.2;Variation Operators;156
9.2.2.1;Crossover;156
9.2.2.2;Mutation;157
9.2.3;Python Implementation of an Example;158
9.2.3.1;Complete Implementation;166
9.3;NSGA-II;169
9.3.1;NSGA-II Steps;170
9.3.2;Dominance;172
9.3.3;Crowding Distance;180
9.3.4;Tournament Selection;183
9.3.5;Crossover;184
9.3.6;Mutation;185
9.4;Optimizing ANN Using GA;186
9.4.1;Complete Python Implementation;191
10;Chapter 5: Convolutional Neural Networks;200
10.1;From ANN to CNN;200
10.1.1;The Intuition Behind DL;201
10.1.2;Derivation of Convolution;205
10.1.2.1;Image Analysis Using FC Network;206
10.1.2.2;Large Number of Parameters;208
10.1.2.3;Neuron Grouping;209
10.1.2.4;Pixel Spatial Correlation;212
10.1.2.5;Convolution in CNN;213
10.1.3;Designing a CNN;215
10.1.4;Pooling Operation for Parameter Reduction;219
10.1.5;Convolution Operation Example;221
10.1.6;Max Pooling Operation Example;223
10.2;Building a CNN Using NumPy from Scratch;224
10.2.1;Reading the Input Image;225
10.2.2;Preparing Filters;226
10.2.3;Conv Layer;226
10.2.4;ReLU Layer;232
10.2.5;Max Pooling Layer;233
10.2.6;Stacking Layers;235
10.2.7;Complete Code;237
11;Chapter 6: TensorFlow Recognition Application;245
11.1;Introduction to TF;245
11.1.1;Tensor;247
11.1.2;TF Core;247
11.1.3;Dataflow Graph;248
11.1.3.1;Tensor Names;249
11.1.3.2;Creating a TF Session;251
11.1.3.3;Parameterized Graph Using Placeholder;255
11.1.3.4;TF Variables;258
11.1.3.5;Variable Initialization;260
11.1.4;Graph Visualization Using TB;261
11.1.5;Linear Model;264
11.1.5.1;GD Optimizer from TF Train API;268
11.1.5.2;Locating Parameters to Optimize;270
11.2;Building FFNN;271
11.2.1;Linear Classification;272
11.2.2;Nonlinear Classification;281
11.3;CIFAR10 Recognition Using CNN;286
11.3.1;Preparing Training Data;287
11.3.2;Building the CNN;289
11.3.3;Training CNN;294
11.3.4;Saving the Trained Model;297
11.3.5;Complete Code to Build and Train CNN;298
11.3.6;Preparing Test Data;308
11.3.7;Testing the Trained CNN Model;309
12;Chapter 7: Deploying Pretrained Models;311
12.1;Application Overview;311
12.2;Introduction to Flask;312
12.2.1;route() Decorator;314
12.2.2;add_rule_url Method;317
12.2.3;Variable Rules;317
12.2.4;Endpoint;319
12.2.5;HTML Form;321
12.2.6;File Upload;323
12.2.7;HTML Inside Flask Application;325
12.2.7.1;Flask Templates;326
12.2.7.2;Dynamic Templates;327
12.2.8;Static Files;330
12.3;Deploying Trained Model Using Fruits 360 Dataset;333
12.4;Deploying Trained Model Using CIFAR10 Dataset;342
13;Chapter 8: Cross-Platform Data Science Applications;355
13.1;Introduction to Kivy;356
13.1.1;Basic Application Using BoxLayout;357
13.1.2;Kivy Application Life Cycle;358
13.1.3;Widget Size;362
13.1.4;GridLayout;364
13.1.5;More Widgets;366
13.1.6;Widget Tree;367
13.1.7;Handling Events;370
13.1.8;KV Language;372
13.2;P4A;377
13.2.1;Installing Buildozer;377
13.2.2;Preparing buildozer.spec File;378
13.2.3;Building Android Application Using Buildozer;381
13.3;Image Recognition on Android;383
13.4;CNN on Android;389
14;Appendix A: Installing Your Own Projects Using pip Installer;397
14.1;Creating a Simple Python Project;398
14.1.1;Project Structure;398
14.1.2;Project Implementation;398
14.1.3;Running the Project;399
14.1.4;Importing the Module into a File Inside Its Directory;400
14.1.5;Importing the Module into a File Outside Its Directory;400
14.2;How Does Python Locate Libraries?;402
14.3;Manual Installation by Copying Project Files to Site-Packages;403
14.4;How Do Python Installers Locate Libraries?;404
14.5;Preparing the Package and Its Files (__init__.py and setup.py);404
14.5.1;__init__.py;405
14.5.2;setup.py;406
14.6;Distributing the Package;407
14.7;Uploading the Distribution Files Online to Test PyPI;409
14.8;Installing the Distributed Package from Test PyPI;411
14.9;Importing and Using the Installed Package;412
14.10;Using PyPI Rather Than Test PyPI;412
15;Index;413




