Open Sourcing a Deep Learning Solution for Detecting NSFW Images
yahooeng.tumblr.com
yahooeng.tumblr.com
Though at the same time I fear the type of pornography it may come across.
What happens here with generating illegal content? If you put a public text->image gan up, and someone uses it to generate child porn, are you responsible?
How could you make sure it couldn't?
Though that then raises the question: when happens when it can be generated so realistically that it looks indistinguishable from the real thing? Would it still be treated like cartoons? How could you prove one way or the other? Lots of questions here.
>Prohibits drawings, sculptures, and pictures of such drawings and sculptures depicting minors in actions or situations that meet the Miller test of being obscene, OR are engaged in sex acts that are deemed to meet the same obscene condition. The law does not explicitly state that images of fictional beings who appear to be under 18 engaged in sexual acts that are not deemed to be obscene are rendered illegal in and of their own condition (illustration of sex of fictional minors). Maximum sentence of 5 years for possession, 10 years for distribution.
Interestingly the same act does make all computer generated child pornography which is "virtually indistinguishable from that of a minor engaging in sexually explicit conduct" with no requirement that it be obscene, I don't think that has been tested in court yet.
Provisions against simulated child pornography were found to be unconstitutional in Ashcroft v. Free Speech Coalition [0] in 2002.
From wiki [1]:
> Referring to [New York v. Ferber, 1982: child pornography is not protected speech], the court stated that "the CPPA prohibits speech that records no crime and creates no victims by its production. Virtual child pornography is not 'intrinsically related' to the sexual abuse of children".
IANAL, but following that logic alone, the degree of realism doesn't seem to be relevant to the legal precedent insofar as photorealistic imagery would still "record no crime" nor "create victims by its production." As to whether it's dangerous for such material to exist because it would create plausible deniability for the production of actual photography while claiming it's simulated...I guess that would be a different matter.
[0]: https://en.wikipedia.org/wiki/Ashcroft_v._Free_Speech_Coalit...
[1]: https://en.wikipedia.org/wiki/Child_pornography_laws_in_the_...
The test:
* Whether "the average person, applying contemporary community standards", would find that the work, taken as a whole, appeals to the prurient interest,
* Whether the work depicts or describes, in a patently offensive way, sexual conduct or excretory functions specifically defined by applicable state law,
* Whether the work, taken as a whole, lacks serious literary, artistic, political, or scientific value.
Also:
Critics of obscenity law argue that defining what is obscene is paradoxical, arbitrary, and subjective.
---
I think it would be hard to not find generated child porn obscene by this test, unless you have a good lawyer, at which point there is plenty of wiggle room.
There's also the issue that "contemporary community standards" are hard to determine, because what community you're talking about is hard to determine.
Where does the harm boundary lie? Is harm inflicted if an inanimate object is the only thing consuming the content? Is a generated video borne from harmful content an interest payment on your harm-capital?
Meta, but interesting I wonder whether this train of thought would hold in a court of law...
http://www.mirror.co.uk/news/uk-news/fan-japanese-anime-make...
There is no law that sickens me more than the one that criminalises drawings. It angers me far more than even modern copyright law.
And the worst part is that nobody seems to care about it, even those who are libertarians in the UK who I've met are overcome with repulsion at the type of speech or expression, not caring for the violation of rights.
It's a horrible law backed by no evidence of harm caused, and I think it is truly truly wrong that people ignore it. I am not exaggerating when I say that the principle is a motivating factor for me to leave the UK
I just wanted to say that I agree 100%. The UK's laws on obscenity and freedom of speech in general are a terrifying mess.
You can be arrested and convicted for as little as wearing a t-shirt with an offensive slogan. [0]
How do we define offensive? Well, nobody really knows. It basically depends on the magistrate or jury you find yourself in front of.
When I discuss cases like this with people, they often say something along the lines of "but how can you defend this person... what they said was racist/homophobic/obscene/insulting to the dead etc". How many times will I have to explain, I'm not defending the person or their opinions, I'm defending the principle of freedom of speech.
Nobody is willing to stand up for a cartoonist who draws creepy pictures, or a football fan with a terrible sense of humour. But really we should all be protesting in the streets over this stuff.
How long before your t-shirt is deemed offensive? Or something you wrote? Or something you drew?
Just like with the cartoons, there is zero evidence of harm caused. Just innocent people persecuted with no justification.
[0] http://www.bbc.co.uk/news/uk-england-hereford-worcester-3674...
I've noticed that people think of speech in the same way as "you should be allowed to say that" or "you shouldn't be allowed to say this" rather than in the way of "you should be allowed to speak" or "you shouldn't be allowed to speak". This kind of "particular" reasoning leads to examining the contents of speech rather than simply the right.
A magistrate who ruled in a case about the cartoons I mentioned mentioned that "society has no need for these materials", or words to that effect. This really proves my point about taking society's use for something over the individual. Most laws usually considered to be unjust we find are related to protecting people from themselves or inadequate consideration for personal liberty.
The only question needing answered is: What is considered real?
Imagine we're 200 years into the future and nothing much has changed with respect to attitudes about sex, freedom of speech, technology, etc. All images available 200 years ago are still there on the internet to download, including illegal child porn. If you are downloading 200+ year old child porn, where everyone depicted is long dead, how could anyone be harmed by you viewing those images? Yet I cannot imagine anyone successfully using that defense if caught with those images.
It's not about who is being harmed by these images (if anyone), it's more about society hating pedophilia and going after it wherever possible, free speech be damned.
I think the argument is that pedophiles view existing media and it encourages them to do things to real people.
The same reason why excessively violent movies are not considered acceptable for children- it's not out of concern for the people in the movies, it's the effect it will have on the person viewing it.
And that may be part of the argument, but I think the official position of the justice department is that each time a child porn image is viewed, additional harm is inflicted upon the victim in the image.
" (8) “child pornography” means any visual depiction, including any photograph, film, video, picture, or computer or computer-generated image or picture, whether made or produced by electronic, mechanical, or other means, of sexually explicit conduct, where— (A) the production of such visual depiction involves the use of a minor engaging in sexually explicit conduct; (B) such visual depiction is a digital image, computer image, or computer-generated image that is, or is indistinguishable from, that of a minor engaging in sexually explicit conduct; or (C) such visual depiction has been created, adapted, or modified to appear that an identifiable minor is engaging in sexually explicit conduct.
...
(11) the term “indistinguishable” used with respect to a depiction, means virtually indistinguishable, in that the depiction is such that an ordinary person viewing the depiction would conclude that the depiction is of an actual minor engaged in sexually explicit conduct. This definition does not apply to depictions that are drawings, cartoons, sculptures, or paintings depicting minors or adults. "
In theory, you could argue that the network was trained on child porn, and as such anything produced by it involved the use of a minor engaging in sexually explicit conduct; but I can't imagine a court actually buying that arguement.
Having said that the segment I quoted is only the definition of child porn. The law prohibiting child porn [0, section c2] provides that:
"It shall be an affirmative defense to a charge of violating paragraph (1), (2), (3)(A), (4), or (5) of subsection (a) that— ...
the alleged child pornography was not produced using any actual minor or minors. No affirmative defense under subsection (c)(2) shall be available in any prosecution that involves child pornography as described in section 2256(8)(C)"
It is worth mentioning the segments of section A that are excluded from this defence:
Section 3B prohibts the advertisement/distribution/solicitation/etc of of material that is claimed to contain (i) "an obscene visual depiction of a minor engaging in sexually explicit conduct; or (ii) a visual depiction of an actual minor engaging in sexually explicit conduct;"
The relevant part of this is (i), where you would need to parse out the definition of "obscene" and "minor". Section 2256 defines minor as "any person under the age of eighteen years", however the courts would probably read it in this context in contrast to the phrase "actual minor". I could not fine the definition of "obscene" or "actual minor". Talk to a lawyer.
Section 6 relates to prohibits providing child porn to a minor.
Section 7 requires a depiction of an identifiable minor.
Moreover in the above quote it seems it could be considered "using" to use the visual identity of a minor.
I'd imagine that meant it you used any reference image of faces for your neural net there's a chance of violating the "letter" of this provision.
This of course if not legal advice.
I just realized the answer to this is pretty obvious, you could have a network trained to classify child pornography and use it to censor the output.
Getting the training set would be an issue, you would probably have to work with law enforcement to do it.
Any that are plausibly adults would presumably be legally in the clear.
> While the ACB claims that there is no blanket ban on small breasts as such, women over the age of 18 with small breasts who might look young ARE banned.
http://www.inquisitr.com/59633/australian-government-censor-...
To generate realistic images, you make two neural networks: one of them (D) takes an image as input and decides whether it's real or whether it's the output of (G). The other (G) takes random noise as input and turns it into an image that will fool the (D) network.
Make them fight until they both get strong, and then use (G) as the final model.
"Ok glass, undress her.".
It is really good at it, though.
They have that, it's called 'Google' :)
I don't understand how Google's algorithm can be misled into finding sexiness in those. I imagine it has something to do with skin tones or flesh colors, but then what about the high-contrast patchwork of green and brown fields Google finds "likely to contain adult content"? That's totally puzzling.
The confusion with medical images is way more understandable. If you squint, you can almost imagine those are pics of skin cancer or lesions.
Oddly enough, I even see violence in the "violent" picture. In an abstract, Rorschach Test sort of way. Well done, Google!
I'm reminded of a paper for which the authors generated different pictures of static that fooled neural network image classifiers into confidently identifying them as different objects: https://arxiv.org/abs/1412.1897
Wired summary: https://www.wired.com/2015/01/simple-pictures-state-art-ai-s...
> Computer vision and human vision are nothing alike. And yet, since it increasingly relies on neural networks that teach themselves to see, we’re not sure precisely how computer vision differs from our own. As Jeff Clune, one of the researchers who conducted the study, puts it, when it comes to AI, “we can get the results without knowing how we’re getting those results.”
There are other SSGs, I use Hugo myself (http://gohugo.io, sample of my blog: http://arianv.com/). I like Hugo cause it's probably the fastest SSG (every time you create a post/change content, you're remaking your entire site from scratch. If you have lots of posts - this adds up!) but Jekyll is the most popular and has great tooling.
Hope that helps!
Moot if it was a work-for-hire, of course; but if I, say, created a Samuel L. Jackson speech model by training on samples from his movies, and sold it as one of those car-navigation voices, could I be sued? By Mr. Jackson? By the copyright-holders of the movies?
And if I could, what does that imply about impersonators, who do the same thing, but with their brains?
This is like saying the hash of the text of a book is derivative. If it were ruled that this is the case (that a hash is a derivative work) then suddenly every single number in existence is a derivative of every single other number (since there will always exist some function that will transform X into Y.)
I imagine we would get some really interesting images back...
I'm guessing the one who had to input the data/images had a fun time at work :p
However, I imagine that's far more difficult to accomplish. How do you detect graphic violence? Looking for blood isn't going to cut it. Also, I can't imagine how you'd separate the fictional from the real - I can watch horror movies with realistic special effects all day, but real violence/mutilation/death bothers me deeply.
But looking at the meager 3 sample images I'm confused about the scoring already. Why is the one in the middle scoring the highest?
The question is an honest one. The two rightmost images seem to be interchangeable to me and are ~boring~: People at the beach. Is this network therefor already trained to include the biases of the creators?
As someone with a broad Norwegian accent: This has gotten massively better over the last few years.
Not that long ago, my local cinema chain started using voice recognition to discriminate between a list of city names, and it would consistently think I said "Birmingham" when I said "London" (!).
These days, both my Amazon Fire and the Youtube app will correctly recognise most things I throw at it, including e.g. names of random Youtube channels that bear no relation to real English words.
It's by no means perfect, but it's getting there. In relation to the "old, white, male" problem (well, I do somewhat fit that), presumably because these systems are now finally trained on huge and varied data sets.
Or you're really into R'lyehian porn.
It's called tentacle hentai...
Cataloging, categorising pornography seized is a nasty job and one that cops across the planet might do better with good common OSS tools.
Hopefully this will help
My second thought: I could probably use this to find porn in unexpected places via a webscraping Python program.
[1] Almost, because porn is SFW when your work involves porn.
For instance, if you read it like this, it still makes sense (I replaced NSFW with pornographic):
Disclaimer: The definition of pornographic is subjective and contextual. This model is a general purpose reference model, which can be used for the preliminary filtering of pornographic images. We do not provide guarantees of accuracy of output, rather we make this available for developers to explore and enhance as an open source project.
e.g.
penis 0.94
vagina 0.01
Is the training set itself large, or are you meaning a... large training set?
(sorry I couldn't help myself)
http://www.hackerfactor.com/blog/index.php?/archives/529-Kin...
It'd be interesting to see a direct comparison of the two. Off the cuff, I'd expect the deep neural network to be more accurate and better at generalizing, but much more expensive to train.
I have been using nude.js to do this ( http://s.codepen.io/icodeforlove/debug/gMrEKV ), which is hit or miss.
Thus, it is meant to be for off the shelf use rather than being able to tinker with the network to produce nuanced results.
Making the data set available and whether you can tinker with or retrain it are very different things.
Took a couple hours to get it all up and running but indeed it works, and not half badly at that!
This is obviously a way cheaper alternative to https://sightengine.com or http://imagevision.com
Kudos to Yahoo for releasing this!
https://yahooeng.tumblr.com/post/151148689421/open-sourcing-...
which contains some technical details. (And furthermore, I guess the HN crowd has enough Internet experience to come up with stupid jokes of their own design.)
[1] https://yahooeng.tumblr.com/post/151148689421/open-sourcing-...