• Articles
  • Tutorials
  • Interview Questions

Machine learning & OpenCV

Machine learning & OpenCV Overview

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 basics of OpenCV, GAN.
We need to save the models whenever we run as 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 Master of Artificial Intelligence by going through this online Artificial Intelligence 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 involves training the model, validating and finalizing the model, saving the model and load the saved model for next prediction. This is a recurring process.  We can use either forward or backward propagation to train the model.

Certification in Bigdata Analytics

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 on real time on 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.
Prepare yourself for the Top Artificial Intelligence Interview Questions And Answers Now!

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 stream of bytes to original python object by considering the same hierarchy which we followed previously.

H5 file

It is a data file save in the hierarchical data format (HDF). It contains multidimensional array scientific data. They are most commonly used in Aerospace, Engineering, Finance, Physics etc.

Want to master Machine Learning? Sign up for this Machine Learning Certification course!

Get 100% Hike!

Master Most in Demand Skills Now !

Saving the model pros and cons :

Good Bad
Consistent way to save time and reuse the model everywhere once trained and tested perfectly. Might not work if Sklearn and python versions are different from saving to loading environments.
Predictions can Faster! To do predictions model needs to run again.
Can attain CI/CD (DevOps) with ease. CI/CD nightmare

Learn about types of Machine Learning by enrolling in our ML Certification in Bangalore

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. These are described in more detail on AI and Deep Learning Community.
The command used to install is Pip install opencv-python

Become a Data Science Architect IBM


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.

Check out this Executive M.Tech in Machine Learning by IIT Jammu to enhance your resume!

Course Schedule

Name Date Details
Artificial Intelligence Course 01 Jun 2024(Sat-Sun) Weekend Batch
View Details
Artificial Intelligence Course 08 Jun 2024(Sat-Sun) Weekend Batch
View Details
Artificial Intelligence Course 15 Jun 2024(Sat-Sun) Weekend Batch
View Details

About the Author

Head of Data Engineering & Science

As a head of Data Engineering and Science at Chargebee, Birendra is leading a team of 50+ engineers, specializing in high-scale data and ML platforms. Previously, held key roles at Razorpay and as CTO, with extensive experience in Big Data, ML, and SAAS architecture. Recognized for 85+ contributions to tech publications and patents.