Custom Vision - A Service to Create your own Images Classifiers and Deploy it

Custom Vision is a Microsoft Service that can create a custom computer vision model based on a specific images set. This website is therefore built to help people train and deploy image classifiers for their specific needs.

What is really interesting here, is that it very simple to use ! This service works in 3 steps : upload the data-set, train the model and deploy it. Here is a little “How To” :  give it a try !

1. Upload images & Tag them

First step is to get as many images as you can in order to create a good data-set. Also, you need to determine one or multiple “tags” for each one of your images. For this example, I download some photos of dotted and leopard clothes from another Microsoft tutorial. You can then download them using this script (from the same tutorial) with Python 3.

Be aware that you must have at least 30 images by tag in order for the model to be effective. But it is not the only prerequisite : The quality of your data-set is also a very important setting. Depending on the quality and the variety of your images, your final model can be very efficient – or not !

Once you have all your data, you can create a new project. Connect you to the Custom Vision web page and click on New Project (Note : you need a Microsoft Account to sign in). Choose the more useful domain for your need. If you followed my example with clothes, choose General. Select also Classification for the project type.

 image

Once the project is created, you can upload your images by clicking on Add Images. I suggest you to upload your images by tag in order to save time. But anyway, you can change tags later on every image (Note : Follow the instructions - the website is really intuitive !).

When all you images are downloaded, you should see all of you data classified by tags.

Capture

2. Train

To train the classifier, use the Train green button (top right of the page). The training may take a little while depending on the amount of data you provided. After the training, you can now see the performance of your model :

Capture

Note : for those interested, those estimations was obtained through a k-fold cross validation (a data scientist trick). Also Precision and Recall are common metric in this field.

If you need, you can add more data and train again your model.

Also you can click on Quick Test (next to the Train button) to select you own custom image and submit it to the model. For instance, here my model give me the tag “dotted” when I expected “leopard”.

image

3. Deploy…

And that’s it ! When you find a correct model for your need, you can download it and deploy it as a REST Api Service !

On the Performance panel, click on the Export button. You can use multiple platform.



For our example, choose the DockerFile format (Note : this format is really useful in order to work with other Microsoft Services). You can now run the docker file as usual :

docker build -t
docker run -p 127.0.0.1:80:80 -d

When your docker is running, you can access the api with curl. For instance, post an image and get Json response from the model API (Note : take a look at the Readme.md of the project you just download ! Winking smile).

Enjoy !

My First Developers Meeting as a Speaker :

Since I start my last project (Distributed AI in IoT Devices), I have to admit that I learn a lot of new things in very different fields : Artificial Intelligence, Mathematic Modelling, Project Architecture, Craftsmanship, IoT, ... This project also gives me the opportunity to experiment a lot : new language, new tools, new methods.

With that kind of experience, I soon got in touch with an association of developers : Microsoft User Group of Lyon (MUG Lyon). Thus, they submitted me to a new challenge : present my project as feedback of my experiences in front of other developers. After some thoughts, I decided to meet this challenge and to deliver my project through a very specific approach : “Are Craftsmanship Good Practices Achievable in an AI and IoT Project ?”.

Why did I say yes ?

This was a great opportunity for me to conciliate the two things I love the most in my work : Artificial Intelligence and Craftsmanship best practices.

When I start my double degree in AI, a lot of people told me that engineering and scientific are two very separate fields that are not mixable. I believe they are wrong since I did it in my current project. Indeed I currently use all of my skills (from all of my oldest experiences) to achieve this project. And I am very proud of that.

There is no reason to reject good practices just because a project involve complex mathematic calculations. Also, It allows the code to be more easily accessible from any developers : no need to be an expert in mathematics.

Last but not least, this was a great opportunity to improve my social skills and my communication capacities. I worked hard on this presentation to present this project as simply as possible, and to produce an accessible speech for anyone. Those kinds of skills are very useful to develop, and I am happy to have tested them on a real professional context.

IMG_1326

Thanks the MUG for this great opportunity !

The meetup event :
https://www.meetup.com/fr-FR/MUGLyon/events/250854003/



Improve the Configuration of Docker Compose with Environment Variables

I recently started working on a new python project (yeah!). This project is really interesting, but the first lines of code are at least a d...