I'm currently working on an ios/android app and I was wanting to know what the easiest/most efficient way to use image recognition inside of the app. What I am specifically looking for is a way to recognize different animal species from a picture. I had considered having a database which the pictures to be compared to.
Ideally you'd want a pre-trained classifier that you could just plug in, but I'm unfortunately not aware of one for Java. If you wanted to build one yourself, it'll probably be a bit tricky. The general outline would be:
-Assemble a large training set of tagged pictures. In other words, have a bunch (tens of thousands, if not more) of pictures of the animals you want to be able to classify, and have a label for each picture saying what type of animal it is. If I were going to try to assemble such a set, I'd probably look at the APIs for things like Flickr, Imgur, Google Image search, etc. and see if one allows an easy way to download a bunch of images that have been tagged with a particular term. If you're not sure what the set of species you care about is, you might try using Wikipedia's API to harvest a list of common species.
-Use a machine learning library to train a classifier from your dataset. I've used Weka (http://www.cs.waikato.ac.nz/ml/weka/) before, but not for images. You might also look at DL4J (http://deeplearning4j.org/convolutionalnets.html), but I haven't used that one. Depending on what sort of classifiers your ML library supports, you may have to transform your training set from images to feature vectors. In other words, for each image, pull out a set of numerical features. Look up "feature extraction", there may be existing libraries to do this.
-Once you've trained a classifier, you'll want to be able to save the trained weights, and reload them in your app. Presumably your ML library will support this, but you probably want to make sure ahead of time. This way, when a user wants to classify an image, the app doesn't have to consult your dataset - that would take forever, because the dataset is huge. Instead, you just load up your trained classifier and ask it what it sees.
I'm not sure exactly what the state of the art on species classification is, but I'm going to guess it's not great. Be prepared for the possibility that you can't get high enough accuracy to suit your needs.
-Assemble a large training set of tagged pictures. In other words, have a bunch (tens of thousands, if not more) of pictures of the animals you want to be able to classify, and have a label for each picture saying what type of animal it is. If I were going to try to assemble such a set, I'd probably look at the APIs for things like Flickr, Imgur, Google Image search, etc. and see if one allows an easy way to download a bunch of images that have been tagged with a particular term. If you're not sure what the set of species you care about is, you might try using Wikipedia's API to harvest a list of common species.
-Use a machine learning library to train a classifier from your dataset. I've used Weka (http://www.cs.waikato.ac.nz/ml/weka/) before, but not for images. You might also look at DL4J (http://deeplearning4j.org/convolutionalnets.html), but I haven't used that one. Depending on what sort of classifiers your ML library supports, you may have to transform your training set from images to feature vectors. In other words, for each image, pull out a set of numerical features. Look up "feature extraction", there may be existing libraries to do this.
-Once you've trained a classifier, you'll want to be able to save the trained weights, and reload them in your app. Presumably your ML library will support this, but you probably want to make sure ahead of time. This way, when a user wants to classify an image, the app doesn't have to consult your dataset - that would take forever, because the dataset is huge. Instead, you just load up your trained classifier and ask it what it sees.
I'm not sure exactly what the state of the art on species classification is, but I'm going to guess it's not great. Be prepared for the possibility that you can't get high enough accuracy to suit your needs.