Sequential Binary Imbalanced data classification with LSTM I'm building an LSTM sequential Binary Classification Model, the data is highly imbalanced like say Fraud detection case.
After building an LSTM model on Sequential Vectorised data, I'm getting a very low recall of 0.005.
# build LSTM layers
model = Sequential()
model.add(LSTM (100, dropout=0.2, input_shape=(time_steps, features)))
model.add(Dense(50, activation='relu'))
model.add(Dense(25, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='rmsprop', metrics=[Recall()])
print (model.summary())
history=model.fit(train_X, train_Y, validation_data=(test_X, test_Y), 
epochs=10,batch_size=64)

Please help me, with how to optimize the recall for this model.
Thank you

The problem is that in your training data, the "positive" class (since recall is the problem, I guess "fraud" is the "positive") is underrepresented and the algorithm has not enough data to pick up on this signal. There is even a valid easy strategy for it: It can get very high accuracy by only predicting the abundant class per default, since it will be wrong only very seldom.
What you can do now is to over- or undersample your data to make the classes artificially more equal. There are numerous techniques for that (see here), plus you can also augment the positive samples that you use. There is also the option to weight your samples, meaning that positive samples get a very stronger influence on the error metric (scaled up relative to its reciprocal proportion in the data) assigned for backpropagation compared to the abundant class. For Keras this looks loke this. The alternative is to use another model (for outlier detection, sometimes autoencoders are employed (here and here)).
