1.1.0 • Published 1 year ago

nft-scam-detector v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

SUI NFT Scam Detector

A lightweight detector scam classifier for NFTs with 95% accuracy. Can run anywhere that webassembly runs: on a server, in a lambda function, and even running entirely in your browser.

Also included is the model training code and data, so you can train and bring your own model if the default model is not performing well.

Feature extraction is done with a combination of on-chain data and OCR using the tesseract.js library. Classification is done with naive bayes and hand-picked labels.

We labeled NFT into 2 categories:

  • Scam: NFT that our classifier detected as scammed
  • Ham: NFT that our classifier detected as trusted

Installation

  • Using npm
npm install nft-scam-detector --save
  • Using yarn
yarn add nft-scam-detector

Getting started

import { extractAndClassify } from "nft-scam-detector";

const imageUrl = "YOUR_NFT_IMAGE_URL";
const result = extractAndClassify(imageUrl);

result.then(console.log);
// result here 
// 
// {
//     "classification": "scam",
//     "scam_likelihood": 0.0001565123,
//     "ham_likelihood": 0.0000004214,
// }
// 

Testing

Live testing at: https://sui-nft-spam-fe.getnimbus.io/

You can test the accuracy of a model using the code in the /test folder. Make sure that your training set and test set do not overlap. It should spit out a confusion matrix as well as all of the mistakes made with accuracy more than 95%

scam (predicted)ham (predicted)
scam (actual)200
ham (actual)218
  • avg time: 1930ms
  • median time: 1820ms

License

MIT License

1.1.0

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago