php 如何阻止上传裸照?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2365313/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 06:11:55  来源:igfitidea点击:

How to block uploads of nude images?

phpweb-servicesimageweb-applicationsimage-processing

提问by sakthipriyabalaji

I need a provision of detecting the adult image in the websites where the user uploads the pictures to determine that a picture isn't acceptable for my site. Can any one suggest the method to do this?

我需要在用户上传图片的网站中检测成人图片,以确定我的网站不接受图片。任何人都可以建议这样做的方法吗?

I need kind of open source code/program (PHP) that could be implemented in the website and stops the user to upload the picture. Earlier to the my idea there is a class image filter http://www.phpclasses.org/browse/package/3269.htmlBut I want code which is similar to this or maybe even more advanced.

我需要一种可以在网站中实现并阻止用户上传图片的开源代码/程序(PHP)。在我的想法之前,有一个类图像过滤器http://www.phpclasses.org/browse/package/3269.html但我想要与此类似或更高级的代码。

回答by Pekka

Sorry mate, I think the bottom line here is you aren't going to get around manual checking. There are approaches, but none really reliable and with a lot of false positives.

抱歉,伙计,我认为这里的底线是您不会绕过手动检查。有一些方法,但没有一个真正可靠,并且有很多误报。

Check out this question: What is the best way to programatically detect porn images?for inspiration.

看看这个问题:以编程方式检测图片的最佳方法是什么?灵感。

If you ask me though, it's a waste of time to look for an automated solution. Given half an hour's time, I can find you twenty images that would trigger a "nude" alarm even though perfectly innocent, and the same the other way around. Also, nudity is not going to be the only thing you do not want on your site.

不过,如果你问我,寻找自动化解决方案是在浪费时间。给你半小时的时间,我可以找到二十张即使完全无辜也会触发“裸体”警报的图像,反之亦然。此外,裸体不会是您网站上唯一不想要的东西。

Better spend the time on a system that makes it reallyeasy to manually verify the content users upload to your site, e.g. as a Desktop widget, on the mobile phone, or whatever suits you best.

最好将时间花在一个系统上,它可以让手动验证用户上传到您的站点的内容变得非常容易,例如作为桌面小部件、移动电话或任何最适合您的内容。

回答by Robusto

The only way I know to do this is to have uploads moderated. Images go into a moderation queue and are then "passed" or "rejected" by a human being.

我知道要做到这一点的唯一方法是对上传进行审核。图像进入审核队列,然后被人类“通过”或“拒绝”。

回答by NebuSoft

Just an idea. Could maybe come up with a solution that utilizes Tin Eyeto see where the image is found. Then pair those results with a website filtering program. If it finds them to be pornographic sites it could give you some level of filtering.

只是一个想法。也许可以想出一个解决方案,利用Tin Eye来查看图像的位置。然后将这些结果与网站过滤程序配对。如果它发现它们是网站,它可以为您提供某种程度的过滤。

回答by mcpeterson

I agree with Pekka's comments about automation. That's a rather difficult problem that is not quite solved yet.

我同意 Pekka 关于自动化的评论。这是一个相当困难的问题,还没有完全解决。

Have you thought about http://crowdsifter.com/or doloreslabs? They can crowdsource a moderated queue for you, or check your existing images on the cheap. If its a business website that might be the trick.

你有没有想过http://crowdsifter.com/或 doloreslabs?他们可以为您众包一个经过审核的队列,或者以便宜的价格检查您现有的图像。如果它是一个商业网站,那可能是诀窍。

Note: I am not affiliated with dolores labs.

注意:我不隶属于多洛雷斯实验室。

回答by kanarifugl

This works more or less, with a few complications to think about.

这或多或少有效,需要考虑一些复杂情况。

  • Don't automatically delete images if a picture get flagged
  • 如果图片被标记,不要自动删除图片

The script does not detect nudity itself, but colors that are likely to be in a pornographic picture.

该脚本不会检测裸体本身,而是检测可能出现在图片中的颜色。

I would send flagged pictures that the script detects as "pornographic" in a moderation queue and then choose what to do or not to do. Simple as that. Keep in mind that pictures of babies and similar definitely will get flagged from time to time.

我会在审核队列中发送脚本检测为“”的标记图片,然后选择做什么或不做什么。就那么简单。请记住,婴儿和类似的照片肯定会不时被标记。

https://github.com/FreebieStock/PHP-Image-Pornographic-Content-Detection

https://github.com/FreebieStock/PHP-Image-Pornographic-Content-Detection

回答by Fra Vilsoni

回答by t0mm13b

This is a generic principle regardless of what language/technique. The best way to combat this is to allow the human to check! In short, there would be a lot of work involved, for instance, how can you tell if the image is nude or child pornography by examining the pixels - it cannot be done as there would be a level of sophistication involved, like, there is a trial at the moment in my country for mobile operators to automatically block images being sent across in order to clamp down on pornography, just don't ask me how - but apparently reports of it are successful, I just would not trust whatever algorithm they have used as it may/could generate false positives!

无论使用何种语言/技术,这都是一个通用原则。解决这个问题的最好方法是让人类检查!简而言之,这将涉及很多工作,例如,您如何通过检查像素来判断图像是裸体还是儿童 - 这是无法完成的,因为涉及到一定程度的复杂性,例如,目前在我国进行的一项试验是让移动运营商自动阻止发送的图像以打击内容,只是不要问我如何 - 但显然有报道称它是成功的,我只是不相信他们的任何算法已使用,因为它可能/可能会产生误报!

This is quite a similar thing to the usage of Captcha, to block spammers, only the human would have to enter a magic word(s) or number(s) in such way that the analysis of the image will deduce what the image will contain thereby stopping the flow of spammers.

这与 Captcha 的使用非常相似,为了阻止垃圾邮件发送者,只有人类必须以这样的方式输入魔法词或数字,以便对图像的分析将推断出图像将包含的内容从而阻止垃圾邮件发送者的流动。

In your case, perhaps, prevent the upload of images, nahh, that's a bit too restricted, do what this site is doing - moderating. You need to moderate the images first (perhaps a queue or a safe holding directory to store the images) and decide if they are suitable or not.

在你的情况下,也许,阻止图像的上传,不,这有点太受限制了,做这个网站正在做的事情 -审核。您需要首先审核图像(可能是一个队列或一个安全的保存目录来存储图像)并决定它们是否合适。

If not, depending on the seriousness of the image - this could involve contacting the ISP and the local law enforcements (this is where the grey area happens - how would you know and not over-react?)....

如果没有,取决于图像的严重性——这可能涉及联系 ISP 和当地执法部门(这是灰色区域发生的地方——你怎么知道而不是反应过度?)。...

It would pay to be wise, prudent and just alert the authorities in that case, if it's pornographic nature, inform the ISP, pass the buck onto them, and let them in turn decide the best course of action OR inform a local authority website that reports this kind of thing...like in my country, we have a link to the hotline web-sitewhere people can anonymously post an email to the site and inform that they have encountered a pornographic image...

在这种情况下,明智、谨慎并且只是提醒当局是值得的,如果它是性质的,请通知 ISP,将责任推给他们,然后让他们决定最佳行动方案或通知地方当局网站报告这种事情......就像在我的国家,我们有一个热线网站的链接,人们可以匿名向该网站发送电子邮件并告知他们遇到了图片......

I am not a lawyer...but IIRC, and this is where the matter can stink up, you can view them, but to download them is illegal...again I have to post this disclaimer - I am not a lawyer, you need to check first....this is what I mean by where the grey area happens...

我不是律师......但是 IIRC,这就是问题所在,你可以查看它们,但下载它们是非法的......我必须再次发布此免责声明 - 我不是律师,你需要先检查......这就是我所说的灰色区域发生的地方......

So in a nutshell, no one is above a computer, and there is a more smarter entity than a computer itself, i.e. a human moderator can only check and ascertain first prior to viewing the image...

所以简而言之,没有人能凌驾于计算机之上,并且存在比计算机本身更智能的实体,即人类版主只能在查看图像之前先进行检查和确定......

回答by firedrawndagger

Might wanna check this out, this is a J/S file. Problem is that it only runs on the latest browsers - Firefox 3.6+, Chrome, Safari, Opera and Internet Explorer 9.

可能想看看这个,这是一个 J/S 文件。问题是它只能在最新的浏览器上运行——Firefox 3.6+、Chrome、Safari、Opera 和 Internet Explorer 9。

http://nerd5.com/web-development/detect-nudity-using-javascript-nude-js.html

http://nerd5.com/web-development/detect-nudity-using-javascript-nude-js.html

回答by SysAdmin

All current methods involve the skin color detection. this is never accurate and not even close to advanced.

目前所有的方法都涉及肤色检测。这永远不会准确,甚至不接近高级。

If at all something advanced exist, that could be used to stop child pornography.

如果存在先进的东西,那可以用来阻止儿童。

回答by MrTraffic

At Free Vectorswe are also interested in this topic. Thus, we have just implemented and shared a PHP Nudity Detectionclass on Github based on J. Marcial-Basilio et al. (2011) algorithm, that tries to detect nudity by counting skin color count.

Free Vectors,我们也对这个话题感兴趣。因此,我们刚刚基于 J. Marcial-Basilio 等人在 Github 上实现并共享了一个PHP 裸体检测类。(2011) 算法,试图通过计算肤色计数来检测裸体。

Thank you @Dejanfor pointing us to the original research paper.

感谢@Dejan为我们指出原始研究论文。