Hacker News new | past | comments | ask | show | jobs | submit login
Miles Deep – Open Source Porn Video Classifier/Editor with Deep Learning (github.com/ryanjay0)
276 points by rightsForRobots on Nov 14, 2016 | hide | past | favorite | 96 comments



I have often wondered how purveyors of this "type of content" might be using machine learning (classification etc). I think this project gives us a good hint of that.

I would also echo the sentiment of others in this post: This could be used for a lot of other things. An example that comes to mind: The auto-tagging / classification of athletic or sports footage. Athletic organizations spend A TON of money[0] on annotating / tagging team sports related video for things like statistics, aggregating individual players performance within a match, etc.

[0] - http://www.hudl.com/elite/sportscode


Good point. The project mentions this work which did experiments on sports: http://cs.stanford.edu/people/karpathy/deepvideo/


I remember seeing a few years ago when Carnegie Mellon ran the entire series of Star Trek through facial recognition. They were able to tag every instance of each character on screen.

http://gizmodo.com/5228470/carnegie-mellon-demos-the-power-o...


Damn, I worked at a porn company before and we had people sitting there watching porn all day doing nothing but entering in tags. Now if only it could identify the pornstars in it as well.

I imagine the tube sites would use this as well as bookmarks / cue points in the videos. Some of them already do that but I'm sure it was manual before.

How easy would this be to adapt to photos? Does the model need a lot of surrounding video frames?


I think thats doable. I'll be adding an autotag mode. I've been thinking about other attributes I can detect from race, to hair color, to number of participants.

Crowd sourcing is good except it can't tag new videos no one's seen yet.


Did you have any problems looking for a job after (assuming you no longer work for a porn company)? Do you have this company's name written down in your cv?

I'm really curious as I've heard you can smash your career in film industry by doing porn.


I haven't had any issues. I have them on my resume but they don't sound very adult oriented. Most of them have innocent sounding names that yield no search results. When they do, you can't tell much more than they do e-commerce.

I do however say that my photography work has publications in Playboy, Maxim, FHM, etc. I added that deliberately to filter out companies that would have issue with it. Didn't want to work at companies like that.

I did have one company express concern during an interview, but my response was basically "What does it matter what I do in my personal time if I'm not bringing it to work". They seemed fine with that explanation and ended up hiring me.

I don't have any of my production side work on my resume. I know people more involved on that side, particularly female pornstars have more issue finding work after that but they usually are not pursuing jobs where there is way more demand than supply like in programming.

I can't speak to the film industry.



A lot of the stars are surprisingly hard to identify by face, but the rise of tattoos should make the job much easier.


A couple of sites have beta-quality facial recognition to identify models (imagefap comes to mind). Once you have that it's just a question of getting a database to match the model to a name.


Why not crowdsource the tagging?


In the data I've scraped in my own nsfw programming work there's a great deal of bad tags with content out there. xvideos is a great example of crowdsourcing that has horrible error rates.


Yes even within a particular video there are lots of frames where the act is implied not directly shown, like a close-up of others faces. Karpathy et al. showed they could still learn from the sports video database even with random crowd shots or announcer shots not being removed.

I think the quality for the data influences the result and hand crafting the dataset is what lead to 95% accuracy on new instances.


Very interested to chat. Where can I DM you?


Sometimes I wonder if humans have hard wired deep neural nets that recognize parts of the male and female anatomy, and are tied into dopamine release, nitric oxide, hormone release etc and that's basically all there is to sexual attraction. Kind of weird to think that we could in fact be that simple? Makeup, lipstick, nice clothes are just there to foil those neural nets into recognizing favorable secondary sexual characteristics.

Manipulating these neural networks in our brain would be the perfect strategy for an evil AI to take over the world... :/


I remember reading about an experiment done on birds (in one of Richard Dawkins's books, I think).

They put together a highly exaggerated model of a baby bird, with a huge, red mouth. They found that the parents feeding the bird would preferentially drop worms into the fake baby's mouth. The bigger and redder it was, the more they would favour the fake baby, even to the point of starving their real offspring.

Sometimes I think we're really not much more sophisticated than the birds.


Of course we're not. One word: Wonderbra.


It's called super-stimuli. I was taught this in highschool biology? (age 16 or so, that's high school in the US right? I always mix it up)

First the example of the seagulls[0], but immediately after that, the teacher showed us a Betty Boop / Jessica Rabbit -like comic book character, clearly demonstrating that, no of course it's not just birds. One thing I remember, for some images (depending on posture, mainly) you actually needed to use a ruler and work out the proportions because at first glance there was nothing wrong with them.

And yes, the advertising industry has of course been abusing this behavioural exploit since ever, to the point that I'm pretty sure there's a couple of EU laws against the most egregious types (though partially covered under false advertising of course).

[0] which is about a red dot the parents have on their beaks, and the offspring would peck at it to get food. except they preferred what was (iirc) basically a large flat yellow wooden plank with a larger red dot on it. are you sure you have the story right? (could be a different experiment, though) also, while the baby birds would prefer the non-feeding wooden plank, I kind of doubt they carried on the experiment to starvation.


I think Tim Minchin expressed it quite eloquently in his song "Confessions (Feminism, Altruism, Environment)": https://www.youtube.com/watch?v=wmnxF_WTOgg


> Sometimes I wonder if humans have hard wired deep neural nets that recognize parts of the male and female anatomy [...]

As a teen I tried to figure out exactly what it is about breasts that's so great. I ended up coming to the conclusion that it's just a hardwired hack... Somewhere in my head there's the equivalent of

    if (object.type == boobs) object.value = 100; // HACK!
> Manipulating these neural networks in our brain would be the perfect strategy for an evil AI to take over the world... :/

Sex sells. Most of advertising has been based on it forever.


I personally did a lot of classification of my personal preferences when I was younger also.

When I saw a model that I felt an attraction to, I would study her features until I could say, "Her eyebrows" or "Her lips" were what I found attractive. After years of this, I knew what my ideal idol would look like.

Its funny, now that I am married happily, that my wife doesn't look anything like that idol. I value her love, companionship, loyalty, and other traits of behaviour, more that her appearance.


After a lot of pondering, I figured out that my ideal was an average of all the women I'd ever cared about (in any context), weighted by total emotion I'd felt for them.


Of course we have such neural nets. Measurements of arousal and eye tracking show clearly that people from both sexes react to these stimuli even if they pretend not to.


> Manipulating these neural networks in our brain would be the perfect strategy for an evil AI to take over the world... :/

Replace "evil AI" by "advertising network", and your premise is still true.


What makes you think advertising networks aren't Evil AIs running on a distributed mesh of wetware hosts?


Maybe I'm being pedantic in interpreting the semantic of what you wrote, but the fact that a certain feature is recognized as sexually attractive and produces a release of hormones does not imply that there is any special physical wiring between your neurons allowing it.

Actually, we are at the point of the research where we are still asking whether we can understand basic facts about the brain by its physical wiring (e.g. we have a complete map of C. Elegans neural network of 302 neurons but can't simulate it).

By the way there is no need for a special physical wiring in order to have innate preferences, but I don't know whether there are some or not. I heard somewhere that breasts evolved as they are now to resemble the shape of a butt, which our ancestors found attractive probably even before the time of the Homo Sapiens. We also know that in different part of the world there are different features that are considered attractive (I'm thinking about beauty standards in remote tribes), so it might also simply be a social construct.


Which is exactly the plot of Ex Machina right? And also why I think that film is so much more believable than it's contemporaneous AI-themed sibling, Her.


The whole “Cogito Ergo Murder” trope isn't very realistic at all, and Ex Machina if anything seems to be very subtle in this regard: Ava might be just a goal-maximising algorithm with a very broad toolbox, Kyoko (insofar as she transcends her programmed limits and deeply surprises her creator) might be the “True AI” in the show.


Like https://open_nsfw.gitlab.io?

I don't feel like the results are very attractive, but they're obviously recognizable.


> Manipulating these neural networks in our brain would be the perfect strategy for an evil AI to take over the world... :/

I think it would just be easier for the AI to kill the humans. What benefit can they serve?


Well imagine if it got everyone stuck in some sort of delayed gratification treadmill that lasted their whole lives without any benefit to them. Just endless suffering with a carefully crafted and personalized vision of future eternal bliss for the promise of obedience. The few remaining humans being kept around for biodiversity purposes being subject to this.


Honestly can't tell if you are describing a futuristic dystopia or current mass consumerism focused society :)


yikes, this could be a critique of consumer culture.


More like many religions.


Good luck with that evil AI seducing the religious puritans, the non-sexual, and the level-headed people who have been making the same criticisms of advertising since the 1920s.


I don't think it's possible to come up with a better name for this project.


"Broad Classifier"?


you sir, are a genius


I was thinking "Deep Love" or "2Deep4Me"...


Balls Deep?


The name is already a play on that.


[flagged]


I think your username is even better.


Finally, machine learning is being used for something beneficial to society


In the name of reproducible scientific results, is the training database available somewhere?


The photos aren't available but the trained model is. It's a set of weights.


Run it backwards in inception mode? I wonder if it could generate porn, or what Gigeresque horrors would come out if somebody tried.


Image Synthesis from Yahoo's open_nsfw (https://news.ycombinator.com/item?id=12756462)


I actually tried that. It's not as interesting as you'd think. Perhaps having an 'other' category makes it more difficult.

It's trivial to drop the model into the deepdream ipython notebook they provide: https://github.com/google/deepdream/blob/master/dream.ipynb


Tried again. Better: http://i.imgur.com/ALoLmcX.jpg


Seriously, though, synthesis using a recognition model can be a good reality check to remind us of the shortcomings of the model's "understanding" of the domain.


It looks like it's the 22MB file in the model folder.

https://github.com/ryanjay0/miles-deep/tree/master/model


This is just the resulting network weights. While useful, I believe this alone wouldn't let someone reproduce the experiment as easily as having the dataset.


I don't have the rights to the dataset, so unfortunately I won't be releasing it.


You should be able to scrape 30k+ labeled images relatively easily


How do you imagine going about this?


in the case of porn, there is a zillion sites of images with labeled categories. Web scrape those


Related: open_nsfw [0] (code for running Model and code for Not Suitable for Work (NSFW) classification using deep neural network Caffe models).

[0] https://github.com/yahoo/open_nsfw


I think there are people at law enforcement who have to watch explicit material to classify child-porn. Couldn't his be useful for them to automate not having to look at child-porn?


That's really scary


It's kind of cool but also kind of messed up that this is the starting point of porn J.A.R.V.I.S.

Porn Jarvis, show me something with a blonde woman between the ages of 30 and 45 featuring oral and anal.


Isn't this what people ask Bing?


Bing presumably doesn't have access to one's downloaded library of erotica.


Fun project. Wondering how the contributors classified their training set... by watching all the videos? :)

In any case I know there aren't many good labeled datasets out there. I worked on Sightengine (API to detect nudity and moderate images or videos: https://sightengine.com )


To what extent is this solution specialized towards porn? E.g., can I use the same software with a different dataset to tell dogs from cats?


Good question. There's an example specifically using caffenet to find cats. Any caffe model can be dropped in without recompiling.


A sample video would be nice showing live weights for each frame.


This is the best I got. You'll have to imagine what the video was:

https://github.com/ryanjay0/miles-deep/raw/master/images/pre...


someone is about to make a lot of money.


PornHub Network's video segmentation system might already be automated in this way.


I actually was thinking about that too, but automated analysis of video at that scale seems prohibitively expensive unless you are Google or Netflix or something. Serving tons of video through a CDN is one thing, but the compute requirements needed to analyze it all are another.

Not that I have thought too terribly deeply about this, but I have a suspicion that this feature is actually powered by additional metadata sent along with the video by the content provider. It seems logical that if you were to control a vast archive of rapidly growing, extremely similar looking content, you would want to tag just about everything you could about it so you could build product.

I predict there will shortly be some dark future for all of us where we'll be able to don our Facebook nightmare helmets, say a single word, and have a super focused stream of filth blasted directly into our brains like that one scene from Demolition Man. That's where this is all going, right? Gotta be.


This program can classify 1 hour of video in 36 seconds on my low end GTX 960 4GB.


and for PornHub's back catalog, this still take longer than the heat death of the universe


not really. 1 hour of video in 36 seconds it 1,000 hours of video / hour of computation. Assuming you go with a cluster of higher end graphics cards, you could pretty easily perform 100x better. That's 100,000 hours of video processed / hour of computation. I don't know the size of the pornhub back catalog, and I'm scared to search since I'm at work right now, but even if it's hundreds of millions of hours you could go through the whole thing in like 2 months tops.


Isn't 1 hour video in 36 seconds a 100x speedup instead of 1000? Agreed that it's definitely doable if they want.


Would not want to be on the test team for this project that's for sure.


we need to make sure this code never ends up in a robot, I can imagine a very perverted robot.


Everything about this is troubling. The fixation on pornography, the reduction of any given erotic stimulus to the instantiation of a sex act, the mechanization and rationalization of sexuality at every level. Absolutely pathological.


Humans are a walking pile of barely coherent pathological behaviors, and even that is sometimes such a stretch, that in a hypothetical scenario where a star faring, faster than light alien intelligence is observing us, I'm deeply ashamed for humanity. If anything, there is not enough fixation on pornography, instead of too much fixation.


how do you figure, dude


Yeah, well, that's just, like, your opinion, man.


Most of the GP's post was opinion, but one part was an object claim: "Absolutely pathological."

So there is something to debate with him, if you're so inclined.


It's really quite sad that someone with this much skill is spending this much time on a project like this.


Rather this than more human time wasted on targeting ads


The obvious application for this is targeted ads (the porn industry is a mass of crosslinked affiliate marketing)


Actually, I think that's unfair. I saw how little comments there were and thought, everyone is keeping quiet. Why? The context? Why should the context really matter, when it's the technology that is intriguing?


If you take the time to read about the project it might actually have some really good applications like parenting tools


The classes are: > blowjob_handjob > cunnilingus > other > sex_back > sex_front > titfuck

I don't think this particular classifier would be very useful in a parenting tool - or perhaps my style of parenting is old-fashioned


This program can also be viewed as a general framework for classifying video with a Caffe model, using batching and threading in C++. By replacing the weights, model definition, and mean file it can immediately be used to edit videos with other classes without recompiling


Pornography has to be one of the most ideal contexts for developing our understanding of neural networks and deep learning. I think this was and is a great idea, not just in that context, but in the anthropological one as well. If one is going to program a thinking algorithm, it should think like a human, and pornography is ideal for that. The approach is original and innovative.


The fact that this is apparently more nuanced than Yahoo's NSFW model (and open source at that) means it would certainly have applications in porn censorship, if that's your stance on the issue.


Censorship is a concern quite outside of classification, though.


While they are obviously different, automatic censorship would require automatic classification.


To play devil's advocate, there may be applications of this that are not prurient.


But prurient is the whole point!

https://www.youtube.com/watch?v=iaHDBL7dVgs


The sad part is that you think it is ok to shame people and that you somehow hold the moral high ground to make such judgement


At the risk of introducing unbounded recursion, it seems like you're trying to shame the GP.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: