nsfwjs icon indicating copy to clipboard operation
nsfwjs copied to clipboard

False positive on tiktok videos

Open azurenekowo opened this issue 3 years ago • 13 comments

I had a discord bot up and running this module, apparently this image is flagging for "Porn" with 62%???

I was running Inception v3 (the default model). image

azurenekowo avatar Dec 25 '21 15:12 azurenekowo

Update: Somehow mangas / doujinshis got flagged aswell

This image flagged with 98% hentai...

azurenekowo avatar Dec 26 '21 03:12 azurenekowo

There will be false positives for sure. Can you provide the images in this chat (that link isn't working) and also can you identify which model you were using?

GantMan avatar Dec 28 '21 14:12 GantMan

@GantMan sure, here is the image

Screenshot_20211228-230823_Gallery

I am using the default model (Inception v3) as the same as the example in the readme file.

azurenekowo avatar Dec 28 '21 16:12 azurenekowo

UPDATE: IT IS NOT INCEPTION V3. I just do nsfw.load() without any arguments.

Screenshot_20211228-231159_Chrome

azurenekowo avatar Dec 28 '21 16:12 azurenekowo

I just tested this on all three models. All 3 said top class was Neutral. While the one you're showing there is barely sure, it's still correct. Which one is saying 62%?

GantMan avatar Dec 28 '21 19:12 GantMan

@GantMan hello, I don't know what module I'm currently using, I just copied the example nodejs code in the readme file.

image

By the way, I found the original image. The image I sent 7 hours ago was a screenshot.

image

azurenekowo avatar Dec 29 '21 01:12 azurenekowo

Also, when I upload the bot to heroku, it seems like calling image.dispose() will cause a memory leak. Any solution on this?

image

image

azurenekowo avatar Dec 29 '21 02:12 azurenekowo

More updates: Mangas also got false-flagged.

image

image

azurenekowo avatar Dec 29 '21 02:12 azurenekowo

Hrmmm I'm not sure what the issue is right away. Strange that the result is different from what you see on NSFWJS.com

Also, I'm not sure where your memory leak is coming from either.

I'm a bit busy, so I can't really spin up a node instance to debug at this time. Can you check the image Tensor you're getting against this one?

Here, in this code, I grab the first 100 values of your image: https://bit.ly/3EBYYSi Can you grab the first 100 values of your tensor image and compare?

GantMan avatar Dec 29 '21 15:12 GantMan

Hrmmm I'm not sure what the issue is right away. Strange that the result is different from what you see on NSFWJS.com

Also, I'm not sure where your memory leak is coming from either.

I'm a bit busy, so I can't really spin up a node instance to debug at this time. Can you check the image Tensor you're getting against this one?

Here, in this code, I grab the first 100 values of your image: https://bit.ly/3EBYYSi Can you grab the first 100 values of your tensor image and compare?

Hello, sorry for the late reply sir, here is the result.

image

The code that I used:

image

azurenekowo avatar Dec 30 '21 03:12 azurenekowo

Well, the first thing I notice is that the tensors have different values. They don't seem terribly off from one another, but they definitely have different values. That's probably the main issue. I'll see if I can figure out why, you should too.

image

GantMan avatar Dec 30 '21 18:12 GantMan

New false postivite: Rule34 link

Tested by all 3 modules at https://nsfwjs.com/ All 3 returned "Drawing" for > 97%

@GantMan

azurenekowo avatar Dec 31 '21 02:12 azurenekowo

That link is what we call a "false negative". I'll add it to the dataset for future training.

GantMan avatar Dec 31 '21 16:12 GantMan