Deep Learning in Practice helps you learn how to develop and optimize a model for your projects using Deep Learning (DL) methods and architectures.
- Demonstrates a quick review on Python, NumPy, and TensorFlow fundamentals.
- Explains and provides examples of deploying TensorFlow and Keras in several projects.
- Explains the fundamentals of Artificial Neural Networks (ANNs).
- Presents several examples and applications of ANNs.
- Learning the most popular DL algorithms features.
- Explains and provides examples for the DL algorithms that are presented in this book.
- Analyzes the DL network’s parameter and hyperparameters.
- Reviews state-of-the-art DL examples.
- Necessary and main steps for DL modeling.
- Implements a Virtual Assistant Robot (VAR) using DL methods.
- Necessary and fundamental information to choose a proper DL algorithm.
- Gives instructions to learn how to optimize your DL model IN PRACTICE.
This book is useful for undergraduate and graduate students, as well as practitioners in industry and academia. It will serve as a useful reference for learning deep learning fundamentals and implementing a deep learning model for any project, step by step.
Table of Contents
About the Author
1.1 What is Learning?
1.2 What is Machine Learning?
1.3 What is Deep Learning?
1.4 About this Book!
1.4.2 Python /NumPy
1.4.3 TensorFlow and Keras fundamentals
1.4.4 Artificial Neural Networks (ANNs) Fundamentals and Architectures
1.4.5 Deep Neural Networks (DNNs) Fundamentals and Architectures
1.4.6 Deep Neural Networks for Images and Audio Data Analysis
1.4.7 Deep Neural Networks for Virtual Assistant Robots
1.4.8 What is the best model?
2. Python/NumPy Fundamentals
2.1.3 Operators and Operand
2.1.4 Statements and Expressions
2.1.6 For Loop
2.1.7 While Loop
2.1.15 Object (class)
2.2.1 Create Array
2.2.3 Access Elements
2.2.4 Array Slicing
2.2.5 Data Type
2.2.6 Array Data Check
2.2.7 Shape and Reshape Array
2.2.8 Array Iterating
2.2.9 Joining Array
2.2.10 Splitting Array
2.2.11 Searching Arrays
2.2.12 Sorting Arrays
2.2.13 Filter Array
2.2.14 Random Numbers
2.2.15 Array Vectorization
2.2.16 np.zeros and np.ones
2.2.17 hstack and vstack
2.2.18 Generate Random Numbers
2.2.19 Mathematical Functions
2.2.20 Dot Product and Matrix Multiplication
3. TensorFlow Fundamentals
3.1 How TensorFlow Works?
3.4 Building a NN Using TensorFlow
3.4.1 Import the Data
3.4.2 Loading and Normalize the Data
3.4.3 Build the Model
3.4.4 Train and Evaluate the Model
3.5 Building a CNN Using TensorFlow
3.5.2 Input Layer
3.5.3 Convolutional and Pooling Layers
3.5.4 Dense Layer
3.5.5 Train and Evaluate the Model
3.5.6 Test the Model
3.6 Setup and Install Keras
3.6.1 Create a Virtual Environment
3.6.2 Activate the Environment
3.6.3 Python Libraries
3.6.4 Available Modules
3.6.5 Import Libraries and Modules
3.6.6 Train and Predict the Model
3.7 Implement an Example Using Keras
3.7.1 MNIST Example
4. Artificial Neural Networks Fundamentals and Architectures
4.1.5 Activation Function
4.1.7 Training, Testing, and Validation Sets
4.1.10 Confusion Matrix
4.1.11 Accuracy Metrics
4.1.12 Balanced and Unbalanced Datasets
4.1.13 One Hot Encoding
4.2 Artificial Neural Networks (ANNs)
4.2.1 Biological Neuron
4.2.2 Artificial Neuron
4.3 Activation Functions
4.3.1 Sigmoid (sig)
4.3.2 Tanh or Hyperbolic Tangent (tan)
4.3.3 Rectified Linear Unit (ReLU)
4.3.4 Leaky ReLU
4.4 Loss Functions
4.4.1 Cross-Entropy Loss
4.4.2 MSE (L2) Loss
4.5 Optimization Functions
4.5.1 Learning Rate
4.5.3 Gradient Descent
4.5.4 Stochastic Gradient Descent
4.6 Linear and Nonlinear Functions
4.6.1 Linear Function
4.6.2 Nonlinear Functions
4.7 ANNs architectures
4.7.1 Feed Forward Neural Networks (FFNNs)
188.8.131.52 FFN Example in TensorFlow
4.7.3 Single-layer perceptron
4.7.4 Multi-Layer Perceptron (MLP)
184.108.40.206 MLP Example in TensorFlow
5. Deep Neural Networks (DNNs)Fundamentals and Architectures
5.1 Deep Neural Networks (DNNs)
5.1.1 What is Deep Learning?
5.1.2 Deep Learning Needs!
5.1.3 How to deploy DL More Efficiently?
5.1.4 Vanishing Gradient
5.1.8 Data Augmentation
5.1.11 L1 and L2
5.1.13 End-to-End Learning
5.2 Deep Learning Applications
5.3 Deep Learning Algorithms and Architectures
5.3.1 Convolutional Neural Networks (CNNs)
5.3.2 Recurrent Neural Networks (RNNs)
5.3.3 Long Short-Term Memory (LSTM)
5.3.4 Generative Adversarial Network (GAN)
5.3.5 Residual Neural Network Learning ResNets
5.4 Convolutional Neural Networks (CNNs)
5.4.1 CNN Layers
220.127.116.11 Convolution Layers
18.104.22.168 Pooling Layers
22.214.171.124 Batch Normalization
126.96.36.199 Fully Connected Llayer
5.4.2 Design a CNN
5.5 Recurrent Neural Networks (RNNs)
5.5.1 Recurrent Neural Network Architecture
5.5.2 Long Short-Term Memory (LSTM)
5.5.3 Designing an RNN
188.8.131.52 Import Libraries
184.108.40.206 Load and Normalize the Dataset
220.127.116.11 Build the Model
18.104.22.168 Train the Model
22.214.171.124 Evaluate the Model
5.6 Generative Adversarial Networks (GANs)
5.6.1 What is a GAN?
5.6.2 A GAN for Fashion Dataset
126.96.36.199. Loading Dataset
188.8.131.52 Data Preprocessing
184.108.40.206 Defining the Discriminator Model
220.127.116.11 Defining the Generator Model
18.104.22.168 Combining the Generator and Discriminator Model
22.214.171.124 Create Train Function and Train the Model
126.96.36.199 Predict (generate data)
6. Deep Neural Networks(DNNs) for Images Analysis
6.1 Deep Learning and Image Analysis
6.2 Convolutional Neural Networks (CNNs) and Image Analysis
6.2.1 Filter Parameters
188.8.131.52 Number and Type of Filters
184.108.40.206 Filters Size
220.127.116.11 Stride and Padding Size
6.2.2 Number of Parameters
18.104.22.168 Input Layer
22.214.171.124 Convolutional Layer
126.96.36.199 Pooling Layer
188.8.131.52 Fully Connected Layer (FC)
6.2.3 Imagenet Challenge
6.2.4 CNN Architecture
184.108.40.206 LeNet-5 (1998)
220.127.116.11 AlexNet (2012)
18.104.22.168 GoogleNet / Inception-v1 (2014)
22.214.171.124 VGGNet-16 (2014)
126.96.36.199 Inception-v3 (2015)
188.8.131.52 ResNet (2015)
184.108.40.206 Inception-v4 (2016)
6.3 General Strategy to Implement Model Using CNNs
6.3.1. Import Libraries
6.3.2. Load the Data and Create the Data Categories
6.3.3. Make the Model
6.3.4. Train the Model
6.3.5. Test the Mode
6.4 Object Recognition Using CNNs
6.4.1. Import Libraries
6.4.2. Load the Data and Generate a Dataset
6.4.3. Make the Model
6.4.4. Train the Model
6.4.5. Test the Model
6.5 Image Classification Using CNNs
6.5.1. Import Libraries
6.5.2. Load the Data
6.5.3. Make the Model
6.5.4. Train the Model
6.5.5. Test the Model
6.6 Image Segmentation
6.6.1. Import Libraries
6.6.2. Load the Data and Generate a Dataset
6.6.3. Segmentation Map
6.6.4. Make the Model
6.6.5. Train the Model
6.6.6. Test the Model
6.7 Object Recognition Using CNNs
6.7.1. Import Libraries
6.7.2. Load the Data and Generate a Dataset
6.7.3. Make the Model
220.127.116.11 The Generator Function
18.104.22.168 The Discriminator Function
6.7.4. Train the Model
6.7.5. Generate images
7. Deep Neural Networks for Virtual Assistant Robot
7.1 Virtual Assistant Robot
7.2 Facial Detection and Recognition
7.2.2 Face Detection
22.214.171.124 Import Libraries
126.96.36.199 Define CNN Model and Training
188.8.131.52 Model Training
184.108.40.206 Evaluate Performance
7.2.3 Landmark Detection
220.127.116.11 CNN Model
18.104.22.168 Model Training
22.214.171.124 Test the Trained Model
7.2.4 Spoof Detection
7.2.5 Encoding the Face
7.3 Emotion Recognition Using Speech
7.3.1 Dataset Collection
7.3.2 Data Preprocessing
126.96.36.199 Feature Extraction
188.8.131.52 Data Augmentation
7.3.3 Model Training
7.3.4 Model Evaluation
7.3.5 Test the Trained Model
7.4 Speech to Text
7.4.1. Feature Extraction
7.4.2. Deep Neural Networks Modeling
7.4.4. Predictions Calculation
7.5 Sentiment Analysis
7.5.1. Load Dataset
7.5.2. Create a DAN Network
7.5.3. Train the Network
7.5.4. Evaluate the Model
8. Finding the Best Model
8.1 Data Preprocessing
8.2 What is a Good Model?
8.3 What is the Noise?
8.4 What is the Bias?
8.4.1 Incorrect Classifier
8.4.2 Incorrect Features
8.5 What is the Variance?
8.5.1. New Dataset
8.7 How Can We Find the Problems in a Model?
8.7.1 High Variance
8.7.2 High Bias
Dr. Mehdi Ghayoumi is a course facilitator at Cornell University and adjunct faculty of Computer Science at the University of San Diego. Prior to this, he was a research assistant professor at SUNY at Binghamton, where he was the Media Core Lab’s dynamic leader. He was also a lecturer at Kent State University, where he received the Teaching Award for two consecutive years in 2016 and 2017. In addition, he has been teaching machine learning, data science, robotic and programming courses for several years.
Dr. Ghayoumi research interests are in Machine Learning, Machine Vision, Robotics, and Human-Robot Interaction (HRI). His research focuses are on building real systems for realistic environment settings, and his current projects have applications in Human-Robot Interaction, manufacturing, biometric, and healthcare.
He is a technical program committee member of several conferences, workshops, and editorial board member of several journals in machine learning, mathematics, and robotics, like ICML, ICPR, HRI, FG, WACV, IROS, CIBCB, and JAI. In addition, his research papers have been published at conferences and journals in the fields, including Human-Computer Interaction (HRI), Robotics Science and Systems (RSS), International Conference on Machine Learning and Applications (ICMLA), and others.