• Articles
  • Tutorials
  • Interview Questions
  • Webinars

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.

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.

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.

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

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.

The command used to install is Pip install opencv-python

Become a Data Science Architect

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.

We hope this tutorial helps you gain knowledge of Machine Learning Course Online. If you are looking to learn Machine Learning Training in a systematic manner with expert guidance and support then you can enroll to our Online Machine Learning Course.

Course Schedule

Name Date Details
Artificial Intelligence Course 14 Dec 2024(Sat-Sun) Weekend Batch View Details
21 Dec 2024(Sat-Sun) Weekend Batch
28 Dec 2024(Sat-Sun) Weekend Batch

About the Author

Principal Data Scientist

Meet Akash, a Principal Data Scientist with expertise in advanced analytics, machine learning, and AI-driven solutions. With a master’s degree from IIT Kanpur, Aakash combines technical knowledge with industry insights to deliver impactful, scalable models for complex business challenges.