top | item 24251131

Chrome, Firefox extension that blocks NSFW images using TensorFlow JS

150 points| bishalb | 5 years ago |github.com | reply

157 comments

order
[+] liability|5 years ago|reply
> All the images remain hidden until they are found to be NSFW or not

The demo screenshot/page seems to only show NSFW images, so the demo doesn't convey how quickly this classifier can operate. The demo page should have some non-NSFW images to show off how quickly SFW images are revealed, since the default is to block all images.

[+] navendu_p|5 years ago|reply
We will change that. Seems like a good idea
[+] refresher|5 years ago|reply
I’ve jokingly / seriously been waiting for things like this. I’m the type to go overboard with filtering and mute lists on twitter, but images are harder to deal with. I did have a 60,000 line pastebin that was used in conjunction with a Chrome extension to block Wojack and Pepe memes on 4chan using md5 hashes, but something not rely on specific hashes is obviously superior.

One day someone will release the ‘detect and block anything resembling kpop’ extension for Twitter and I’ll be happy.

[+] solarkraft|5 years ago|reply
> block Wojack and Pepe memes on 4chan

What are you there for, then?

[+] justanotherhn|5 years ago|reply
I expressed some interest at some point of hiding profiles which contained a certain phrase in their bio and got downvoted. Does anyone know of any extentions that can do this?
[+] chownie|5 years ago|reply
I am very interested in this wojak/pepe filtering thing, I think it's finally started to decrease but there was a solid 5 year gap where you really couldn't escape those dumb pictures

I started doing the same with md5 hash filtering but it was very slow going, an AI that can detect low quality posts and filter them out is the holy grail I guess

[+] Fiveplus|5 years ago|reply
>One day someone will release the ‘detect and block anything resembling kpop’ extension for Twitter and I’ll be happy.

Not only kpop, but entire "fandoms" as a whole. When that software finally arrives, I want to be able to refer back to this comment and say I read it here first.

[+] danielscrubs|5 years ago|reply
I want the same for ‘emotional hooks by PR’. It works so well on the internet that we get flooded with it.
[+] m3kw9|5 years ago|reply
From experience 99.9% of the time unless I visit a porn site purposely or some warez site by accident, or questionable reddit channels, I see no NSFW. However I do see some benefits if this was for kids.
[+] yonixw|5 years ago|reply
Sound like you have ad-block or avoid sketchy (pirate) websites.
[+] codetrotter|5 years ago|reply
A few years ago I was at work and was looking up something and the page I landed on had ads that featured a barely dressed lady in them. The funny thing is that I didn’t even notice the ad until one of my coworkers, who was passing by my desk stopped, chuckled and asked me if I was looking at ladies on the computer during working hours lol.

I guess I had developed a kind of builtin ad filter into my brain, from ignoring so many ads over the years.

Thankfully, my place of work had reasonable people working there. But I think if I worked somewhere more strict even that one ad might have prompted a conversation with HR. Nonetheless, I promptly installed an ad-blocker on the browser in case any ads would be shown in the future that would have been more explicit than the one that had been showing this time.

[+] Wowfunhappy|5 years ago|reply
Preventing the last 0.1% could be meaningful though, depending on your environment.
[+] ndm000|5 years ago|reply
Shameless plug - I've been working on something similiar, but with a different aim.

https://github.com/nmurray1984/porn-blocker-chrome-extension

I found that the hardest problem to solve was the prevanlence of false positives. Even if you have a low false positive rate, it's still very likely to have an image blocked regularly just due to volume.

For that reason, the focus of my plugin is - for users that are OK with it - contributing URLs that are not NSFW but have been blocked. The extension includes a right-click menu option to do so.

[+] kmfrk|5 years ago|reply
This is great, except it'd be really, really great with some sort of placeholder image for the blocked images if possible.
[+] navendu_p|5 years ago|reply
We had that in the first version but we kind of removed it. We will try to add one option for that.
[+] solarkraft|5 years ago|reply
Why would I care about not seeing NSFW images?

What I really do care about is not seeing worthless clickbait. That makes me endlessly angry. Could you build a filter like that on top of this?

[+] andrekorol|5 years ago|reply
This extension reminded me of that Black Mirror episode where a mother filtered what her daughter could see and hear.

Great work with TensorFlow by the way, can't wait to see this technology maturing over the years.

[+] gftsantana|5 years ago|reply
I've been wanting for something like this ever since we by accident looked at our 9 year old daughter's screen. She likes to draw characters from her favorite cartoon and searches for images on the web. Apparently there's a porn actress with the same name as one of the characters... DDG was set to "strict", so no full nudity or any explicit act, but still very NSFW.
[+] moooo99|5 years ago|reply
DDG is kind of fascinating. Ever since I switched to DDG as my main search engine, I feel like the internet is 90% porn. Although that's probably not far off, I'd prefer seeing relevant search results instead.
[+] amelius|5 years ago|reply
I want this but for ads.
[+] nextaccountic|5 years ago|reply
Does the Tensorflow model run in JS? How fast is that?

Would it be feasible to run the model in wasm or in the GPU?

[+] rlayton2|5 years ago|reply
I can't speak for this specific model/extension, but "most" neural networks aren't that big at the end of the day, and you are just a few matrix dot products away from getting your classification (of course, I'm drastically simplifying).

Its the training that takes forever, due to the fact all those numbers need tweaking. However one you have the model, classifying is pretty fast.

[+] rtz12|5 years ago|reply
I just installed this, and my whole browser grinds to a halt when I load a page...
[+] langitbiru|5 years ago|reply
Yes, tensorflow model can run on JS. I did that when developing a Deep Learning product, PredictSalary (https://predictsalary.com). The problem is not the model, but the TensorflowJS library (using Node) is big (8MB) after webpack-ing it (even after using compressing flag).

So I decided to move the inference to the server.

It's fast but I didn't toy with GPU setting when running Tensorflow model on JS.

[+] navendu_p|5 years ago|reply
So we use MobileNet V2 model. It is relatively light weight and can run fast on the browser itself
[+] bullman|5 years ago|reply
disappointed this is not called "hotdog / not hotdog"
[+] pledg|5 years ago|reply
This would be too late in my workplace, as they'd be logged that I downloaded the images. That I didn't see them in my browser would be irrelevant.
[+] capableweb|5 years ago|reply
Yeah, fixing that would require breaking "The extension runs completely on your browser. i.e No user data is being sent to a server for processing." as image requests would have to be hashed, checked on a server and only allowed depending on the response.

So seems this extension is not really for your use case but for others.

[+] gvjddbnvdrbv|5 years ago|reply
I'm curious how workplaces do this. Does they have a root cert installed so they can MITM SSL traffic?
[+] treis|5 years ago|reply
I don't think it's irrelevant. Having a NSFW pop up in the middle of a meeting and your access logged is much worse than just your access being logged.
[+] rtz12|5 years ago|reply
It would be a nice feature for this extention to collect the URLs of detected porn images and report their hashes back, so they could be integrated into the extention itself.
[+] Santosh83|5 years ago|reply
Anyone know of a tool which can process videos (movies) and black/blur out nude scenes and make the film "family friendly"? The processing doesn't have to be realtime...

Just to expand: there are many excellent films which are not "family friendly" only because of 1 or 2 nude scenes which aren't even germane to the overall plot in many cases. I often wished there was a tool or SaaS that could detect such scenes and cut or blur them out. Would save a lot of manual processing.

[+] capableweb|5 years ago|reply
If you want to make videos family friendly, it's probably better to aim for removing violence than nudity, as one is clearly worse for the psych than the other.

Expansion: how are nude scenes not family friendly? Not trying to start any flame wars here, just trying to understand how one or two scenes with nudity suddenly means the video is not family friendly? We all go through life seeing nudity, so should be fine. Violence however is something we both strive and should avoid as much as possible.

[+] skrause|5 years ago|reply
> Expansion: how are nude scenes not family friendly?

The answer is "American Prudery".

[+] null_deref|5 years ago|reply
Why not both? You could also argue that repeatedly seeing the most beautiful actors in the business nude, can hurt a teenager self image pretty badly, or that learning about sex from movies is probably not the best idea.
[+] pmachinery|5 years ago|reply
Surely it's not that hard to understand that for religious, cultural or other reasons some people and/or members of their family may feel uncomfortable seeing nudity.
[+] goda90|5 years ago|reply
Lots of nudity in film is of a sexual nature. Uncontrolled exposure to fictional depictions of sex could create unhealthy understanding of sex in children that parents want to avoid. Hence not family friendly. I'm not saying most in film violence is either, but that's the reason.

One film I think of in this regard is Schindler's List. I've seen both the original and the TV edit that Spielberg made to broadcast for teenagers to see. The primary edits I noticed were sex scenes and post-sex nudity. Those scenes weren't gratuitous(they showed something about the characters) or anything, but were edited(either cut or blacked out part of the frame). BUT there was still lots of nudity in the edited film. This was nudity of a different nature. People forced to strip down and paraded in the open for inspection.

Sometimes parents just want to take the easy path and consider all nudity as out of bounds for their kids. I think that's fine.

[+] shubb|5 years ago|reply
That's starting from the assumption you are doing this to engineer your children ands psychology.

Actually I think a lot of people find it awkward to watch graphic sex scenes and extended nudity with their family. As a grown up, the I feel awkward watching parts of game of thrones with my parents.

That's a shame because I would like to watch this show with them. Lately a lot of major TV shows seem to aim to include one nude scene per episode - I guess the money people think that's what sells...

I can understand why some people might find violence equally difficult, but where it features it tends to be much more tied to the plot.

[+] umvi|5 years ago|reply
Because it's awkward getting sexually aroused in front of family members?
[+] umvi|5 years ago|reply
Now just make a version that whites-out NSFW text in e-books and market it to Utahns as a way to read PG-13 versions of Game of Thrones books and you'll be rich.

However, you'll probably also be sued into oblivion by angry authors/publishers who don't like people modifying what they read in any way.

[+] aasasd|5 years ago|reply
I happen to not be afraid of boobs, so ever since my days on Reddit I wish for blocking of random gore instead. This is weirdly pertinent sometimes on DDG's image search.

Edit: to clarify, I'm not afraid of some killing either, thanks to the pop culture of the past seventy years or so. Now, why eye-hurting images of bodily damage pop up on rather innocent searches—that's a haunting mystery. On Reddit, the ‘NSFW’ label is used equally for a vaguely sexually suggestive shape or a close-up more suitable for a surgical journal. As if I didn't get plenty of suggestiveness just from music videos anyway! So my long-standing wish was for an ‘NSFL’ filter instead.

[+] azalemeth|5 years ago|reply
I have never understood how acts of love (at best) or reproduction (at the least) are considered in some societies to be dangerous, shocking, and in need of the strictest censorship -- or at the very least, not on prime-time TV. Yet acts of war, killing, maiming, and violence in general are often the mainstay of entertainment.

Sex is part of human nature – and, I would argue, a much bigger and better part of it than violence and aggression. Why do we hide from it?

[+] iso947|5 years ago|reply
For some reason in America half a butt cheek is worthy of a 15+ rating in films, but “general release” films are fine with burnt bodies hanging from trees