Giter VIP home page Giter VIP logo

Comments (15)

fushatech avatar fushatech commented on August 24, 2024 1

Excellent thoughts. I think the issue with existing models, like Google Vision or WebPurify is that their definition of permissible/awrah is different from ours. For example, these APIs would most likely mark an image of a woman wearing a knee high skirt as "safe" whereas for us, that is still impermissible to see.

That's why I think we would need to build our model since nothing meets Shariah standards. But like you said, it makes a lot more sense to build off existing models than to start from scratch. I am thinking as a next step, instead of having every image blurred, we can blur every image with human skin (male or female) by building off existing models that detect skin. And then, after that, look to see if we can train the model to learn Shariah definitions of awrah as well as other things that are impermissible (alcohol, drugs, gambling, etc).

from tahir.

alganzory avatar alganzory commented on August 24, 2024 1

Asalamu'alaykum guys @Wulf @fushatech @amine123ait, I know it's been ages, but I recently had the idea to build an extension that blurs out Haram content, I didn't know about Tahir at the time but I started building the project anyway, my idea was to use face detection to generalize the detection and definition of impermissible content, so basically blur out any picture that has a (insert gender here) face.

I have already published the project HumanBlur and the extension is currently pending review on the chrome web store, but I really need a lot of help with it as I am new to chrome extensions and not super knowledgeable with AI and ML.
My idea kinda works, it works on images and videos too, but obviously, the accuracy could use a lot of improvement, bodies are not detected, so unless the face is detected and the gender is identified, the image goes undetected. To resolve this I am probably going to add nudity/partial nudity models on top of the face detection and I think that should give decent results, but as I said, I am new to this so its taking me some time to figure it out.
Oh and I don't like the current name but I decided to go for something more "inclusive" to not get hate lol.

I am letting you know about this so perhaps you can help contribute to it maybe since you guys were looking to do or at least use something similar, Jazakum Allahu Khairan.

from tahir.

man2machine avatar man2machine commented on August 24, 2024 1

Assalamu alaikum

@alganzory this looks great! May Allah (swt) reward you. If you need help with things related to AI/ML I am can do that in shaa Allah since I am experienced in that area. But I don't have much experience in the webdev area.

from tahir.

fushatech avatar fushatech commented on August 24, 2024 1

@alganzory Walaikum as salam wa rahmatullah brother - this is amazing work, ta barak Allah, may Allah accept it from you and make it heavy on your scales on Yawm al Qiyama. Great job!

from tahir.

Wulf avatar Wulf commented on August 24, 2024

Asalamu'alaykum, hope things are well.

I'm interested in solving this problem, and will gladly lend a hand. Here's a relatively old article on content moderation APIs available: (make sure Tahir is turned on) https://towardsdatascience.com/comparison-of-the-best-nsfw-image-moderation-apis-2018-84be8da65303.

Yeah it could be slow/expensive running this for every image, but that whitelist #9 feature might make it more feasible. I've always imagined something like Tahir being used as a community tool to mark images and train its own model.

from tahir.

fushatech avatar fushatech commented on August 24, 2024

Walaikum as salam Haris!

Jazak Allah Khair for your help! If you think you can tackle this, please go for it! I was talking to another brother who was saying that TensorFlow JS may be a possible way to train a model to detect human skin. There is a commercial API that apparently detects nudity / partial nudity (https://www.webpurify.com/). Perhaps we can build something Shariah-compliant and open source.

from tahir.

Wulf avatar Wulf commented on August 24, 2024

Wa-iyakum :)
Webpurify looks like a pretty cool solution! So to sum up the ideas so far:

Challenges

  • (1) Accuracy of existing APIs might not be the greatest.
  • (2) Accuracy of a custom model might not be the greatest. Training it is another issue altogether.
  • (3) Using a commercial API will cost money.
  • (4) Browser performance cost of analyzing each image.

Let me know if there's something I missed. Based on this, I think the most feasible solution is to have the user input an API key for a service like Google's Vision API and have the extension scan images one-by-one, unblurring them after they are analyzed. That way, processing has a low performance overhead, costs of the API are proxied to the user, and having some analysis is always better than none. The results can be cached so they're unblurred automatically next time they're loaded in.

Regarding building our own model -- I don't think it's worth the effort to start from scratch. Perhaps starting with Yahoo's open-source analyzer or the tensorflow-equivalent should be used. Then trusted users can continuously train the model? I'm not sure, I think this approach has too many things that need to be thought of, for example, the nature of the data itself is a problem. But the cool thing about this approach is the ability of extension users to help in the process of training the model.

I'd love to hear your thoughts.

from tahir.

Wulf avatar Wulf commented on August 24, 2024

I think we can fine tune this model. It's possible to use it with tensorflowjs.

from tahir.

Wulf avatar Wulf commented on August 24, 2024

Also, I think it'll be helpful to have the same references to the fiqh definitions of awrah for every school of thought.

from tahir.

Wulf avatar Wulf commented on August 24, 2024

Asalamu'alaykum brother, hope things are well. Wow, two months went by so fast.

Just a small update: I got around to using the standard mobilenet classifier in the browser via tensorflow js. It works pretty well and is fast enough for an application like this alhamdulillah. The next step was to convert the keras model above but the tensorflowjs_converter tool wasn't capable of converting one of the layers. I think it was a lambda layer or something? Anyway, I'll get around to that in the coming months insha'Allah.

from tahir.

amine123ait avatar amine123ait commented on August 24, 2024

any updates :)

from tahir.

Wulf avatar Wulf commented on August 24, 2024

Darn, it's been a while~

The main motivation for my work on this was for a sideproject. Unfortunately, lots of things have piled up and I've put automatic image analysis on the back burner. There's lots of things to consider with this issue and it's no easy feat :-)

from tahir.

Wulf avatar Wulf commented on August 24, 2024

Wa'alaykum asalaam @alganzory :)

That's a cool way to tackle the problem! Don't let the accuracy get you down -- just iterate slowly. What I've learnt over the past few years is that end users just want something that sorta works :)

Please let us know when the extension is on the store. Also, if you have the time, could I request a Firefox version?

May Allah bless you bro! 🤗

from tahir.

alganzory avatar alganzory commented on August 24, 2024

Wa'alaykum asalaam @alganzory :)

That's a cool way to tackle the problem! Don't let the accuracy get you down -- just iterate slowly. What I've learnt over the past few years is that end users just want something that sorta works :)

Please let us know when the extension is on the store. Also, if you have the time, could I request a Firefox version?

May Allah bless you bro! 🤗

Thanks for the tips bro, I am working on integrating a nudity filter right now and also trying to develop the firefox version, but it's already published Alhamdullilah :) HumanBlur in Chrome Store

May Allah bless you too brother.

from tahir.

jcellswo avatar jcellswo commented on August 24, 2024

The chrome extension is awesome, especially in its ability to work on videos. I'm wondering if there's a way to tailor this project to be more focused on filtering out nudity than faces alone, but I realize after reading this that a solution of that nature may be too resource-heavy. Has anyone discovered a way to filter out nudity only in a tool similar to the HaramBlur chrome extension?

from tahir.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.