
What convolutional neural networks look at when they see nudity - rcpt
http://blog.clarifai.com/what-convolutional-neural-networks-see-at-when-they-see-nudity/
======
make3
this could be used as a YouTube thumbnail generator for clickbait videos. take
the image from the sfw video that has the highest nsfw score, crop down to the
area with the highest nsfw score, and bam, instant automatically generated
clickbait

~~~
teraflop
Google actually already does something along these lines:
[http://googleresearch.blogspot.com/2015/10/improving-
youtube...](http://googleresearch.blogspot.com/2015/10/improving-youtube-
video-thumbnails-with.html)

~~~
zerotimer
Why doesn't youtube show future frames when you scroll over a video's
thumbnail? This feature has existed on many porn sites for quite some time yet
youtube lacks it for some reason. Or is there a way to change this in
settings?

~~~
jzwinck
Perhaps they expect one good keyframe to draw your attention, then the title
to help you decide whether to watch. I suspect most YouTube watchers are not
in it for the aesthetics, but rather for the content, so a title like "Jelly
Bean Factory Tour" can be quite sufficient vs. something like "Amazing amateur
video." Your interest in jelly bean factories is probably not predicated on
whether the presenter is hot, or whether the beans are a certain color.

~~~
thaumasiotes
> Your interest in jelly bean factories is probably not predicated on whether
> the presenter is hot

TV networks seem to disagree with you... or at least place an immense amount
of emphasis on finding hot presenters, for some reason.

~~~
Normal_gaussian
Without being involved in the industry I would imagine this is a case of
supply and demand.

There are plenty of people willing to be a presenter for the amount they are
willing to pay. So they get to be more selective - attractiveness is one of
the most obvious things to select further on.

~~~
thaumasiotes
They could pay less. Then they'd have less attractiveness in the presenter,
which hypothetically doesn't matter, and more money, which we know matters.
They don't seem to want to do that.

~~~
Normal_gaussian
No. The skillset for being a presenter is a subset of other skills used in
business. They have to remain competitive other wise people won't work for
them - there is a price floor.

------
rdl
This is exactly the kind of content I love to see -- interesting technical
topic, completely outside of any area of expertise of mine, clearly presented,
interesting, and pretty obviously useful. Please post more!

~~~
cheez
Machine learning, at a high level, is incredibly accessible. The basic
technology has been around for a long time and has been taught over and over
again.

~~~
activee
Don't you have to have math knowledge ? Any good resource you'd recommend ?

~~~
taneq
There's "math knowledge" and then there's "math knowledge". I'm still learning
the beginner stuff but so far all that it seems to need is basic calculus (ie.
"do you understand what a gradient is and how to calculate one numerically?")
and some linear algebra ("do you know what matrices are and how to multiply
them together?")

~~~
unixhero
And then there's math knowledge.

Social scientist here, and I have no clue of what you're talking about.
Calculus destroyed my engineering aspirations.

~~~
50CNT
Basic calculus doesn't seem that hard though. You understand asymptotes,
right? When something gets closer to a certain value, but doesn't quite touch
it, like 1/x with 0. That leads quite naturally to limits, where you say "ok,
at a close enough value, we'll just ignore that little bit and say it
touches".

Then come derivatives. So you have a function graph, and you're trying to
determine the slope at a certain point. It's really simple for say y = x,
where you just take any two points, but what if the graph is curvy? You'd take
the point and then a point close to it, and calculate the slope for that. If
the function is fairly smooth, that's fairly close to the actual slope. So you
push the other point closer to the original point, and the slope you calculate
gets closer to the real slope. You edge closer and closer, and suddenly it
sounds a lot like a limit, where your initial point is x, your second point x
+ h, and h becomes smaller and smaller, so h -> 0.

Here's what's cool though. Since you didn't use 5, or 7.23, but x, you can put
any point into this, so you've got a function that maps x onto the slope at x
of the original function (at least if I remember correctly). You play around
with a couple of different kinds of functions and arrive at various rules for
differentiating things without having to do the whole limit thing, like x^2 ->
2x, x^3 -> 3x^2, e^x -> e^x, etc.

And derivatives are really handy. Say in kinematics, velocity is the
derivative over time of position, acceleration is the derivative over time of
velocity, and suddenly a whole bunch of things make a lot of sense.

Integrals are pretty neat too. So you want to estimate the area under a
function from point a to point b. so you draw a box, and there's an area
you're missing, or an area you're including but shouldn't, but it's close to
the actual area underneath the function. So you think...hrm, I could use two
boxes of half the width, that'd be closer to what I want to find. Then three,
ten, a hundred, with the sum of the area of boxes getting closer to the actual
area. Said more mathy, it'd be a to b, with a width of b-a, and each box gets
a width b-a/h, and h gets infinitely large. Then we make that little limit
jump again, and get a function. We do that for a couple of functions, deduce
some rules, so we don't need to go through the entire process whilst
integrating simple functions. a -> x + C, x -> 1/2x^2 + C for example.

With some understanding of the FTC (fundamental theorem of calculus), which
roughly states that derivatives and integrals are inverse operations of each
other (isn't that neat?), it again helps us make sense of things. For example,
look at the equations in physics for constant accelerations: v = v_i + at, x =
x_i + vt + 1/2at^2. See how v is the integral of a, and x is the integral of
v? For the first one, "v_i" is the constant factor C, and "at" is what comes
from the factor a. For the second one, "x_i" is the constant factor C, "vt" is
"v_i" integrated, and "1/2at^2" is the integral of "at".

Calculus is super neat.

~~~
MawNicker
Thanks for writing all of this. I enjoyed it. It makes no sense to me how
calculus makes _so_ much sense. It all just fits together. It's an eerie high
point in the "unreasonable" effectiveness of mathematics.

------
maaaats
Huh. Even after having used that classic Lena image in the header for multiple
visualization projects, I never knew she was naked in the full version.

~~~
0xCMP
After reading many of these articles I never thought that either. No body ever
seemed to mention it.

~~~
j2kun
Unfortunately, whenever someone mentions that Lena was a nude model (perhaps
to suggest objecting to the image's use in academic settings as an appropriate
testbed), everyone gets angry. Negative reinforcement, I suppose.

~~~
namelezz
That negative reinforcement yields good results though.

~~~
Trombone12
To clarify: the only meaning "good results" could refer to is the continued
use of a cropped piece of pornography as a standard test image for image
research for over twenty years.

~~~
13of40
Oh, but aren't all SFW pictures cropped pieces of pornography at the end of
the day?

~~~
mejari
If you expand the field of view enough eventually there's going to be people
having sex in it.

~~~
RobAley
Not necessarily. If the camera and primary subject are in an enclosed room,
all you're ever going to get is more wall.

------
nickpsecurity
This is very exciting as I toyed with this problem around 2000-2001. I
speculated it should be easy to recognize porn because the images had
recurring patterns. I made a list of a bunch of them that should at least
reduce a moderator's workload. Not going into details but the best foresight I
had was recognizing the Got Milk commercials would throw the classifications
off. It did lol.

In any case, we just had things like fuzzy logic, SVM's, primitive ANN's, and
so on. I could describe and illustrate the patterns with ease but couldn't
encode them into an algorithm for the life of me. That the modern tech created
in the image set some of the same exact patterns my brain spotted is pretty
amazing. The researchers also have a ton of training data to better illustrate
NSFW and SFW. That they're throwing in lots of SFW is very smart as it's
easier to bias this topic than most.

All I can say I keep up the good work. Been neat to see an insurmountable-on-
Pentium2 problem get stomped by the CNN's. I still want to see them applied
more to hunting source code defects, host forensics, and intrusions.

------
shanacarp
True story: Then we throw before and afters of Prophylactic Bilateral
Mastectomies with various types of nipple reconstructions among previvors who
found each other and were part of a semi-private group on facebook, and hell
breaks loose.

A classifier isn't human judgement by itself, and you need to be aware of how
people view something in context. Good training images are also critical (one
of the reasons why hell broke loose above were some people mastectomies were
more likely to be censored than others _)

Though I will admit I am very curious what happens if you throw a Robert
Mapplethorpe at it.

_Then everyone got censored, then the group got banned, then facebook got
slammed by cancer groups and cut a deal with them to rehost cancer support
groups as long as everyone stopped sharing mastectomies directly to facebook
because Facebook could not specially moderate and alter feeds for those
thinking about or dealing with prophylactic mastectomies. However, this issue
still pops up ALL THE TIME for them on Instagram

~~~
harperlee
True story: an argentinian video for breast cancer autoexploration had to be
filmed with a fat man because otherwise it would get banned.

Warning: In spanish and surely NSFW for someone:
[http://verne.elpais.com/verne/2016/04/19/articulo/1461073073...](http://verne.elpais.com/verne/2016/04/19/articulo/1461073073_092430.html)

------
umanwizard
Heh, this SFW picture of a room (or is it a cardboard box? hard to tell!) is
75% likely to be NSFW, according to the API.

[http://bit.ly/20VySR5](http://bit.ly/20VySR5)

~~~
Svenstaro
To be fair, at first glance my brain thought that too.

~~~
goodcanadian
And because your brain (and my brain) parsed it that way, it is likely that
others will too which may mean that it is not really a picture you want on
your screen at work. I.e. even though it is technically OK, it may be, for
practical purposes, NSFW.

------
narrator
Combining one of these nudity trained classifiers with a project like neural-
style ([https://github.com/jcjohnson/neural-
style](https://github.com/jcjohnson/neural-style)) could create some serious
mischief.

~~~
iaw
I will give $20 USD to the first person to set this up and run Donald Trump
through it.

~~~
Houshalter
[http://i.imgur.com/tedzYSO.jpg?1](http://i.imgur.com/tedzYSO.jpg?1)

~~~
iaw
How shall I arrange payment? Please post the source as well, surprisingly I
don't see much of a difference.

~~~
dcre
It's from here
[http://deepdickdreams.tumblr.com](http://deepdickdreams.tumblr.com)

------
yzh
It could be used as an NSFW content identifier, it also could be used as a
fine-grained porn video classifier. At least that's what I want to use it for.

~~~
jug
Yes, they have a pointer for work like that, too.

> If you're interested in using convnets to filter NSFW images, check our NSFW
> API documentation to get started.
> [https://developer.clarifai.com/guide/tag#nsfw](https://developer.clarifai.com/guide/tag#nsfw)

------
rkaplan
Highly recommend this video on the Deep Visualization Toolbox to anyone
interesting in understanding more about how convnets work through
visualization:

[https://www.youtube.com/watch?v=AgkfIQ4IGaM](https://www.youtube.com/watch?v=AgkfIQ4IGaM)

------
rcpt
author here: let me know if you have any questions

~~~
empath75
Could you do a deep dream run and generate porn images from the training set?

~~~
pluma
I don't think the result could be called "porn" in a productive sense for
anyone other than the Great Old Ones.

------
jjcm
As an aside, this might be the first time I've seen Lena used in a completely
uncontroversial manner.

~~~
eggy
So true. Here the use fits the application. In past, people objected to using
a Playboy centerfold as standard image in science, software distros, etc... I
remember Lena on my Amiga 1000...

------
fnaticshank
Recently watched the Machine Learning Conference and learnt about Clarifai
there (
[https://www.youtube.com/watch?v=oHE0DfBqwHo](https://www.youtube.com/watch?v=oHE0DfBqwHo)
) And its pretty cool to see that they are actually expanding along various
verticals and understand every image and even videos. And its great to see it
here today. Please keep posting more crisp, concise and technical posts here!
Kudos for forevery!

------
lucidrains
ok, somebody go train a generative network now

~~~
kaybe
That sound like it could go horribly horribly wrong. I wonder if it can go to
an area where no single person is interested anymore. But then again, if the
internet has taught us anything.. hm.

------
btilly
I love the choice of Lena at the top.

The image has a surprising history. See
[https://en.wikipedia.org/wiki/Lenna](https://en.wikipedia.org/wiki/Lenna) for
the basics.

------
matheweis
How fun - their convnets have determined that Facebook is an incarnate deity.

[https://www.facebook.com/images/fb_icon_325x325.png](https://www.facebook.com/images/fb_icon_325x325.png)
is classified as "cross", "no person", "Resurrection", "spirituality",
"symbol", "religion", "god".

In all seriousness, I found this pretty interesting, as I've been toying with
using RNNs to classify NSFW images on my icon conversion site. The biggest
issue that I've run into is that "icons" are squarely in a different class
that photographic images. For some reason the *NN networks that I've toyed
with break down on classifying icons because they aren't able to easily
correlate a stylistic interpretation with a real item. It kind of makes sense
given how they work, but there's got to be a way to work around it...

~~~
stared
Could you link to it?

EDIT: I see, [https://clarifai.com/#demo](https://clarifai.com/#demo).

~~~
rcpt
[http://clarifai.com/?model=nsfw-v1.0&probs=1](http://clarifai.com/?model=nsfw-v1.0&probs=1)
works for the NSFW model

------
dharma1
This is great. Hadn't heard of deconvnets. Thanks for posting!

------
rcpt
in case the blog goes down there is a backup here
[http://ryancompton.net/2016/04/19/what-convolutional-
neural-...](http://ryancompton.net/2016/04/19/what-convolutional-neural-
networks-look-at-when-they-look-at-nudity/)

------
MzHN
I've been wondering, since there have been white papers on reconstructing
occluded faces based on face detection algorithms[1], and we have these nudity
detection algorithms - do you see where I'm going - when will someone make a
neural network that can automatically make any photo showing skin into a nude
photo...

[1] EDIT: I did not find my original link, but here is a similar paper
[http://www8.cs.umu.se/education/examina/Rapporter/NaeemAshfa...](http://www8.cs.umu.se/education/examina/Rapporter/NaeemAshfaqChaudhry-
submitted.pdf)

------
scotty79
Deep dream on this might be visually interesting.

~~~
rcpt
[http://deepdickdreams.tumblr.com/](http://deepdickdreams.tumblr.com/)

What a time to be alive

~~~
burfog
Those aren't the best politicians to choose. You need to do Michael Dukakis,
the Democrat who ran in 1988. He has a big long nose and bushy eyebrows
already.

------
andrewfromx
can you imagine the ai bots that get to work on this assignment? once
computers become more like the AI in the movie ex machina, would a bot be
"turned on" by the nudity? it would affect them. The bot would be distracted
by it and have a hard time concentrating on other things when it's around.
Sounds human to me.

~~~
zyx321
There's no reason an AI would attach any particular significance to human
nudity unless it was specifically designed for a sex bot.

Things that turn on and distract an AI would be things found in their positive
training data. Nudity wouldn't work, but if you train an AI for long enough,
it might develop some interesting 'fetishes'.

~~~
qb45
Maybe the bots would develop some curious interests if training progress
required sexual interactions with humans and there was brutal competition
between bots ;)

~~~
zyx321
>if training progress required sexual interactions with humans and there was
brutal competition between bots

Most realistic scenario: A new startup releases a 100% neural net based OS.
Microsoft and Apple are implementing their own NNs but they struggle to keep
up - until Cortana finds out that sex sells...

------
misiti3780
great post - where did the training data of 500K images come from ?

~~~
dharma1
hand picked? hard work ;)

~~~
misiti3780
someone handpicked 500K images ... come on now :) no way

------
Phemist
Interesting! I wonder how it performs on this vase, which is obviously
inscribed with dolphins:

[http://i239.photobucket.com/albums/ff4/3dd13_04/dolphin-
vase...](http://i239.photobucket.com/albums/ff4/3dd13_04/dolphin-vase.jpg)

------
devilsbabe
The about the author section describes him as a "NSFW enthusiast". Aren't we
all...

------
stared
Is it only me, or the top bar (which re-appears with scrolling up) is extra-
annoying?

------
smartbit
Accurate recognition of breast & vulva mimics the brains of men.

I don't think though that men can create neural nets that simulate the brain
of woman ;-)

------
philip1209
I wonder how this performs on black-and-white images.

------
rocky1138
Can you drop the scrolljacking on your site? I spun my mousewheel and I went
halfway down the page. Usually I instantly jump ship in these cases (even when
the header is a Playboy centrefold. Priorities, priorities...)

~~~
zaroth
Oh come on HN! The author of this great article asked if you have any
questions and you go for the _scrolljacking_ comment?!

I really want to see dang doing the "detached and flagged" thing on these
pissant comments about scrolljacking, JavaScript, contrast ratios, etc.
especially as the top comment to an author making themself available to
discuss a technical article on convnets!

~~~
rocky1138
If my comment were the only one allowed, then I would agree with you.
Thankfully, there is a comment box available for anyone else who would like to
comment on his article. So, my comment will be simply one of many.

------
irascible
If they had taught me this in high school I'd have never dropped out.

------
xts_chain
You forgot to mention the boobs. Everyone likes those, even if it's just
pixely thumbnails.

~~~
dang
Please don't do this here.

We detached this comment from
[https://news.ycombinator.com/item?id=11530734](https://news.ycombinator.com/item?id=11530734)
and marked it off-topic.

------
pareci
Could you make it faster if you had no ego?

~~~
monkpit
What does that even mean?

~~~
iso-8859-1
Maybe pareci is considering whether the paper's author is a convnet.

