Skip to main content
. 2022 Sep 2;16:1005617. doi: 10.3389/fncom.2022.1005617

Algorithm 1.

Pseudo code of Proposed CNN-LSTM model

1: Dataset ← X, Y = {y1, y2, y3, …, yn}
2: Performs image pre-processing
3: Image = cv2.resize (224 x 224), resize the image.
4: Computing Newimage = image (extTop [1]: extBot [1]: extLeft [0]: extRight [0]), Cropping the image using extreme point calculation.
5: Splitting the dataset into validation and training parts. Thirty percent for validation and 70% for training.
6: CNN-LSTM ← Classifying and extracting the feature through deep learning models.
7: F = (f1, f2,f3, …, fn) map the feature extraction vector into high dimensional space.
8: for every epoch in the number of epochs do
9:    for every batch in the batch-size do
10:      x = model (F);
11:      Loss = cross_entropy (X, x), Calculate the loss
12:      Optimization and fitting function applied for validation and training of the model
13:      Compute the validation metrics: precision, accuracy, F1-measure, and recall
14:    end for
15: end for
16: return Results