We develop an Android app that allows people to upload pictures to Wikimedia Commons.
PROBLEM: Often some funny fellows upload their own selfies, rather than pictures with educational value.

So, I would like the Android app to recognize whether a picture is a selfie or not.


  • 100% pure Java library
  • Compatible with GNU-GPLv3
  • Less than 1MB

A library that uses facial recognition and gives the position/size of faces in the picture is also OK, I would consider the image a selfie if any face takes more than 10% of the image's area.

  • Is this a good idea? I can imagine pictures of public figures being useful, plus you need some sort of moderation in place other than just "not-selfie". – Camilo Martin Feb 25 '16 at 4:33
  • @CamiloMartin: I simplified because it is not really the point of the question, but you are right, it is only a kind of warning/flagging, and it does not prevent users from uploading. – Nicolas Raoul Feb 25 '16 at 6:02
  • Using machine learning I developed some Tensorflow/Keras code that can tell whether a picture is a selfie or not with 85% accuracy: github.com/nicolas-raoul/selfie-or-not Next it needs 1) More data samples to improve reliability 2) To be made into a Java library of acceptable size. – Nicolas Raoul Oct 3 '18 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.