Follow Slashdot stories on Twitter


Forgot your password?

Detecting Nudity With AI and OpenCV 172

mikejuk writes: AI gets put to some strange tasks. Not satisfied with the Turing test or inventing Skynet, Algorithmia have put together a nudity detector. Take one face detector from OpenCV and use it to find a nose. Take the skin color from the nose and then see what parts of the body are skin colored in the photo. If there is lot of skin color shout NUDE! Actually, the website lets you put in your own photos and classifies them into Rude or Good and gives you a confidence estimate. Obama with his top off — no problem but the familiar image processing test photo of Lena the pin up girl rates a 'Rude'.
This discussion has been archived. No new comments can be posted.

Detecting Nudity With AI and OpenCV

Comments Filter:
  • by theNetImp ( 190602 ) on Sunday June 28, 2015 @02:57PM (#50007463)

    I googled "porn" grabbed one of the top 10 image URLs Entered it.... and got PG. #FAIL@SCIENCE

    • You mean your experience is failed science? I agree. Picking a single picture to test such a system is a scientific fraud. I tested with many pictures and it works pretty well.
      • by Anonymous Coward on Sunday June 28, 2015 @04:25PM (#50007771)

        anyone using such technology would require an extremely low false negative score... but too many false positives can make the system unusable. one of my last projects at undergraduate university was pretty much the exact same "nudity confidence" test as this project... my project "worked pretty well" also, but was equally unusable. i dialed all the parameters for a week until i got the best results on a giant dataset (millions of images)... one of the sources of images was every image from the university website (over 10,000 images just from that). so, after the tweaking, false negatives were low, but still 5% of negatives were wrong. i don't remember exact numbers, but i think of the positives, 10-15% of those were wrong. i didn't use any libraries or facial recognition, but i imagine that would help a lot... one problem is obviously if the face isn't in the picture. my technique was using a wide range of skin tones and then looking for "blobs" of similarly toned pixels and looking for shapes or shapes in shapes... (nipples on breasts were a pretty solid indicator and easy to scan for... also detecting a crotch region with dark hair... obviously a fat man in a hair-toned thong would trigger alarms)

        so, after all of this, many variables are weighted to give a single "confidence" score... so i decided to run the test a final time before the presentation the next day (it took many hours to run)... i built lots of top lists, one of them was overall confidence of nudity... the #1 picture most confident of containing a nude body ended up being the faculty office picture of one of the lecturers in the computer science department, who would be attending the talk. the office walls were a skin tone, and the way the light came in the window and lined up with her head, and round shaped things on her desk reflecting the skin tones, triggered every single test i had built. out of millions of pictures... too funny. good closer for the presentation.

      • by Alef ( 605149 )

        Picking a single picture to test such a system is a scientific fraud.

        It depends on what you want to prove. If the claim is that the system is useful for automatic rating of images (not sure anybody claimed this, but they do give pictures ratings on their website), then one would expect a false negative rate of [fairly tiny number], which a single randomly picked data point to the contrary gives quite a significant evidence against.

        Not saying it doesn't work "pretty well" in a sort of cool tech sense, though.

      • I tested 50 pictures just now and found it extremely shitty with a VERY high false negative score. Near nudity, toplessness that is still not nudity was claimed nudity. Any position where the legs are in front of the body (like hugging knees) will come through as nude even if they are fully clothed, shoes are not counted as clothing, so it has a VERY high false positive rate. If one of the fascist bastard places like Facebook or Instagram were to use it they would end up punishing a lot of people who didn't
  • by Mr D from 63 ( 3395377 ) on Sunday June 28, 2015 @03:03PM (#50007479)

    Take the skin color from the nose..

    That ain't a nose!

  • by penguinoid ( 724646 ) on Sunday June 28, 2015 @03:04PM (#50007485) Homepage Journal

    Oh, well. It's no skin off my nose.

  • by Anonymous Coward

    My women-who-paint-their-noses-blue fetish will remain undetected!

    • by Anonymous Coward

      My women-who-paint-their-noses-blue fetish will remain undetected!

      Score: -1 Missed Opportunity For Clown Porn Joke

    • by Z80a ( 971949 )

      To not mention all the pony/furry porn.

      • To not mention all the pony/furry porn.

        I told you to not mention all the pony/furry porn!

        Copyright Spike Milligan.

  • Nude == Rude? (Score:5, Insightful)

    by dskoll ( 99328 ) on Sunday June 28, 2015 @03:09PM (#50007507) Homepage

    Why does "Nude" equate to "Rude"? Oh right, I forgot... we're afraid of our bodies and spooked by healthy sexuality.

    • Re:Nude == Rude? (Score:5, Insightful)

      by bill_mcgonigle ( 4333 ) * on Sunday June 28, 2015 @03:18PM (#50007547) Homepage Journal

      Why does "Nude" equate to "Rude"? Oh right, I forgot... we're afraid of our bodies and spooked by healthy sexuality.

      Puritanism is the State Religion.

      • Puritanism is the State Religion.

        Mostly in the United States, and non-European countries. Germany seems pretty healthy. Maybe some Scandinavian nations as well.

    • Because Puritans (Score:4, Insightful)

      by waspleg ( 316038 ) on Sunday June 28, 2015 @03:53PM (#50007645) Journal

      and other assorted imported religious insanity.

      • Yes this is incredibly insightful. It's banal at best, foolish at worst. But modern man made himself and life has no meaning.

    • Nude equals rude only for a prude.
  • Someone I know was tasked with catching people at work watching porn. So.. they screen grabbed everyone occasionally and checked manually. That got tedious so an algorithm was scripted to scan the photos for slightly darker circles within larger circles (breasts).... the person that wrote that code no longer has a job there because they just run the program and don't need to manually check X.x

    It doesn't have to catch every concurrence of course.. just enough to flag culprits with few false positives. Also,
  • by wonkey_monkey ( 2592601 ) on Sunday June 28, 2015 @03:11PM (#50007517) Homepage

    Take one face detector from OpenCV and use it to find a nose. Take the skin color from the nose and then see what parts of the body are skin colored in the photo. If there is lot of skin color shout NUDE!

    And if I give it a photo of a nose?

    • by dskoll ( 99328 )

      Well that would be a nude nose. Think of the children!

      And don't do something disgusting like blowing your nose either. Eeewww.

  • by Anonymous Coward

    Just a reminder, we are all born naked. Stop making so much trouble!

    Cheers from Germany.

  • by Anonymous Coward

    Classifying nudes as rudes is so prude that it is horribly rude. Despising the more or less beautiful bodies of others before they have starting to decompose is unhealthy.

  • misplaced research? (Score:2, Interesting)

    by Anonymous Coward

    It used to be that homosexuality was offensive. Now the tables have turned and being anti-gay is offensive. Can we expect the same thing to happen with nudity? In a few decades, all this research into detecting nudity will seem awfully misplaced, the same as if people now were discussing AI to flag images with two men kissing.

    • by dskoll ( 99328 )

      I don't think this will happen quickly with nudity, and we have religion (for the most part) to thank/blame for this.

      Michelangelo painted plenty of nudes, but the Catholic Church did a literal cover-up []. *sigh*

    • Offensive is an ambiguous term, but if you mean the man on man sex has become normal, you are kidding yourself. It's perception has not normalized because it isn't normal and never will be. The most ardent pc leftists will descend on a homo-sexual with insults more vile than you can imagine if sufficiently provoked. It's only that pseudo popular opinion in the west is increasingly driven by elites who can afford to have outlooks with little grounding in reality, because if you are Tom Cruise it really doesn

  • by kevmeister ( 979231 ) on Sunday June 28, 2015 @03:44PM (#50007631) Homepage

    Having worked in image processing and having made extensive use of the "standard" USC images including Lenna, I can assure you that the Lenna image was cropped at the shoulder. The Wikipedia article shows the image as encoded as an uncompressed 512x512 image.

    USC errored in the image name, naming it "Lenna" when the model was correctly identified in the Playboy issue as "Lena Soderberg".

    • by ledow ( 319597 )

      The cropped image, maybe, but the original shot it came from, certainly not.

      • by kevmeister ( 979231 ) on Sunday June 28, 2015 @06:08PM (#50008157) Homepage

        Exactly! People are conflating the original from Playboy (which I had) and the USC scan used by every facility in the world that was working on image processing... especially color processing. The famed image was only head and the top of the shoulder from the full centerfold.

        The other images included "Drop" and "Baboon" as well as some I no longer remember. "Drop" was a glass of milk just after a drop had landed dead center, raising a drop of splash. Baboon was also mis-named. It was a male mandrill. Red nose and blue cheeks. It was the one we used most frequently.

  • by pubwvj ( 1045960 ) on Sunday June 28, 2015 @03:57PM (#50007659)

    But what is this "Nude" you speak of?

    Sex based: guy in a bottoms only swim suit vs a topless woman?

    Country based: French nude beach vs USA prudes?

    Era based: Someone from the 1920's looking at a 2015 bikini?

    Age based: Young child (often completely nude in some countries is okay) vs post puberty (often requires hiding genitals and nipples on females in some countries)?

    Religious based: Whoa! Some religions are very conservative and others require nude dancing around the May pole...

    Seasonal: Have you ever tried being nude in a northern Vermont or Siberian winter!?! Don't even think about showing the tip of your nose!

    • Victorian: Check out the ankles on her!!
  • by Jeremi ( 14640 ) on Sunday June 28, 2015 @03:58PM (#50007667) Homepage

    Take the skin color from the nose and then see what parts of the body are skin colored in the photo. If there is lot of skin color shout NUDE!

    So my collection of clown porn is still safely undetectable?

  • Can't help but notice the headline "AI finding nudity" aligned with the one below it, about AI's getting Testy...


  • Rude ? (Score:5, Insightful)

    by aepervius ( 535155 ) on Sunday June 28, 2015 @04:15PM (#50007731)
    I understand classifying as nude or safe, or whatnot, but rude ? Since when is nudity rude ?
    • When the nude subject is holding up the middle finger. That would seem rude. Not that middle finger. The one in the middle of each hand.
  • This was what OpenCV was originally created for, wasn't it? To crawl the net so geeks don't have to.
  • by MouseTheLuckyDog ( 2752443 ) on Sunday June 28, 2015 @04:26PM (#50007777)

    Looking for too much skin color is a bad way to test for nudes.
    You don't get to nudity untill you start seeing colors that are not the skin color.

  • by killfixx ( 148785 ) * on Sunday June 28, 2015 @04:29PM (#50007795) Journal

    FTFA, "ascetically pleasing"... hehehe

    I don't think that word means what you think it means. :)

    ascetic: A person who renounces material comforts and leads a life of austere self-discipline, especially as an act of religious devotion.

    Although, I guess nudity would be the highest form asceticism...


  • by JavaBear ( 9872 )

    I tried an image of Karen Gillan in a bikini, and it got rated R Nude.

    Then I tried one of Lily Cole, a full frontal nude. Detected as G - Not nude.

  • How about purple porn?
  • But doesn't work with photos of sheep before and after shearing. Both are not nude according to the site.
  • Excellent (Score:5, Funny)

    by cfalcon ( 779563 ) on Sunday June 28, 2015 @04:47PM (#50007883)

    I'm glad that AI has learned to spot tits. I'm sure this will only be used for moral purposes, like enforcing our ban on nipples that are on a chick (biological or trans), or a dude who has chick breasts (as in to win a bet). Everyone knows that nipples rot the minds of children, which in why they cannot speak until after weaning. It's science!

    It is my fondest hope that our robot overlords appreciate a nice rack. That will make the slaving in the rare earth mines a little more tolerable, at least.

  • I thought porn was what it was built for. I mean besides an advertising platform for Google.
  • by Anonymous Coward

    Now they've got computer to take away our skin pics. Pretty soon we'll be back to flashlights under a blanket!

  • From what I'm trying, men in wifebeaters and women in chainmail
  • by Darinbob ( 1142669 ) on Sunday June 28, 2015 @08:02PM (#50008559)

    If there's one thing I'd rather do myself than to delegate to an AI, it would be nude detection.

  • ... throws it off completely. Hot babe in b&w photo, full nudal frontity, is rated G.

  • Just the other day, facebook shut down the account of a swedish art museum for posting images by Anders Zorn, an early 1900's artist (wikipedia's description []: "Zorn was a prolific artist. He became an international success as one of the most acclaimed portrait painters of his era. His sitters included three American Presidents, nobility, the Swedish king and queen and numerous members of high society."). You can scroll down a bit on the wikipedia page to see examples of images that were considered so "rude"

  • the most effective way to do this would be to crowdsource it. :)

  • So when can we expect the first beta version of Windows Puritanity version 0.9?

Did you hear that two rabbits escaped from the zoo and so far they have only recaptured 116 of them?