How to filter out pornographic images using MATLAB?
6 views (last 30 days)
Show older comments
Shadi Ayyad
on 22 Dec 2015
Commented: Jos (10584)
on 22 Jun 2016
Hi everybody, I am trying to find a MATLAB code that is given a directory path containing a number of images, and in turn it filters out or wipe out porn images.
for example, if there are 50 images in a directory and 10 of these images contains non-ethical porn images, then the program deletes or wipe out these 10 images from the given directory.
Could any body help me ? Thanks in advance.
1 Comment
John D'Errico
on 22 Dec 2015
Edited: John D'Errico
on 22 Dec 2015
Good luck. If the supreme court was unwilling to even define the concept, except to know it when they saw it, getting a computer algorithm to be successful will be tough. And since what might qualify as such for you, might not for me, I wish you luck. However, I don't expect to see this be easy to do.
Worse, I'll bet I could take virtually any image with a person in it, and by carefully cropping it if I know your algorithm, make it appear as if it did or did not belong in the selected set. For example, take a picture of a face. Out of context, is it just a picture from some glossy magazine cover? Or let me give you some pictures from a nationally known sports magazine. How would they be interpreted by your algorithm? I'll bet I could take 10 random people and get 10 different answers on that classification.
As an example, long ago in my job we once created a digital collage of human body parts. The goal was to have ONE picture that had MANY different variations of flesh tones in it, as a test for our color management algorithms. Random arms and legs, faces, all at various angles, cropped from images we had at our disposal. But the funny fact is, the image might have looked fairly suggestive to some people.
Accepted Answer
Image Analyst
on 22 Dec 2015
There have been a number of papers written on pornography detection. See this link. Sorry, I have not read any of them and can't help you with them.
More Answers (4)
Walter Roberson
on 22 Dec 2015
Edited: Walter Roberson
on 21 Jun 2016
"pornography" is almost always a matter of intent rather than actual content.
- pictures of infant breastfeeding are not pornographic even if they show naked breasts
- in some provinces in Canada and some parts of the USA, it is completely legal for women to be topless in public provided they are not engaged in a sexualized display
- pictures of mastectomy scars are not pornographic
- In 2011, a transgender woman was arrested for indecent exposure in Tennessee for taking off her shirt in a Department of Motor Vehicles parking lot, in protest after DMV refused to change the gender on her driver's license. It is legal in Tennessee for males to go shirtless in public so if she was indeed considered legally male then she could not have been committing indecent exposure in that way, but if she was legally female then the department could not have refused to change her registration. Transwomen often encounter this kind of legal double standard, and if arrested for female-only offenses will often be held in male jails.
- pictures of women in underwear are often considered pornographic, but not pictures of women in bathing suits that cover even less
- paintings of naked people typically become considered "art" if the paintings were made long enough ago, but not if they were made recently
- at least according to popular lore, in Victorian society, ankles were considered erotic and had to be covered up, even "ankles" on tables, but it was not considered offensive for breasts to be showing
- the Janet Jackson "wardrobe malfunction" was considered offensive exposure, but reporting on female wardrobe (or lack thereof) at award shows or fashion shows is not considered to be that way
- the decades of daily publication of the topless Page 3 Girls especially in the UK -- was that decades of pornography in a national newspaper or did the decades of "normalization" make it non-pornographic or was it never pornographic or ... ?
- some of my female acquaintances find that their pictures are reported as being pornographic even though they are wearing as much in the way of clothes as pictures of other women. The difference is that the ones being reported are of larger women: what is socially considered acceptable and even encouraged for thin women is frequently not considered acceptable for larger women
- in Canadian law, if a woman who is 17 years and 364 days old takes a topless selfie electronically, then that is considered "child pornography" and she can be arrested for doing so -- but as of the next day, her 18th birthday, it is no offense at all. Furthermore if she had taken the selfie using a Polaroid Instamatic camera or other analog medium, the relevant laws would be subtly different in ways that would be relevant to her being charged: the computerization brings with it a presumption of "distribution" that analog media does not. You might be able to program in some age estimation routines, but you certainly are not going to be able to get to single day accuracy.
7 Comments
Walter Roberson
on 2 Mar 2016
The MATLAB icon is pornographic in some situations. Those temporary tattoos ended up in some naughty places.
Jos (10584)
on 2 Mar 2016
- Create a script that post the image automatically to Facebook
- Wait for a few days
- Try to retrieve the image from Facebook
- If that fails, the image is suggestive according to at least one criterium.
3 Comments
Walter Roberson
on 21 Jun 2016
FB is notorious for being inconsistent on what is acceptable. They tend to take down innocent images if there are enough reports; for example recently a very simple "Queers Against Islamophobia" text-as-image resulted in a 24 hour posting ban, but posts that say that LGBT people should be violently murdered are often left up for years "because Free Speech".
Jos (10584)
on 22 Jun 2016
This is very sad indeed, Walter. FB is not an innocent player in these matters :(
Jan
on 2 Mar 2016
- Create a script that post the image automatically to your web page
- Wait for a few days
- Count the number of downloads
- > 100: Pornographic
Seriously: Shadi, it is impossible to create such a filter. This is not a problem of Matlab, but of the human nature. There is even not a strict and clear definition of "pornographic", in consequence it is impossible for a computer to decide this.
What is the actual problem, you want to get solved?
6 Comments
Walter Roberson
on 2 Mar 2016
There are lots of subjective answers to the question, but it is difficult to program subjectives. You probably want an objective answer. For that you need to define "nude".
Stephen23
on 2 Mar 2016
Edited: Stephen23
on 4 Mar 2016
"briefly, is there a scientific subjective answer for my problem?"
No, because this is a question of social norms, which change between cultures (and even subcultures), between locations, and over time. The Romans ran races naked: was that pornography or sport?
Bjorn Gustavsson
on 2 Mar 2016
Instead of continuing the discussion on a principal level I suggest that you try this fex-submission that might give you a hands-on experience in the difficulties of separating real-world images of this and that, and what problems you'll run into in your special-interest case:
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!