In the previous two installments (Part 1, Part 2), I explained the image recognition system that I built to recognise Australian IDs and discussed how a traditional Dynamics CRM can benefit from such intelligent capabilities.

In this post, I will cover the Architecture and share some sample code.

Architecture

dynamics crm image recognition diagram

 

As you can see above, there are basically two major pillars of the system:

  1. Python
  2. CRM ecosystem

Python is used to build the model using TensorFlow. And then the compiled version of the trained model is deployed to an online webservice that should be able to accept binary contents like image data.

On the CRM ecosystem side, a user can upload the image in a web portal or directly from Dynamics CRM based on the scenario. Then we need to pass it to the model and get the score.

Source Code

Below is an excerpt of the source code from one of the unit tests that will give you a glimpse of what happens under the hood on Python side of the fence. This is just one class for introductory purposes, not the entire source code.

 

The purpose of the above stub is to test the prediction class ClassifyAustralianID with a sample image L5.jpg which is below. As we can see it is a driver licence.

heavy vehicle driver licence

 

Running this image against the model gives us this output:

image output in python

 

It means the model says it is 93% sure that the input image matches the Driving License class. In my testing, I found anything above 80% was the correct prediction.

For example, the confidence percentage for the below images was low because they do not belong to one of our classes (Drivers License, Visa or Medicare) which is the expected output.

sample images - image recognition in dynamics crm

Closing Notes

Image recognition is a field of budding research, and it is getting a lot of attention these days because of driverless cars, robots, etc. This little proof of concept gave me a lot of insight into how things work behind the scenes, and it was a great experience to create such a smart system. The world of machine learning is very interesting!!

Hope you enjoyed the series. 🙂