Scammer Detection

Last updated November 17th, 2017

Table of contents

Overview

The Scammer Detection Model is useful to help detect and block common frauds on social networks and dating sites. The so-called scammers are romance scammers, military scammers or other types of scammers that trick people into sending them money.

Over the years we have built a reference database of tens of thousands of profiles and images from all over the world known to be used by scammers.

Example: profile frequently used by scammers

Principles

The Scammer Recognition works by first finding relevant faces within an image or a video frame and then comparing the face characteristics to our list of known profiles used by scammers.

The Face Recognition we apply to this end works in a way that makes it robust and able to recognize scammer profiles in previously unknown images. The API works for color images as well as black-and-white, and will work from different angles, in different lighting conditions.

Scammer probability

The returned value is between 0 and 1, images with a scam probability value closer to 1 will have a scammer while images with a scam probability value closer to 0 will not have a scammer.

Use-cases

  • Require that users submit or upload real photos only, rather than fake images
  • Detect malicious users

Recommended thresholds

When processing the "scam probability" value returned by the API, users generally set a threshold. Images or videos with a value above this threshold will be flagged as potentially containing a scammer while images or videos with a value below will be considered to be safe.

Thresholds need to be fine-tuned for each individual use-case. Depending on your tolerance to false positives or false negatives, the threshold should be adapted.

  • If you want to reduce false negatives, you may want to start with a threshold of 0.2 (meaning that images with a "scam probability" value above 0.2 would be flagged)
  • If you want to reduce false positives, you may want to start with a threshold of 0.5
Profile known to be used by scammers: (scam probability 0.9999)
Profile not known to be used by scammers: (scam prob value 0.0137)

Use the model

To start, you need to create an account to retrieve your API keys. Then you must install the SDK that corresponds to your programming language.


# install cURL: https://curl.haxx.se/download.html


pip install sightengine


composer require sightengine/client-php


npm install sightengine --save

Detect a scammer

Let say you want moderate the following image:

You can either upload a public URL to the image, or upload the raw binary image. Here's how to upload the


curl -X GET -G 'https://api.sightengine.com/1.0/check.json' \
    -d 'models=scam' \
    -d 'api_user={api_user}&api_secret={api_secret}' \
    -d 'url=https://d3m9459r9kwism.cloudfront.net/img/examples/example-scam1-1000.jpg'


 # if you haven't already, install the SDK with 'pip install sightengine'
from sightengine.client import SightengineClient
client = SightengineClient('{api_user}','{api_secret}')
output = client.check('scam').set_url('https://d3m9459r9kwism.cloudfront.net/img/examples/example-scam1-1000.jpg')


// if you haven't already, install the SDK with 'composer require sightengine/client-php'
use \Sightengine\SightengineClient;
$client = new SightengineClient('{api_user}','{api_secret}');
$client->check(['scam'])->set_url('https://d3m9459r9kwism.cloudfront.net/img/examples/example-scam1-1000.jpg');


// if you haven't already, install the SDK with 'npm install sightengine --save'
var sightengine = require('sightengine')('{api_user}','{api_secret}');
sightengine.check(['scam']).set_url('https://d3m9459r9kwism.cloudfront.net/img/examples/example-scam1-1000.jpg').then(function(result) {
    // The result of the API
}).catch(function(err) {
    // Error
});

Here is the result:

                    
                    
{
    "status": "success",
    "request": {
        "id": "req_0RNttFqUKWhGSAlcENj3Z",
        "timestamp": 1495636774.8524,
        "operations": 1
    },
    "scam": {
        "prob": 0.9895
    },
    "faces": [
        {
            "x1": 0.4186,
            "y1": 0.2417,
            "x2": 0.6152,
            "y2": 0.6698,
            "features": {
                "left_eye": {
                    "x": 0.5326,
                    "y": 0.3969
                },
                "right_eye": {
                    "x": 0.4512,
                    "y": 0.4219
                },
                "nose_tip": {
                    "x": 0.4805,
                    "y": 0.525
                },
                "left_mouth_corner": {
                    "x": 0.5501,
                    "y": 0.5573
                },
                "right_mouth_corner": {
                    "x": 0.4811,
                    "y": 0.5813
                }
            }
        }
    ],
    "media": {
        "id": "med_0RNtVu0azEaBwPgZI0fur",
        "uri": "https:\/\/d3m9459r9kwism.cloudfront.net\/img\/examples\/example-scam1-1000.jpg"
    }
}
                    
                

Did you find this page helpful?

We're always looking for advice to help improve our documentation!

Let us know what you think