
Decensoring Hentai with Deep Neural Networks - teekno
https://github.com/deeppomf/DeepCreamPy
======
zawerf
I believe "Image Inpainting for Irregular Holes Using Partial Convolutions"
has been superseded by "Free-Form Image Inpainting with Gated Convolution",
especially for interactive use cases?

[https://arxiv.org/pdf/1806.03589.pdf](https://arxiv.org/pdf/1806.03589.pdf)

[http://jiahuiyu.com/deepfill2/](http://jiahuiyu.com/deepfill2/)

I think the most interesting part of this project would be generating the
dataset. That is _a lot_ of manual redrawing of vaginas/penises. Or the
reverse, where you find already decensored stuff and add realistic censorship
yourself. Either way, a lot of time will be spent tagging genitals to build a
large enough dataset to make NN techniques work...

~~~
yorwba
It's not clear to me that you'd actually need to manually label individual
images for training. The work of detecting and marking the censored regions is
left to the user, so the model just needs to be good at inpainting. There are
probably enough specialized sites to get a decently-sized training set with
little effort beyond writing a crawler.

~~~
gwern
I suggested that to deeppomf a while ago (I was thinking of simply using
unlabeled anime images from
[https://gwern.net/Danbooru2017](https://gwern.net/Danbooru2017) with random
area deletions to simplify the model & training process as much as possible)
and his belief is that because genitals are such a small fraction of any
images, and the rest of images vary so much while genitals are a fairly small
narrow domain, a generic inpainting/denoising CNN will learn to inpaint pretty
much anything else possible and neglect genitals specifically.

Presumably if you trained a _really_ big inpainting CNN a _lot_ , it would
learn genitals (along with everything else), but it's understandable that he
would try a much more targeted approach.

~~~
yorwba
So do you know what exactly the model was trained on? Unless I missed it,
there's no training code in the repo, or any other indication of how data was
prepared.

~~~
gwern
I'm not sure. I suggested Danbooru2017, as I mentioned, and I thought he was
using it, but double-checking his Reddit comments he seems to imply he's using
a custom private dataset only at this point. Maybe he hand-extracted a lot of
censored/original pairs from various places.

------
HONEST_ANNIE
I predict that the porn industry will be the first industry to suffer mass
unemployment due to AI.

Phase I: Deep learning combined with realistic physics simulation will
eventually replace human actors. At some point amateurs can record their
movements, then use variational autoencoders to improve their features (bigger
boobs, thinner waist, smooth skin) and replace professionals. This is 'Uber
phase' for porn and drives down the wages.

Phase II: Eventually AI can mimic complete scenes and adjust the 'plot' to the
current state of the observer. Tight sexual biofeedback loop will form.

Phase III: The rapture of the nerds. Fully interactive VR + toolset. In the
context of the Fermi paradox, Phase III is the Great Filter.

\----

[https://en.wikipedia.org/wiki/Great_Filter](https://en.wikipedia.org/wiki/Great_Filter)

~~~
failrate
Porn has always been the earliest adopters of technology. While porn actors
may be individually replaced by deep agents, actual porn sales will do fine,
especially since extremely targeted pornography will be in everyone's budget.

A market for verifiable human pornography will exist alongside the new porn.

Also, have we already dubbed virtual ML pornography "deep throat"?

~~~
setr
I thought it was deep fakes?

~~~
failrate
Deep facials

------
RankingMember
Gotta give them some credit, that is a brilliant name.

~~~
EForEndeavour
Next up in deep learning for porn augmentation: TenseHerFlow.

------
skrowl
Finally, a use case for Deep Neural Networks that we actually need as a
society!

~~~
a1369209993
I wouldn't say _need_ per se, since this is something that can and has been
done in other ways already, but it's at least a use case with positive, rather
than negative, value.

------
huntie
Saw this a few days ago. It could use some work for mosaic censors but bar
censors looked pretty good. I heard it was just some guy on /g/ who said he
would make it and then actually did it, so I'm pretty impressed.

------
anonytrary
There should be NSFW examples in the Readme. I saw some practical (NSFW)
examples on 4chan and it doesn't seem to work very well. Most hentai doesn't
contain simple lines and blobs covering homogenous skin area. There is detail
under those areas that the algorithm does not reproduce at all.

~~~
flyingfences
On the contrary, the examples I saw on /h/ looked pretty impressive for the
most part.

~~~
anonytrary
Well, I guess we have different definitions of impressive. The de-censored
areas did not reproduce genitalia properly at all.

~~~
flyingfences
The original illustrators of plenty of hentai do not reproduce genitalia
properly at all, if we're being honest.

~~~
anonytrary
I fail to see how that is relevant to the discussion. I'm saying that
unblur(blur(x)) !== x. Whether or not x === y is not important here.

------
eberkund
Are there any more examples? Removing a few lines doesn't seem that impressive
and can be done with the PhotoShop pattern tool without any fancy neural net.

~~~
nathanasmith
More examples and commentary found here:
[https://boards.4chan.org/g/thread/68220714#p68220714](https://boards.4chan.org/g/thread/68220714#p68220714)

Edit: should have mentioned NSFW

------
Brian_K_White
At least for the most common forms of obfuscation, pixellation and fuzz, why
do you need AI for this? It seems conceptually simple to interpolate from
several similar but moving frames, how a small obfuscated feature travelled
across a huge pixel boundary to cause the small change in the entire oversized
pixel.

You'd need I, be it AI or the normal kind, to invent a guess from a single
frame. But watch frames that each differ a little over time, and you should be
able to deobfuscate pixellation and fuzz with plain math.

Conceptually simple. Not saying I could knock it out over the weekend, just
that there doesn't seem to be a mystery about how to proceed that puts it into
"throw some ai at it and see if anything happens by ai magic" territory.

------
matachuan
The project name is GOLD

------
anon_cow1111
I wonder how this deals with the stippling seen in black and white printed
pages. As someone familiar with digital drawing/editing, any slight
imperfection in the pattern becomes super obvious and it's even worse with
stippled gradients.

I'm sure it'll be a useful tool with refinement, but this is still a solution
to an artificial problem. There's no reason for Japan's current censor laws to
exist in 2018.

~~~
flyingfences
FAQ says they currently make no attempt to deal with that and it straight up
won't work if you try.

------
sheharyarn
This is exactly why AI was needed (and subsequently created) in the first
place!

------
crimsonalucard
This is genius. Give the network a bunch of photos with a persons' face
censored (donald trump, for example). What would it replace the face with?

~~~
userbinator
_What would it replace the face with?_

Judging by the examples, correctly-coloured yet featureless skin.

------
asianthrowaway
I wonder what will happen when neural networks can generate illegal content,
like child pornography.

~~~
bcOpus
It will vary by country. In a lot of Europe and the US the content will still
be illegal. In Japan it won’t be. At some point the issue is going to come
down to what you want to spend manpower and money fighting, people who
actually endanger and harm children, or people who use computers to emulate
it. It might not be a very clear cut thing though, because I frankly wouldn’t
be shocked to find out that the overlap between people who want pornography of
real and simulated children is significant.

Where it might be a little more clear cut is feeding the market that clearly
exists for “teen” porn, which is currently filled by 18+ actresses. I suspect
a non-trivial percentage of the non-child-abusing population would consume
simulated 16 year old porn without ever considering the real thing. In that
case you might see some changes.

Reply edit It’s already outlawed. In the US for example pornographic
_drawings_ of children are outlawed. In the same way it’s illegal to try and
sell cocaine stimulants, it’s illegal to try and sell child pornography
simulations. I doubt the A.I. itself would be illegal, just its output.

~~~
asianthrowaway
But how would you outlaw it? A neural network is simply a set of coefficients,
would certain coefficient combinations be illegal? It's an interesting
question.

PS: I am obviously against child pornography, I'm just curious about the
implications of being able to generate illegal content and how governments
would deal with it.

~~~
Cantonese
How is cp illegal now? Each image is just 1s and 0s on your drive. It's really
just an illegal number.

~~~
asianthrowaway
That's pushing it too far. An image might be represented as 1s and 0s but what
it represents is a "real world event" which actually happened. If it was
stored on magnetic tape instead of on a hard drive it would still represent
the same thing. It's what the event represents (child abuse) which is illegal.

However, a neural network represents a mathematical model, not a specific
"real world event". Although I suppose you might argue that since the dataset
required to generate it would be illegal, it is illegal?

~~~
yorwba
In most Western countries, the content can be illegal independent of the real-
world event being legal or not, or even if there's no real-world event at all
(i.e. fictional depictions). It's not illegal for a teenager to pose in the
nude, but it might be considered illegal for them to take a photo of
themselves and post it on the internet.

I think linking illegal depictions to illegal events would be saner, but
that's not how it currently works.

~~~
asianthrowaway
Interesting. Yeah I agree that it would make sense for the link to be clear.

Come to think of it, a couple of years ago there was this app called FaceApp
which came out which used neural networks to modify selfies in funny ways
(like making you older/younger/of the opposite sex).

I wonder if anyone has ever run a pornographic image with the "younger" filter
in the app. Would that be illegal?

~~~
claudiawerner
Under some jurisdictions, I imagine so, since even purely computer-generated
images are illegal, and there are other laws which criminalise purely drawn
material. It may hit a gray spot in the law, but I doubt a judge would have
trouble interpreting the existing law. This is in reference to English and
Welsh law, by the way. The exact wording of the law concerns a depiction of
someone who "conveys the predominant impression of a child".

