Machine learning & OpenCV

Published by Xander Cage — 09-02-2020 08:09:36 AM


Why save the model?

In this tutorial we are going to see about the machine learning flow from development to release phase, what is the need of saving a model, and the basics of OpenCV, GAN.
We need to save the models whenever we run as a pickle file. Machine learning workflow is these following steps –

  • Understanding Problem statement
  • Gathering the data
  • Data cleaning or pre-processing
  • Divide the data into Train, validation, and Test.
  • Build the model
  • Validate the model & test the model on real data
  • Ensure the Accuracy, True positive and false positive
  • Deploy the model.

Become a Master of Artificial Intelligence by going through this online Artificial Intelligence Online Course.

Eg. Image classifier
The data (training text, document, images, etc.) goes to feature vectors and then processed to the machine learning algorithm. The labels are passed directly to the machine learning algorithm. The typical steps involve training the model, validating and finalizing the model, saving the model, and load the saved model for the next prediction. This is a recurring process.  We can use either forward or backward propagation to train the model.

Why should we save the model?

The classification should be performed in real-time and need to be deployed in the production server. The challenges we might face are –

  • Productions and local environment might not be the same
  • The run-time delay might occur.
  • Classification needs to be done in real-time on the production server.

Next time whenever the image comes, the machine has to identify the same in case it matches the previous model already run in the system. From building a model to release it we must might the flow.

How to save the model?

Pickle file :  Pickling, also known as Serializing is a method of converting any python object into a stream of bytes by considering the hierarchy of the object we are trying to convert. The Unpickling, also known as Marshaling is the reverse process of pickling where we convert a stream of bytes to the original python object by considering the same hierarchy which we followed previously.
H5 file: It is a data file saved in the hierarchical data format (HDF). It contains a multidimensional array of scientific data. They are most commonly used in Aerospace, Engineering, Finance, Physics, etc.

Open CV :
OpenCV(Open Source Computer Vision) is an image processing library created by Intel and maintained by Willow Garage. OpenCV was released under BSD (Berkeley Source Distribution) license-free for both academic and commercial. It includes hundreds of computer vision algorithms. Available for C, C++ & python. Newest update OpenCV 3.4 (Dec 2017). It is easy to use and install.

GAN :
GANs or Generative Adversarial Network is the class of AI algorithm used in unsupervised machine learning. They are used for image enhancement using automated texture synthesis in combination perceptual loss. The components of GAN are –

  • Generator
  • Discriminator

The major applications of GAN is that from the down sampled images i.e. the one with less details, the generators tires to approximate them to more natural detailed version.


About Xander Cage

avatar

This member hasn't told us anything about themselves yet! Encourage them to do so!