![Search icon](https://hackernoon.imgix.net/search-new.png?w=19&h=19)
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.
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.
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:
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.
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.
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.
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:
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.
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.
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. Endless possibilities!