Table of Contents
About the Author
About the Technical Reviewers
Acknowledgments
Introduction
Chapter 1: Recognition in Computer Vision
Image Recognition Pipeline
Feature Extraction
Color Histogram
Histogram of a Real-World Image
HSV Color Space
GLCM
D Values
θ Values
GLCM Normalization
HOG
Image Gradients
Gradient Direction
Contributing to Histogram Bins
HOG Steps
LBP
Feature Selection & Reduction
Filter
Wrapper
Embedded
Regularization
Chapter 2: Artificial Neural Networks
Introduction to ANNs
Linear Models Are the Base of ANNs
Graphing ANNs
Adjusting Learning Rate for Training ANN
Filter Example
ANN Architecture
Activation Function
Python Implementation
Learning Rate
Testing the Network
Weight Optimization Using Backpropagation
Backpropagation for NN Without Hidden Layer
Weights Update Equation
Why Is the Backpropagation Algorithm Important?
Forward vs. Backward Passes
Partial Derivative
Change in Prediction Error wrt Weights
Prediction Error to Weights Chain
Calculating Chain Partial Derivatives
Interpreting Results of Backpropagation
Updating Weights
Backpropagation for NN with Hidden Layer
Partial Derivatives
Updating Weights
Overfitting
Understand Regularization Based on a Regression Example
Model Capacity/Complexity
L1 Regularization
Designing ANN
Example 1: ANN Without Hidden Layer
Example 2: ANN with a Single Hidden Layer
Chapter 3: Recognition Using ANN with Engineered Features
Fruits 360 Dataset Feature Mining
Feature Mining
Feature Reduction
Filtering Using ANN
ANN Implementation
Engineered Feature Limitations
Not the End of Engineered Features
Chapter 4: ANN Optimization
Introduction to Optimization
Single- vs. Multiobjective Optimization
GA
Best-Parents Selection
Variation Operators
Crossover
Mutation
Python Implementation of an Example
Complete Implementation
NSGA-II
NSGA-II Steps
Dominance
Crowding Distance
Tournament Selection
Crossover
Mutation
Optimizing ANN Using GA
Complete Python Implementation
Chapter 5: Convolutional Neural Networks
From ANN to CNN
The Intuition Behind DL
Derivation of Convolution
Image Analysis Using FC Network
Large Number of Parameters
Neuron Grouping
Pixel Spatial Correlation
Convolution in CNN
Designing a CNN
Pooling Operation for Parameter Reduction
Convolution Operation Example
Max Pooling Operation Example
Building a CNN Using NumPy from Scratch
Reading the Input Image
Preparing Filters
Conv Layer
ReLU Layer
Max Pooling Layer
Stacking Layers
Complete Code
Chapter 6: TensorFlow Recognition Application
Introduction to TF
Tensor
TF Core
Dataflow Graph
Tensor Names
Creating a TF Session
Parameterized Graph Using Placeholder
TF Variables
Variable Initialization
Graph Visualization Using TB
Linear Model
GD Optimizer from TF Train API
Locating Parameters to Optimize
Building FFNN
Linear Classification
Nonlinear Classification
CIFAR10 Recognition Using CNN
Preparing Training Data
Building the CNN
Training CNN
Saving the Trained Model
Complete Code to Build and Train CNN
Preparing Test Data
Testing the Trained CNN Model
Chapter 7: Deploying Pretrained Models
Application Overview
Introduction to Flask
route() Decorator
add_rule_url Method
Variable Rules
Endpoint
HTML Form
File Upload
HTML Inside Flask Application
Flask Templates
Dynamic Templates
Static Files
Deploying Trained Model Using Fruits 360 Dataset
Deploying Trained Model Using CIFAR10 Dataset
Chapter 8: Cross-Platform Data Science Applications
Introduction to Kivy
Basic Application Using BoxLayout
Kivy Application Life Cycle
Widget Size
GridLayout
More Widgets
Widget Tree
Handling Events
KV Language
P4A
Installing Buildozer
Preparing buildozer.spec File
Building Android Application Using Buildozer
Image Recognition on Android
CNN on Android
Appendix A: Installing Your Own Projects Using pip Installer
Creating a Simple Python Project
Project Structure
Project Implementation
Running the Project
Importing the Module into a File Inside Its Directory
Importing the Module into a File Outside Its Directory
How Does Python Locate Libraries?
Manual Installation by Copying Project Files to Site-Packages
How Do Python Installers Locate Libraries?
Preparing the Package and Its Files (__init__.py and setup.py)
__init__.py
setup.py
Distributing the Package
Uploading the Distribution Files Online to Test PyPI
Installing the Distributed Package from Test PyPI
Importing and Using the Installed Package
Using PyPI Rather Than Test PyPI
Index