SlideShare a Scribd company logo
1 of 30
Download to read offline
Dataset Augmentation
MNIST Dataset
• The process of applying
simple and complex
transformations to
enhance the
performance of a model.
• Dataset augmentation
applies transformations
to your training
examples.
• Offline & Online data
augmentation.
Regularization
• Dropout: Turn off some neuron in each iteration with probability p.
• Early Stopping: Provide guidance such that how many iterations can
be run before the model begins to overfit.
• Weight Constraint: Scales weights to a pre-defined threshold.
• Noise:Introduce stochastic noise into training process.
• noise as a regularization method in a neural network with overfitting.
Case Study
Gaussian Noise
Results
Dropout & Early Stopping
Introduction to Dropout
Cont.,
• Dropout is a technique where randomly selected neurons are ignored
during the training process.
• Large neural networks trained on small datasets will always overfit the
training data.
• Dropout changed the concept of learning all the weights together.
• It will do only partial learning.
• Can be used in Fully connected layers/ convolutional layers/ Recurrent
layers
• A new hyper parameter is introduced that specifies the probability
at which outputs of the particular layer are dropped out.
Some important aspects:
• Can be used with all network types and resolved Co-adaptation
• The weights of the network will be larger than normal network
because of dropout.
• Dropout forces a neural network to learn more robust features .
• Dropout roughly doubles the number of iterations required to
converge. However, training time for each epoch is less.
• Over fitting due to Co-adaptation – L1 & L2 Regularization
• scale the weights w by p , dropout for intermediate layer is 0.5 and
input layer is 0.2.
CASE STUDY: CIFAR-10
• The deep network is built had three convolution layers of size 64,
128 and 256 followed by two densely connected layers of size 512
and an output layer of size 10 (number of classes in the CIFAR-10
dataset).
• ReLU as the activation function for hidden layers and sigmoid for
the output layer &cross-entropy loss.
Case: CIFAR-10 dataset
Early stopping
• Early stopping is an optimization technique that is used to reduce
overfitting without compromising on the accuracy of the model.
• Deciding on the number epochs/ training time.
• Underfit/ overfit for limited or too long training.
• Stop training once the models performance start to degrade for
validation set is called as Early stopping.
• Elements in Early stopping
Monitoring model performance.
Trigger to stop training.
The choice of model to use.
Cont.,
• Early Stopping protect against over
fitting and needs considerably less
number of Epoch to train.
• A callback is a powerful tool to
customize the behavior of a Keras
model during training, evaluation, or
inference
• Callback-internal states and statistics
of a model during training
• Starting/ Stopping of the training
process
• End of epochs/ end of training a
batch.
• Monitor, patience, mode,
restore_best_weights
callback =
tf.keras.callbacks.EarlyStopping(patie
nce=4, restore_best_weights=True)
history1 = model2.fit(trn_images,
trn_labels,
epochs=50,validation_data=(valid_image
s, valid_labels),callbacks=[callback])
Ensemble Method
Ensemble Methods
• A solution to the high variance of neural networks is to train
multiple models and combine their predictions.
• Training Data: Vary the choice of data used to train each model in
the ensemble.
• Ensemble Models: Vary the choice of the models used in the
ensemble.
• Combinations: Vary the choice of the way that outcomes from
ensemble members are combined
Batch Normalization
• Batch normalization is one of the important features in Deep
Learning.
• we normalize each layer’s inputs by using the mean and standard
deviation of the values in the current batch.
• Batch normalization acts as a Regularizer, normalizing the inputs,
in the backpropagation process, and can be adapted to most of the
models to converge better.
• Normalizing the inputs to hidden layers helps in faster learning.
• Batch normalization reduces the covariate shift.
Cont.,
• when the distribution of input data shifts between the training
environment and live environment, the input and the output
distribution may change, but the labels remain the same.
• Covariate shift can occur gradually over time or suddenly after the
deployment of the model.
• Normalization has the effect of stabilizing the neural network.
• we use batch normalization by normalizing the outputs using
mean=0, standard dev=1 (μ=0,σ=1).
• The learning rates can be made high for improving the training
process.
Add ‘E’ to avoid divide by zero error
Importing Libraries
keras.layers.BatchNormalization(axis=-1, momentum=0.99, epsilon=0.001,
center=True, scale=True, beta_initializer='zeros', gamma_initializer='ones',
moving_mean_initializer='zeros', moving_variance_initializer='ones',
beta_regularizer=None, gamma_regularizer=None, beta_constraint=None,
gamma_constraint=None)
Result – Batch Normalization
Weight Initialization Techniques
• The weight initialization technique adapted for neural network
can determine how quickly the network converges.
• In neural networks, weights represent the strength of connections
between units or neurons in adjacent network layers.
• Improperly initialized weights can negatively affect the training
process by contributing to the vanishing or exploding gradient
problem.
• Initializing with weights that are too large may result in exploding
gradient values during forward propagation or back-propagation.
Cont.,
• Xavier and Bengio (2010) proposed the “Xavier” initialization
which considers the size of the network (number of input and
output units) while initializing weights.
• This approach ensures that the weights stay within a reasonable
range of values by making them inversely proportional to the
square root of the number of units in the previous layer.
• Weight pruning means eliminating unnecessary values in the
weight tensors.
References
• Mohamed Elgendy, Deep Learning for Vision Systems, Manning
Publications.

More Related Content

Similar to Dataset Augmentation and machine learning.pdf

H2O World - Top 10 Deep Learning Tips & Tricks - Arno Candel
H2O World - Top 10 Deep Learning Tips & Tricks - Arno CandelH2O World - Top 10 Deep Learning Tips & Tricks - Arno Candel
H2O World - Top 10 Deep Learning Tips & Tricks - Arno CandelSri Ambati
 
backpropagation in neural networks
backpropagation in neural networksbackpropagation in neural networks
backpropagation in neural networksAkash Goel
 
Hands on machine learning with scikit-learn and tensor flow by ahmed yousry
Hands on machine learning with scikit-learn and tensor flow by ahmed yousryHands on machine learning with scikit-learn and tensor flow by ahmed yousry
Hands on machine learning with scikit-learn and tensor flow by ahmed yousryAhmed Yousry
 
Batch normalization paper review
Batch normalization paper reviewBatch normalization paper review
Batch normalization paper reviewMinho Heo
 
Nimrita deep learning
Nimrita deep learningNimrita deep learning
Nimrita deep learningNimrita Koul
 
08 neural networks
08 neural networks08 neural networks
08 neural networksankit_ppt
 
MACHINE LEARNING YEAR DL SECOND PART.pptx
MACHINE LEARNING YEAR DL SECOND PART.pptxMACHINE LEARNING YEAR DL SECOND PART.pptx
MACHINE LEARNING YEAR DL SECOND PART.pptxNAGARAJANS68
 
Semi-Supervised Deep Learning
Semi-Supervised Deep LearningSemi-Supervised Deep Learning
Semi-Supervised Deep LearningKamer Ali Yuksel
 
Lecture 7 - Bias, Variance and Regularization, a lecture in subject module St...
Lecture 7 - Bias, Variance and Regularization, a lecture in subject module St...Lecture 7 - Bias, Variance and Regularization, a lecture in subject module St...
Lecture 7 - Bias, Variance and Regularization, a lecture in subject module St...Maninda Edirisooriya
 
AI Class Topic 6: Easy Way to Learn Deep Learning AI Technologies
AI Class Topic 6: Easy Way to Learn Deep Learning AI TechnologiesAI Class Topic 6: Easy Way to Learn Deep Learning AI Technologies
AI Class Topic 6: Easy Way to Learn Deep Learning AI TechnologiesValue Amplify Consulting
 
in5490-classification (1).pptx
in5490-classification (1).pptxin5490-classification (1).pptx
in5490-classification (1).pptxMonicaTimber
 
The Art Of Backpropagation
The Art Of BackpropagationThe Art Of Backpropagation
The Art Of BackpropagationJennifer Prendki
 
Performance Issue? Machine Learning to the rescue!
Performance Issue? Machine Learning to the rescue!Performance Issue? Machine Learning to the rescue!
Performance Issue? Machine Learning to the rescue!Maarten Smeets
 
33.-Multi-Layer-Perceptron.pdf
33.-Multi-Layer-Perceptron.pdf33.-Multi-Layer-Perceptron.pdf
33.-Multi-Layer-Perceptron.pdfgnans Kgnanshek
 
Deep Learning in Limited Resource Environments
Deep Learning in Limited Resource EnvironmentsDeep Learning in Limited Resource Environments
Deep Learning in Limited Resource EnvironmentsOguzVuruskaner
 
NLP Classifier Models & Metrics
NLP Classifier Models & MetricsNLP Classifier Models & Metrics
NLP Classifier Models & MetricsSanghamitra Deb
 

Similar to Dataset Augmentation and machine learning.pdf (20)

H2O World - Top 10 Deep Learning Tips & Tricks - Arno Candel
H2O World - Top 10 Deep Learning Tips & Tricks - Arno CandelH2O World - Top 10 Deep Learning Tips & Tricks - Arno Candel
H2O World - Top 10 Deep Learning Tips & Tricks - Arno Candel
 
backpropagation in neural networks
backpropagation in neural networksbackpropagation in neural networks
backpropagation in neural networks
 
Hands on machine learning with scikit-learn and tensor flow by ahmed yousry
Hands on machine learning with scikit-learn and tensor flow by ahmed yousryHands on machine learning with scikit-learn and tensor flow by ahmed yousry
Hands on machine learning with scikit-learn and tensor flow by ahmed yousry
 
Batch normalization paper review
Batch normalization paper reviewBatch normalization paper review
Batch normalization paper review
 
Nimrita deep learning
Nimrita deep learningNimrita deep learning
Nimrita deep learning
 
08 neural networks
08 neural networks08 neural networks
08 neural networks
 
MACHINE LEARNING YEAR DL SECOND PART.pptx
MACHINE LEARNING YEAR DL SECOND PART.pptxMACHINE LEARNING YEAR DL SECOND PART.pptx
MACHINE LEARNING YEAR DL SECOND PART.pptx
 
presentation.ppt
presentation.pptpresentation.ppt
presentation.ppt
 
Semi-Supervised Deep Learning
Semi-Supervised Deep LearningSemi-Supervised Deep Learning
Semi-Supervised Deep Learning
 
crossvalidation.pptx
crossvalidation.pptxcrossvalidation.pptx
crossvalidation.pptx
 
Lecture 7 - Bias, Variance and Regularization, a lecture in subject module St...
Lecture 7 - Bias, Variance and Regularization, a lecture in subject module St...Lecture 7 - Bias, Variance and Regularization, a lecture in subject module St...
Lecture 7 - Bias, Variance and Regularization, a lecture in subject module St...
 
AI Class Topic 6: Easy Way to Learn Deep Learning AI Technologies
AI Class Topic 6: Easy Way to Learn Deep Learning AI TechnologiesAI Class Topic 6: Easy Way to Learn Deep Learning AI Technologies
AI Class Topic 6: Easy Way to Learn Deep Learning AI Technologies
 
in5490-classification (1).pptx
in5490-classification (1).pptxin5490-classification (1).pptx
in5490-classification (1).pptx
 
The Art Of Backpropagation
The Art Of BackpropagationThe Art Of Backpropagation
The Art Of Backpropagation
 
Performance Issue? Machine Learning to the rescue!
Performance Issue? Machine Learning to the rescue!Performance Issue? Machine Learning to the rescue!
Performance Issue? Machine Learning to the rescue!
 
33.-Multi-Layer-Perceptron.pdf
33.-Multi-Layer-Perceptron.pdf33.-Multi-Layer-Perceptron.pdf
33.-Multi-Layer-Perceptron.pdf
 
Deep Learning in Limited Resource Environments
Deep Learning in Limited Resource EnvironmentsDeep Learning in Limited Resource Environments
Deep Learning in Limited Resource Environments
 
NLP Classifier Models & Metrics
NLP Classifier Models & MetricsNLP Classifier Models & Metrics
NLP Classifier Models & Metrics
 
ANN - UNIT 3.pptx
ANN - UNIT 3.pptxANN - UNIT 3.pptx
ANN - UNIT 3.pptx
 
ANN - UNIT 3.pptx
ANN - UNIT 3.pptxANN - UNIT 3.pptx
ANN - UNIT 3.pptx
 

Recently uploaded

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 

Recently uploaded (20)

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 

Dataset Augmentation and machine learning.pdf

  • 2. MNIST Dataset • The process of applying simple and complex transformations to enhance the performance of a model. • Dataset augmentation applies transformations to your training examples. • Offline & Online data augmentation.
  • 3.
  • 4.
  • 5. Regularization • Dropout: Turn off some neuron in each iteration with probability p. • Early Stopping: Provide guidance such that how many iterations can be run before the model begins to overfit. • Weight Constraint: Scales weights to a pre-defined threshold. • Noise:Introduce stochastic noise into training process. • noise as a regularization method in a neural network with overfitting.
  • 9.
  • 10.
  • 11. Dropout & Early Stopping
  • 13. Cont., • Dropout is a technique where randomly selected neurons are ignored during the training process. • Large neural networks trained on small datasets will always overfit the training data. • Dropout changed the concept of learning all the weights together. • It will do only partial learning. • Can be used in Fully connected layers/ convolutional layers/ Recurrent layers • A new hyper parameter is introduced that specifies the probability at which outputs of the particular layer are dropped out.
  • 14. Some important aspects: • Can be used with all network types and resolved Co-adaptation • The weights of the network will be larger than normal network because of dropout. • Dropout forces a neural network to learn more robust features . • Dropout roughly doubles the number of iterations required to converge. However, training time for each epoch is less. • Over fitting due to Co-adaptation – L1 & L2 Regularization • scale the weights w by p , dropout for intermediate layer is 0.5 and input layer is 0.2.
  • 15.
  • 16. CASE STUDY: CIFAR-10 • The deep network is built had three convolution layers of size 64, 128 and 256 followed by two densely connected layers of size 512 and an output layer of size 10 (number of classes in the CIFAR-10 dataset). • ReLU as the activation function for hidden layers and sigmoid for the output layer &cross-entropy loss.
  • 18. Early stopping • Early stopping is an optimization technique that is used to reduce overfitting without compromising on the accuracy of the model. • Deciding on the number epochs/ training time. • Underfit/ overfit for limited or too long training. • Stop training once the models performance start to degrade for validation set is called as Early stopping. • Elements in Early stopping Monitoring model performance. Trigger to stop training. The choice of model to use.
  • 19. Cont., • Early Stopping protect against over fitting and needs considerably less number of Epoch to train. • A callback is a powerful tool to customize the behavior of a Keras model during training, evaluation, or inference • Callback-internal states and statistics of a model during training • Starting/ Stopping of the training process • End of epochs/ end of training a batch. • Monitor, patience, mode, restore_best_weights callback = tf.keras.callbacks.EarlyStopping(patie nce=4, restore_best_weights=True) history1 = model2.fit(trn_images, trn_labels, epochs=50,validation_data=(valid_image s, valid_labels),callbacks=[callback])
  • 21. Ensemble Methods • A solution to the high variance of neural networks is to train multiple models and combine their predictions. • Training Data: Vary the choice of data used to train each model in the ensemble. • Ensemble Models: Vary the choice of the models used in the ensemble. • Combinations: Vary the choice of the way that outcomes from ensemble members are combined
  • 22. Batch Normalization • Batch normalization is one of the important features in Deep Learning. • we normalize each layer’s inputs by using the mean and standard deviation of the values in the current batch. • Batch normalization acts as a Regularizer, normalizing the inputs, in the backpropagation process, and can be adapted to most of the models to converge better. • Normalizing the inputs to hidden layers helps in faster learning. • Batch normalization reduces the covariate shift.
  • 23. Cont., • when the distribution of input data shifts between the training environment and live environment, the input and the output distribution may change, but the labels remain the same. • Covariate shift can occur gradually over time or suddenly after the deployment of the model. • Normalization has the effect of stabilizing the neural network. • we use batch normalization by normalizing the outputs using mean=0, standard dev=1 (μ=0,σ=1). • The learning rates can be made high for improving the training process.
  • 24.
  • 25. Add ‘E’ to avoid divide by zero error
  • 26. Importing Libraries keras.layers.BatchNormalization(axis=-1, momentum=0.99, epsilon=0.001, center=True, scale=True, beta_initializer='zeros', gamma_initializer='ones', moving_mean_initializer='zeros', moving_variance_initializer='ones', beta_regularizer=None, gamma_regularizer=None, beta_constraint=None, gamma_constraint=None)
  • 27. Result – Batch Normalization
  • 28. Weight Initialization Techniques • The weight initialization technique adapted for neural network can determine how quickly the network converges. • In neural networks, weights represent the strength of connections between units or neurons in adjacent network layers. • Improperly initialized weights can negatively affect the training process by contributing to the vanishing or exploding gradient problem. • Initializing with weights that are too large may result in exploding gradient values during forward propagation or back-propagation.
  • 29. Cont., • Xavier and Bengio (2010) proposed the “Xavier” initialization which considers the size of the network (number of input and output units) while initializing weights. • This approach ensures that the weights stay within a reasonable range of values by making them inversely proportional to the square root of the number of units in the previous layer. • Weight pruning means eliminating unnecessary values in the weight tensors.
  • 30. References • Mohamed Elgendy, Deep Learning for Vision Systems, Manning Publications.