use AI to fight bad guys hello world
it's suraj and internet fraud is a huge
problem and fraud techniques get more
sophisticated every day
we'll build a demo app in this video
that uses AI to identify fraudulent
transactions from a transaction data set
millions of consumers are victims of
identity theft or fraud every year and
that number seems to be going up in the
past few years the numbers are pretty
shocking just last year there was a
larger share of young people between the
ages of 20 and 29 that had fraud
complaints then there were senior
citizens aged 70 or older according to a
report from the FTC and it's not even
about how educated a victim is more than
half of the people who suffered a fraud
related financial loss had a financial
degree in 2016
today's fraud risks aren't just about
payments all companies both small and
large have to protect themselves and
their users from identity theft fake
user accounts man-in-the-middle attacks
there's a lot of risks to manage
I really hope Kanye got hacked and the
world of cryptocurrency has opened up a
Pandora's box of deception from shady
exchanges to pyramid schemes to pump in
dumps as you can see there's a massive
need for solutions to help both
consumers and businesses keep themselves
safe but how is this being done right
now over ninety percent of online fraud
detection platforms use transaction
rules to direct suspicious transactions
through a human review process this is a
traditional rule-based approach for
example we could programmatically define
that if a purchase is made in a
dangerous location like Zuckerberg
office and the purchase amount is over
some threshold then we can label it as
fraud the result of this process is
generally a binary labeling of a
transaction as either authentic or fraud
the huge disadvantage here is that this
process has a very high occurrence of
false positives
that means just your average consumer
wanting to make a purchase is gonna get
flagged as fraudulent for no reason this
is a big no-no it means they won't shop
at a business again since no one wants
to be flagged for no reason it also
means that businesses have to invest
time and money into exhaustive training
for employees to work on manual review
which ends up increasing the time
required to fulfill an order there's got
to be a better way consumers generate
lots of data the web is rich with data
it's everywhere and it surrounds
everything it's like the force IRL
why create rule-based systems when we
can use algorithms to learn from the
rich detailed data sets that consumers
are generating just by browsing the web
I mean machine learning is the science
of designing and applying algorithms
that are able to learn from the past
right AI can detect and recognize
thousands of patterns of a user's
purchasing journey instead of the few
captured by creating rules fraud
patterns we wouldn't even think of
tracking like time spent hovering the
mouse over a specific region of the
screen while mining Tron coin online
businesses want fast scalable and
efficient solutions for fraud detection
and AI startups can provide that for
them Junio for example helps businesses
authenticate potential customers by
letting them take a picture of their
photo ID and use their phone or computer
to scan their face they use computer
vision to verify that the person matches
the photo in the ID eye ovation is
another startup that helps businesses
prevent mobile fraud by automatically
collecting information about the
consumers device for example eye ovation
could notice a device was used to make a
big purchase in the previous 12 hours
then check to see if a phone number is
connected to more than say three devices
and see if the purchase is coming from a
high-risk location via catch builds user
profiles based on over
hundred cognitive parameters including
behavioral patterns this way it learns
what it looks like when fraudsters
create accounts purchase products or
even browse websites so how do we solve
this problem using AI the first step in
this process is to gather and segment
some quality transaction data if we can
find this we can train a model on it to
predict the probability of a transaction
being fraudulent ideally we can find a
labelled data set and we can use Google
to find some where each transaction is
labeled as either valid or fraudulent a
quality data set is especially important
in this case because we're talking about
the payments industry usually government
websites from across the world will be a
good source for this based off the types
of transactions that are available to us
we can pick a specific niche to target
easily we can verify our hypotheses of a
potential solution by browsing online
communities where ecommerce business
owners converse and see if they are
having the problem we're trying to solve
and share a landing page of our stealth
product to see if we can get any signups
if we do we have market validation the
main use case of machine learning in
fraud detection is the prediction we
want to predict the value of some output
that would be a boolean value in our
case fraud or not fraud given some input
values like the country the card was
issued in where it was used etc when we
build our model we have to decide what
kind of prediction problem this will be
either a classification problem or a
regression problem
let's pick classification since we're
trying to classify a transaction one
very simple model to use for
classification is a decision tree
they're essentially a set of rules that
are trained / updated using examples of
fraud that clients face the creation of
a tree ignores irrelevant features it
can also be inspected visually so we can
understand why a certain decision was
made by following the lists of rules
triggered by a certain custo
it gives us a probability score of fraud
based on earlier scenarios we can use
the popular scikit-learn library to do
this in just a few lines of code all of
it can be done in Python and the
accuracy can be tested just as easily
another model we can use is called
logistic regression this doesn't try to
predict the value of a numeric variable
given a set of inputs instead the output
is a probability that the given input
point belongs to in a certain class it
measures the strength of
cause-and-effect relationships in
structured data sets by assessing the
predictive power of individual variables
or combinations of variables as part of
a larger fraud strategy the authentic
transactions are compared with the
fraudulent ones to create an algorithm
and eventually it can be used to predict
whether a transaction is fraudulent or
not we can do this with psyche alone as
well simple algorithm few lines of code
and we can train it locally but of
course the real fun occurs when we apply
deep learning that our neural networks
yes it requires a big data set and lots
of computing power but it blows all the
other models out of the water in terms
of accuracy if we have those two things
so let's solve it or die trying'
ideally we don't even need labels we
could do this unsupervised in other
words we could just remove the labels
from our data set so many different
types of neural nets for us to choose
from we need one that can learn and
memorize the patterns of the normal
transactions during training since those
are the majority of transactions an
autoencoder would be perfect this is a
type of network that approximates the
function f of x equals x meaning given
an input x the network will learn to
output f of X that is as close to X as
possible it will reconstruct the input
as its output sounds counterintuitive
and useless right wrong the difference
between the output and input is measured
as the error it's what we try to
minimize during training so that the
output looks more like the input over
time an autoencoder follows a typical
feed-forward neural network architecture
except
the output layer has exactly the same
number of neurons as the input layer it
uses the input data itself as its target
value half of the network is considered
the encoder its job is to embed the
input data into a lower dimensional
representation this is a group of
numbers that represents the input data
in the most dense way possible
think of it like a compressed file the
other half of the network is the decoder
it tries to decode the embedded
representation back into the original
one we are relying on an auto encoder to
learn the common patterns shared by the
majority of the training data during the
Reconstruction period the error will be
high for the data points that don't
conform to those patterns these are the
anomalies were detecting which will
hopefully be the fraudulent transactions
we can build this in tensorflow with the
same amount of layers for both the
encoder and the decoder after training
it will tell us transactions that are
very likely fraudulent and we can apply
this learned model to the transaction
data set of one of our first clients to
be safe we can manually review those
transactions as well at first and
continually fine-tune and improve our
model algorithmically by adding more
data and more computing power if some
transaction is above a certain threshold
that we define in terms of fraud
likelihood we can put it on hold for
manual human review three closing points
to remember Wizards fraud is a massive
problem for online businesses it's
nowhere near being solved and AI
startups can offer them an awesome
solution to reduce it we can use
decision trees logistic regression
models and auto-encoders to perform
anomaly detection identifying fraudulent
transactions in a data set and
auto-encoders reconstruct the input data
which makes it an unsupervised machine
learning technique you made it to the
end of the video pat yourself on the
back and Pat that subscribe button for
now I've got to catch a fraudster so
thanks for watching