ylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css">

Project


Animal recognization is designed to help people to find thanks to AI the name of an animal. It will automatically identify animals. This project is dedicated to nature lovers as well as to the novice. For example, if you are in forest or in an animal safari you can easily find the name of animals who are near to you. Basically, you will update from your computer a photo and the AI will tell you the name of the animal.

But how does it work ?

To build the AI, we will use a JavaScript machine learning library called ML5 which is extremely easy to use and comes preloaded with several image classifier models like MobileNet, DarkNet, and DoodleNet. Specificly, we will use the imageClassifer() function.

How to code it


Create a new glitch project.
First of all, you need to make reference to the library in the head of your index.html file :

Now, you need to create a .js file.
We will use the MobileNet image classification model which has been “trained on a database of approximately 15 million images” as we can found in ml5 documentation. In your .js file, you will add the following code:

Next, we simply use the classify function on classifier, as the name suggests, to classify the image with the following code:
The classify function give an array of objects with a confidence between 0 and 1. To simplify, we will take the first result.


Now, we will add the following code in your index.html in order to upload the image:


Finally, we will add the handleUpload(files) function to replace image.src by the image that we upload.


Let's test it

Animal recognization