AutoEncoders For Fraud Detection
Veena Pulicharla
November 6, 2020


Fraud detection is a popular use case of machine learning from a solution perspective, and is a threat present in a lot of companies. There have been many iterations of solutions built in the past to address fraud, mostly using a set of rules to keep track of user’s device details and behavioral patterns. But over the course of time, fraudulent activities have gotten smarter to overcome these archaic obstacles and have also resulted occasionally in huge losses to companies in terms of monetary worth, brand value and user experience. These advanced methods of fraud activities can seem to be genuine from a first glance, and need a complex form of evaluation to identify them as fraudulent. Several machine learning models have been attempted thus far to identify fraudulent activities, but owing to the high class imbalance (fraud vs. not fraud), they can only achieve precision to an extent. 


Deep learning based autoencoders have been successful in addressing this issue, and we have built such a solution to address fraud at a leading retail rewards company. Autoencoders are a form of deep neural network wherein the task is to train the network to learn a complex representation of a generic genuine event, so that every fraudulent event can be distinguished from the genuine ones. There are two phases in an autoencoder, the first phase where each record is compressed to lower dimensions or ‘encoded’ and the second phase where the record is brought back to its original shape or ‘decoded’. Typical architecture of an autoencoder’s network looks like this

The task in this training process is to reconstruct the input record, after it is passed through the encoding phase and is brought down to lower dimensions. As is the case with any training procedure, there’s a reconstruction error associated with each record, and the objective is to minimize this reconstruction error. It is important to mention here that the training dataset must not contain any fraudulent activities.

How does it work with fraudulent activities

Because the network learned to reconstruct a generic genuine event or transaction, there’s bound to be a difficulty in reconstructing a fraudulent event, because there’s an anomaly hidden in that record which may not be evident from each individual feature but is predominantly present in a different dimension. Thus, a fraudulent transaction records high reconstruction error, thereby raising a flag. The reconstruction errors of all the records can then be analyzed for setting a threshold to flag a record as fraudulent.

How is it different from rule based engines or traditional machine learning models

Traditional machine learning models tend to define a relationship among the features to identify fraudulent and non fraudulent cases, while in reality fraud can happen in any form, which may not be detected by these models. 

Autoencoders tend to understand what a normal transaction or an event is, and flag every action which does not conform to this normality as suspicious. They learn complex linear/ non linear relationships among the features, which is not possible by rules or traditional machine learning models. This is helpful in identifying fraudulent records which may not be evident.

In action- Business Impact

We have built an autoencoder based fraud detection model for a leading retail rewarding company, who was facing an issue of fraudulent activities despite having a fraud detection engine comprising of a comprehensive set of rules. This model identified those users who tend to commit fraud while staying in the threshold limits of these rules and do not get detected otherwise.

We hope you found our blog post informative. If you have any project inquiries or would like to discuss your data and analytics needs, please don't hesitate to contact us at We're here to help! Thank you for reading.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.