SlideShare a Scribd company logo
RNN & LSTM
DR. ANINDYA HALDER
1
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
Reccurent Neural Networks (RNN) :
The RNN has is highly preferred method , especially for sequential data.
Every node at a time step consists of an input from the previous node, and it proceeds using a feedback
loop.
 In RNN, each node generates a current
hidden state and its output is obtained by
using the given input and previous hidden
state as follows:
Fig: Compressed (left) and unfolded (right) basic Recurrent Neural Network.
35
How Recurrent Neural Network works
• RNN processes the sequence of vectors one by one.
• While processing, it passes the previous hidden state to the next step of the sequence. The hidden state
acts as the neural networks memory. It holds information on previous data the network has seen before.
Figure: Processing sequence one by one.
36
Cont…
• First, the input and previous hidden state are combined to form a vector.
• That vector now has information on the current input and previous inputs. The vector goes
through the tanh activation, and the output is the new hidden state, or the memory of the
network.
Figure: Passing hidden state to next time step. Figure: RNN Cell
37
Recurrent Neural Networks suffer from short-term memory. If a sequence is long
enough, they’ll have a hard time carrying information from earlier time steps to later
ones.
During back propagation, recurrent neural networks suffer from the vanishing gradient
problem. Gradients are values used to update a neural networks weights. The vanishing
gradient problem is when the gradient shrinks as it back propagates through time. If a
gradient value becomes extremely small, it doesn’t contribute too much learning.
Drawbacks of RNN:
38
Pros and Cons of RNN:
Advantages Drawbacks
• Possibility of processing input of any length
• Model size not increasing with size of input
• Computation takes into account historical
information
• Weights are shared across time
• Computation being slow
• Difficulty of accessing information from a long
time ago
• Cannot consider any future input for the current
state
The pros and cons of a typical RNN architecture are summed up in the table below:
39
Applications of RNN:
•Prediction problems.
•Machine Translation.
•Speech Recognition.
•Language Modelling and Generating Text.
•Video Tagging.
•Generating Image Descriptions.
•Text Summarization.
•Call Center Analysis.
40
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
RNN-LSTM.pptx
Long Term Short Memory(LSTM):
Long short-term memory is a type of RNN model designed to prevent the output of a neural network from
either exploding or decaying (long-term dependency) as it passes through the feedback loops for a given
input.
63
Basic LSTM Unit and corresponding individual blocks
64
Forget Gate: whether an information
it should remember or to forget.
Cell State: governing the input, as well
as to forget the irrelevant information
Input Gate: decider state that helps to
decide what new information it needs
to store in the cell state.
Output Gate: helps in deciding the
values of next hidden state of the
network.
Activation Functions of LSTM
In LSTM architecture, two types of activation functions are used:
 Tanh activation function
Sigmoid activation function
65
Cont..
Tanh:
 LSTM gates contains Tanh activations.
Tanh is a non-linear activation function.
 It regulates the values flowing through
the network, maintaining the values
between -1 and 1.
The tanh activation is used to help
regulate the values flowing through the
network.
Figure: Tanh squishes values to be between -1 and 1.
66
Sigmoid
LSTM gates contains sigmoid activations.
Sigmoid function squishes values between 0
and 1.
 That is helpful to update or forget data
because any number getting multiplied by 0 is
0, causing values to disappears or be
“forgotten.” Any number multiplied by 1 is the
same value therefore that value stay’s the same
or is “kept.”
Using Sigmoid activation function, the network
can learn which data is not important therefore
can be forgotten or which data is important to
keep.
Cont…
Figure:Sigmoid squishes values to be between 0
and 1
67
Gates of LSTM
68
Cont…
• This gate decides what information should
be thrown away or kept.
• Information from the previous hidden state
and information from the current input is
passed through the sigmoid function.
• Values come out between 0 and 1. The
closer to 0 means to forget, and the closer
to 1 means to keep.
Forget gate
Figure: Forget Gate.
69
Input Gate
• The goal of this gate is to determine what new
information should be added to the networks
long-term memory (cell state), given the
previous hidden state and new input data.
• The input gate is a sigmoid activated network
which acts as a filter, identifying which
components of the ‘new memory vector’ are
worth retaining. This network will output a vector
of values in [0,1].
• It is also passed the hidden state and current
input into the tanh function to squish values
between -1 and 1 to help regulate the network.
Cont…
Figure: Input Gate.
70
Cell State
• The next step is to decide and store the
information from the new state in the cell state.
• The previous cell state C(t-1) gets multiplied with
forget vector f(t). If the outcome is 0, then values
will get dropped in the cell state.
• Next, the network takes the output value of the
input vector i(t) and performs point-by-point
addition, which updates the cell state giving the
network a new cell state C(t).
Cont…
Figure: Cell State.
71
Output Gate
 The output gate decides what the next hidden state
should be. The hidden state contains information on
previous inputs. The hidden state is also used for
predictions.
Cont…
Figure: Output Gate.
72
Applications of LSTM:
73
Autoencoder
Cont…
An Autoencoder consists of three layers:
1.Encoder
2.Compressed representation layer
3.Decoder
• The Encoder layer compresses the input image into a latent space representation. It encodes the input image
as a compressed representation in a reduced dimension.
• The Compressed representation layer represents the compressed input fed to the decoder layer.
• The decoder layer decodes the encoded image back to the original dimension
Case study
A deep LSTM autoencoder for detecting
anomalous ECG
RNN-LSTM.pptx
Block diagram
Detailed architecture of ECG-NET
The concept behind ECG-NET
ECG data sets used:
81
Publicly available ECG5000 2 dataset
Original dataset was released by Eamonn Keogh and Yanping Chen that is downloaded from physionet.
This database is a 20 hour long BIDMC congestive Heart Failure Database (chfdb) ECG database
reported as ‘‘chf07’’ which is publicly available in the UCR Time Series Classification archive (Bagnall et al.)
(Bagnall et al., 2018) 2018.
http://www.timeseriesclassification.com/description.php?Dataset=ECG5000.
available ECG5000 dataset is a preprocessed dataset, where the data preprocessing was performed in two
steps
first step extracts each heartbeat and second step makes each heartbeat of equal length using interpolation
The dataset comprises both normal patients’ ECG as well as the ECG of those patients who have severe
congestive heart failure
Details of Data Splitting
Data Source: ECG5000 dataset released by Eamonn Keogh and YanpingChen that is downloaded from physionet
Threshold technique used:
Manual threshold
Automated threshold (Kapur’s thresholding procedure)
RNN-LSTM.pptx
Hyper-parameter settings
Result and analysis section
Training and validation
RNN-LSTM.pptx
Reconstruction of the training and
validation normal ECG signals
Training ECG samples
Validation ECG samples
Test Result:
Reconstruction of the test ECG signals
Correctly and incorrectly classified ECG
test samples using Manual Thresholding
procedure
Correctly and incorrectly classified ECG
test samples using Automated
Thresholding procedure
Compared Result
Advantages of the Proposed Method
94
Challenges involved in automated ECG arrhythmia detection include but not limited to the following:
Limited availability of the annotated ECG signals to train the model,
involvement of data imbalance problem in ECG dataset, where the normal ECG signals are predominant
over anomaly ECGs.
 The above said challenges are judiciously handled in the proposed (LSTM based autoencoder) ECG-NET
ECG-NET method requires only normal ECG signals for training (where no anomalous ECG signals are
required during the training phase)
Even than can achieve good accuracy during the testing phase considering both normal and anomalous test
ECG signals.
Thus, data imbalance problems and limited availability of annotated samples (particularly anomalous ECG
signals) are handled
Proposed an automated reconstruction loss threshold selection approach on testing phase based on
Kapur’s histogram thresholding approach
Proposed three LSTM based autoencoder architecture which yields better accuracy than existing
architectures.
Reference:
1. https://www.pluralsight.com/guides/introduction-to-lstm-units-in-rnn
2. https://www.geeksforgeeks.org/introduction-to-recurrent-neural-
network/#:~:text=RNN%20converts%20the%20independent%20activations,to%20the%20next%
20hidden%20layer.
3. https://towardsmachinelearning.org/recurrent-neural-network-architecture-explained-in-
detail/
4. https://towardsdatascience.com/illustrated-guide-to-lstms-and-gru-s-a-step-by-step-
explanation-44e9eb85bf21
95
96
Thank You

More Related Content

PDF
Seq2Seq (encoder decoder) model
佳蓉 倪
 
PPTX
RNN-LSTM.pptx
ssuserc755f1
 
PPTX
RNN & LSTM: Neural Network for Sequential Data
Yao-Chieh Hu
 
PDF
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Edureka!
 
PDF
Recurrent Neural Networks, LSTM and GRU
ananth
 
PPT
Intro to Deep learning - Autoencoders
Akash Goel
 
PPTX
Introduction For seq2seq(sequence to sequence) and RNN
Hye-min Ahn
 
PDF
LeNet-5
佳蓉 倪
 
Seq2Seq (encoder decoder) model
佳蓉 倪
 
RNN-LSTM.pptx
ssuserc755f1
 
RNN & LSTM: Neural Network for Sequential Data
Yao-Chieh Hu
 
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Edureka!
 
Recurrent Neural Networks, LSTM and GRU
ananth
 
Intro to Deep learning - Autoencoders
Akash Goel
 
Introduction For seq2seq(sequence to sequence) and RNN
Hye-min Ahn
 
LeNet-5
佳蓉 倪
 

What's hot (20)

PDF
Convolutional Neural Network Models - Deep Learning
Mohamed Loey
 
PPTX
Intro to deep learning
David Voyles
 
PPTX
1.Introduction to deep learning
KONGU ENGINEERING COLLEGE
 
PDF
LSTM
佳蓉 倪
 
PPTX
Transfer Learning and Fine-tuning Deep Neural Networks
PyData
 
PPTX
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Simplilearn
 
PDF
Interpretable machine learning : Methods for understanding complex models
Manojit Nandi
 
PPTX
Rnn & Lstm
Subash Chandra Pakhrin
 
PDF
Rnn and lstm
Shreshth Saxena
 
PDF
GAN - Theory and Applications
Emanuele Ghelfi
 
PPT
rnn BASICS
Priyanka Reddy
 
PDF
Introduction to Recurrent Neural Network
Knoldus Inc.
 
PDF
Long Short Term Memory
Yan Xu
 
PDF
LSTM Basics
Akshay Sehgal
 
PDF
Resnet
ashwinjoseph95
 
PPTX
Transfer learning-presentation
Bushra Jbawi
 
PDF
Convolutional neural network
Yan Xu
 
PPTX
Deep Learning With Neural Networks
Aniket Maurya
 
PPT
Adaptive Resonance Theory
Naveen Kumar
 
PPTX
Implementation levels of virtualization
Gokulnath S
 
Convolutional Neural Network Models - Deep Learning
Mohamed Loey
 
Intro to deep learning
David Voyles
 
1.Introduction to deep learning
KONGU ENGINEERING COLLEGE
 
Transfer Learning and Fine-tuning Deep Neural Networks
PyData
 
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Simplilearn
 
Interpretable machine learning : Methods for understanding complex models
Manojit Nandi
 
Rnn and lstm
Shreshth Saxena
 
GAN - Theory and Applications
Emanuele Ghelfi
 
rnn BASICS
Priyanka Reddy
 
Introduction to Recurrent Neural Network
Knoldus Inc.
 
Long Short Term Memory
Yan Xu
 
LSTM Basics
Akshay Sehgal
 
Transfer learning-presentation
Bushra Jbawi
 
Convolutional neural network
Yan Xu
 
Deep Learning With Neural Networks
Aniket Maurya
 
Adaptive Resonance Theory
Naveen Kumar
 
Implementation levels of virtualization
Gokulnath S
 
Ad

Similar to RNN-LSTM.pptx (20)

PDF
rnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
khushbu maurya
 
PDF
Recurrent neural networks rnn
Kuppusamy P
 
PDF
Recurrent Neural Networks. Part 1: Theory
Andrii Gakhov
 
PPTX
RNN and LSTM model description and working advantages and disadvantages
AbhijitVenkatesh1
 
PDF
Recurrent Neural Networks
Sharath TS
 
PPTX
Introduction to deep learning
Junaid Bhat
 
PDF
RNNs for Timeseries Analysis
Bruno Gonçalves
 
PPTX
Long Short Term Memory LSTM
Abdullah al Mamun
 
PDF
Concepts of Temporal CNN, Recurrent Neural Network, Attention
SaumyaMundra3
 
PPT
14889574 dl ml RNN Deeplearning MMMm.ppt
ManiMaran230751
 
PDF
Video Analysis with Recurrent Neural Networks (Master Computer Vision Barcelo...
Universitat Politècnica de Catalunya
 
PDF
Rnn presentation 2
Shubhangi Tandon
 
PPTX
Implement LST perform LSTm stock Makrket Analysis
Kv Sagar
 
PDF
Recurrent Neural Networks (DLAI D7L1 2017 UPC Deep Learning for Artificial In...
Universitat Politècnica de Catalunya
 
PDF
Recurrent Neural Networks (D2L8 Insight@DCU Machine Learning Workshop 2017)
Universitat Politècnica de Catalunya
 
PDF
Learning Financial Market Data with Recurrent Autoencoders and TensorFlow
Altoros
 
PDF
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Universitat Politècnica de Catalunya
 
PDF
RNN and its applications
Sungjoon Choi
 
PDF
A Hybrid Deep Neural Network Model For Time Series Forecasting
Martha Brown
 
PPTX
Long and short term memory presesntation
chWaqasZahid
 
rnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
khushbu maurya
 
Recurrent neural networks rnn
Kuppusamy P
 
Recurrent Neural Networks. Part 1: Theory
Andrii Gakhov
 
RNN and LSTM model description and working advantages and disadvantages
AbhijitVenkatesh1
 
Recurrent Neural Networks
Sharath TS
 
Introduction to deep learning
Junaid Bhat
 
RNNs for Timeseries Analysis
Bruno Gonçalves
 
Long Short Term Memory LSTM
Abdullah al Mamun
 
Concepts of Temporal CNN, Recurrent Neural Network, Attention
SaumyaMundra3
 
14889574 dl ml RNN Deeplearning MMMm.ppt
ManiMaran230751
 
Video Analysis with Recurrent Neural Networks (Master Computer Vision Barcelo...
Universitat Politècnica de Catalunya
 
Rnn presentation 2
Shubhangi Tandon
 
Implement LST perform LSTm stock Makrket Analysis
Kv Sagar
 
Recurrent Neural Networks (DLAI D7L1 2017 UPC Deep Learning for Artificial In...
Universitat Politècnica de Catalunya
 
Recurrent Neural Networks (D2L8 Insight@DCU Machine Learning Workshop 2017)
Universitat Politècnica de Catalunya
 
Learning Financial Market Data with Recurrent Autoencoders and TensorFlow
Altoros
 
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Universitat Politècnica de Catalunya
 
RNN and its applications
Sungjoon Choi
 
A Hybrid Deep Neural Network Model For Time Series Forecasting
Martha Brown
 
Long and short term memory presesntation
chWaqasZahid
 
Ad

Recently uploaded (20)

PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PDF
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
PPTX
Online Cab Booking and Management System.pptx
diptipaneri80
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PPTX
Tunnel Ventilation System in Kanpur Metro
220105053
 
PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PPTX
quantum computing transition from classical mechanics.pptx
gvlbcy
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PPTX
Inventory management chapter in automation and robotics.
atisht0104
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
Online Cab Booking and Management System.pptx
diptipaneri80
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
Tunnel Ventilation System in Kanpur Metro
220105053
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
quantum computing transition from classical mechanics.pptx
gvlbcy
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
Inventory management chapter in automation and robotics.
atisht0104
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 

RNN-LSTM.pptx

  • 1. RNN & LSTM DR. ANINDYA HALDER 1
  • 35. Reccurent Neural Networks (RNN) : The RNN has is highly preferred method , especially for sequential data. Every node at a time step consists of an input from the previous node, and it proceeds using a feedback loop.  In RNN, each node generates a current hidden state and its output is obtained by using the given input and previous hidden state as follows: Fig: Compressed (left) and unfolded (right) basic Recurrent Neural Network. 35
  • 36. How Recurrent Neural Network works • RNN processes the sequence of vectors one by one. • While processing, it passes the previous hidden state to the next step of the sequence. The hidden state acts as the neural networks memory. It holds information on previous data the network has seen before. Figure: Processing sequence one by one. 36
  • 37. Cont… • First, the input and previous hidden state are combined to form a vector. • That vector now has information on the current input and previous inputs. The vector goes through the tanh activation, and the output is the new hidden state, or the memory of the network. Figure: Passing hidden state to next time step. Figure: RNN Cell 37
  • 38. Recurrent Neural Networks suffer from short-term memory. If a sequence is long enough, they’ll have a hard time carrying information from earlier time steps to later ones. During back propagation, recurrent neural networks suffer from the vanishing gradient problem. Gradients are values used to update a neural networks weights. The vanishing gradient problem is when the gradient shrinks as it back propagates through time. If a gradient value becomes extremely small, it doesn’t contribute too much learning. Drawbacks of RNN: 38
  • 39. Pros and Cons of RNN: Advantages Drawbacks • Possibility of processing input of any length • Model size not increasing with size of input • Computation takes into account historical information • Weights are shared across time • Computation being slow • Difficulty of accessing information from a long time ago • Cannot consider any future input for the current state The pros and cons of a typical RNN architecture are summed up in the table below: 39
  • 40. Applications of RNN: •Prediction problems. •Machine Translation. •Speech Recognition. •Language Modelling and Generating Text. •Video Tagging. •Generating Image Descriptions. •Text Summarization. •Call Center Analysis. 40
  • 63. Long Term Short Memory(LSTM): Long short-term memory is a type of RNN model designed to prevent the output of a neural network from either exploding or decaying (long-term dependency) as it passes through the feedback loops for a given input. 63
  • 64. Basic LSTM Unit and corresponding individual blocks 64 Forget Gate: whether an information it should remember or to forget. Cell State: governing the input, as well as to forget the irrelevant information Input Gate: decider state that helps to decide what new information it needs to store in the cell state. Output Gate: helps in deciding the values of next hidden state of the network.
  • 65. Activation Functions of LSTM In LSTM architecture, two types of activation functions are used:  Tanh activation function Sigmoid activation function 65
  • 66. Cont.. Tanh:  LSTM gates contains Tanh activations. Tanh is a non-linear activation function.  It regulates the values flowing through the network, maintaining the values between -1 and 1. The tanh activation is used to help regulate the values flowing through the network. Figure: Tanh squishes values to be between -1 and 1. 66
  • 67. Sigmoid LSTM gates contains sigmoid activations. Sigmoid function squishes values between 0 and 1.  That is helpful to update or forget data because any number getting multiplied by 0 is 0, causing values to disappears or be “forgotten.” Any number multiplied by 1 is the same value therefore that value stay’s the same or is “kept.” Using Sigmoid activation function, the network can learn which data is not important therefore can be forgotten or which data is important to keep. Cont… Figure:Sigmoid squishes values to be between 0 and 1 67
  • 69. Cont… • This gate decides what information should be thrown away or kept. • Information from the previous hidden state and information from the current input is passed through the sigmoid function. • Values come out between 0 and 1. The closer to 0 means to forget, and the closer to 1 means to keep. Forget gate Figure: Forget Gate. 69
  • 70. Input Gate • The goal of this gate is to determine what new information should be added to the networks long-term memory (cell state), given the previous hidden state and new input data. • The input gate is a sigmoid activated network which acts as a filter, identifying which components of the ‘new memory vector’ are worth retaining. This network will output a vector of values in [0,1]. • It is also passed the hidden state and current input into the tanh function to squish values between -1 and 1 to help regulate the network. Cont… Figure: Input Gate. 70
  • 71. Cell State • The next step is to decide and store the information from the new state in the cell state. • The previous cell state C(t-1) gets multiplied with forget vector f(t). If the outcome is 0, then values will get dropped in the cell state. • Next, the network takes the output value of the input vector i(t) and performs point-by-point addition, which updates the cell state giving the network a new cell state C(t). Cont… Figure: Cell State. 71
  • 72. Output Gate  The output gate decides what the next hidden state should be. The hidden state contains information on previous inputs. The hidden state is also used for predictions. Cont… Figure: Output Gate. 72
  • 75. Cont… An Autoencoder consists of three layers: 1.Encoder 2.Compressed representation layer 3.Decoder • The Encoder layer compresses the input image into a latent space representation. It encodes the input image as a compressed representation in a reduced dimension. • The Compressed representation layer represents the compressed input fed to the decoder layer. • The decoder layer decodes the encoded image back to the original dimension
  • 76. Case study A deep LSTM autoencoder for detecting anomalous ECG
  • 81. ECG data sets used: 81 Publicly available ECG5000 2 dataset Original dataset was released by Eamonn Keogh and Yanping Chen that is downloaded from physionet. This database is a 20 hour long BIDMC congestive Heart Failure Database (chfdb) ECG database reported as ‘‘chf07’’ which is publicly available in the UCR Time Series Classification archive (Bagnall et al.) (Bagnall et al., 2018) 2018. http://www.timeseriesclassification.com/description.php?Dataset=ECG5000. available ECG5000 dataset is a preprocessed dataset, where the data preprocessing was performed in two steps first step extracts each heartbeat and second step makes each heartbeat of equal length using interpolation The dataset comprises both normal patients’ ECG as well as the ECG of those patients who have severe congestive heart failure
  • 82. Details of Data Splitting Data Source: ECG5000 dataset released by Eamonn Keogh and YanpingChen that is downloaded from physionet
  • 83. Threshold technique used: Manual threshold Automated threshold (Kapur’s thresholding procedure)
  • 86. Result and analysis section Training and validation
  • 88. Reconstruction of the training and validation normal ECG signals Training ECG samples Validation ECG samples
  • 90. Reconstruction of the test ECG signals
  • 91. Correctly and incorrectly classified ECG test samples using Manual Thresholding procedure
  • 92. Correctly and incorrectly classified ECG test samples using Automated Thresholding procedure
  • 94. Advantages of the Proposed Method 94 Challenges involved in automated ECG arrhythmia detection include but not limited to the following: Limited availability of the annotated ECG signals to train the model, involvement of data imbalance problem in ECG dataset, where the normal ECG signals are predominant over anomaly ECGs.  The above said challenges are judiciously handled in the proposed (LSTM based autoencoder) ECG-NET ECG-NET method requires only normal ECG signals for training (where no anomalous ECG signals are required during the training phase) Even than can achieve good accuracy during the testing phase considering both normal and anomalous test ECG signals. Thus, data imbalance problems and limited availability of annotated samples (particularly anomalous ECG signals) are handled Proposed an automated reconstruction loss threshold selection approach on testing phase based on Kapur’s histogram thresholding approach Proposed three LSTM based autoencoder architecture which yields better accuracy than existing architectures.
  • 95. Reference: 1. https://www.pluralsight.com/guides/introduction-to-lstm-units-in-rnn 2. https://www.geeksforgeeks.org/introduction-to-recurrent-neural- network/#:~:text=RNN%20converts%20the%20independent%20activations,to%20the%20next% 20hidden%20layer. 3. https://towardsmachinelearning.org/recurrent-neural-network-architecture-explained-in- detail/ 4. https://towardsdatascience.com/illustrated-guide-to-lstms-and-gru-s-a-step-by-step- explanation-44e9eb85bf21 95