paint-brush
My Deep Learning Experiments for Fintech Risk Detectionby@harshdaiya
196 reads

My Deep Learning Experiments for Fintech Risk Detection

by Harsh DaiyaAugust 5th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Fintech risk detection is all about two-stepping through recognizing potential fraudulent activities, credit risks as well as ensuring compliance with regulations. Traditional approaches are typically rule-based systems and have limits. Deep learning is adept at generalizing from large volumes of data and uncovering non-intuitive structures in that data.
featured image - My Deep Learning Experiments for Fintech Risk Detection
Harsh Daiya HackerNoon profile picture


Risk evaluation is a key issue in fintech, an industry that never stands still. A tech finance guy at heart, I found myself on a pretty exciting journey trying to figure out how deep learning could be used in risk mechanisms. In this post, I show you my experiment supported by the various steps involved and their results.

Background

Fintech risk detection is all about two-stepping through recognizing potential fraudulent activities, and credit risks as well as ensuring compliance with regulations. Traditional approaches are typically rule-based systems and have limits. They are seen as being inflexible, and unable to spot subtle patterns in the data that might show early signs of new threats. Deep learning is adept at generalizing large volumes of data and uncovering non-intuitive structures in that data, so this makes a perfect match. Below is a typical ML/DL application life cycle just so we can see the various steps involved.


Credit - Datacamp blog


Experiment 1: Neural Network Hello World

Simple neural network with TensorFlow: I used a historical transactional dataset with tables including fields like the amount, location, and time at which a certain user spent money in our platform.


Technique:

  • Performed Data Preprocessing: Cleaned the data, handled missing values and normalized the features.
  • Architecture of the Model: A simple feedforward neural network created using 3 hidden layers.
  • Model Training: Binary Cross-Entropy Loss Function, Adam optimizer


Outcome:

The model could get around 85% of accuracy on the validation set. It looked very good, but we had false positives for more advanced fraud patterns.


Experiment 2: CNNs (Convolutional Neural Networks)

While the use of CNNs is more conventional in image processing, they can be used and have been successfully applied to time-series data treating transaction sequences as images. Here is a reference diagram I found useful for understanding the various steps involved in CNN.

Springer - Deep Learning: Basics and Convolutional Neural Networks (CNNs) | SpringerLink


Technique:

  • Converted sequence of transactions into 2 D matrices - Data Transformation

  • Model Architecture: The CNN model proposed by me has 2 convolutional layers, followed by maxpooling layers and finally two fully connected layer.

  • Training: As in the first, with a different learning rate.


Outcome:

The CNN was only doing a little better than our basic neural network at around 87%accuracy. This one also learned more complex patterns- computing it is not heavy.


Experiment 3: RNN and LSTM

Since transaction data is naturally sequential, I studied RNNs (Recurrent Neural Networks) in particular Long Short-Term Memory (LSTM) networks to pick up the temporal structures.


Technique:

  • We separated transactions into sequential orders of actions for each user - this is the Data Preparation step.
  • Model Architecture: LSTM (2 layers) -> Dense
  • Training: Applied dropout to reduce overfitting.


Outcome:

The LSTM network came out performing better with an accuracy of ~92%. It was very good at recognizing deviations in user behavior over some time.


Experiment 4: Ensemble Learning

Typically, mixing models leads to a more optimal outcome. I chose to compose a CNN and LSTM models ensemble.


Technique:

  • Combined the predictions using a weighted average of CNN and LSTM.

  • Transfer: Combined the two models independently, they trained from scratch and then further fine-tuned them to create ensemble results.


Outcome:

The accuracy of the ensemble model was an outstanding 95%. It was strong and performed better than individual models to catch subtle risk patterns consistently.


Final Takeaway

Deep learning has powerful tools for detecting risks in fintech. Here are my key takeaways:

In particular, the success of deep learning models is supported by quality and quantity data. Clean, well-labeled data can improve your model immensely.


Not all models are the same: meaning that some models will have more effect in practice as compared to other RNNs and specially LSTMs are great at working with sequential data while CNN can capture complex patterns in transformed records.


Ensemble Models - Combining several models can use the strengths overlap and get better results than any single model.

Lifelong education: The financial risk environment is always developing. Retraining and constantly updating the models -> Retrain to prevent new attacks.


Recently, I had the opportunity to apply deep learning toward risk detection and my experiments have been enlightening. Deep Learning is not a one-size-fits-all solution, but the fact that it can learn and adapt over time makes DL models invaluable in a Fintech toolkit. If you go into this, I want to implore you, to try something new and change it up. Possibilities are endless.