Skip to main content

Detection of Credit Card Fraud with an Autoencoder

Detection of Credit Card Fraud with an Autoencoder

Do you want to know how to create an anomaly detector using Python and TensorFlow? Then this article is for you. Credit card companies use anomaly detectors to detect fraudulent transactions. It is important to identify fraudulent transactions so that customers do not have to pay for something they did not buy.

Many credit card transactions take place every day, but very few transactions are fraudulent. The fraudulent transactions are anomalies. The article presents an implementation of an autoencoder model to detect these fraudulent transactions. First, we define an anomaly and introduce different types of anomalies. Then we describe the implementation of the anomaly detector for credit card fraud detection. Let’s begin!

Anomaly detection in general

An anomaly detection algorithm identifies novel and unexpected structures in acquired datasets. There are many definitions of an anomaly in the literature. We derive a definition for our use case.

Anomaly definition

Chandola et al [1] describe anomalies as patterns in data that do not conform to a well-defined notion of normal behaviour. Another widely used definition comes from Hawkins. Hawkins [2] describes an outlier as an observation that deviates from other observations to such an extent that it is suspected to have been generated by some other mechanism. Concerning the definitions presented, two essential aspects should be noted (cf. [3]):

  1. The distribution of the anomalies deviates strongly from the general distribution of the data.

  2. The majority of the data are normal observations, and the anomalies are only a small part.

We define an anomaly as follows:

An anomaly is an observation or a sequence of observations that differ significantly from the majority of the data in distribution.

To read this post you'll need to become a member. Members help us fund our work to ensure we can stick around long-term.

See our plans (Opens in a new window)

Topic Data Science

0 comments

Would you like to be the first to write a comment?
Become a member of Tinz Twins Hub and start the conversation.
Become a member