Day-4: ML and Image processing
#MLOps

Day-4: ML and Image processing

Lets Review and Advance,

ML

From an example,

No alt text provided for this image

Computer perspective:

Data Analysis, can be done from the data set with Valid/known data as per requirement of Analysis.

With these data, computer can do Analysis like, finding Avg, count, sum.

But, computer can't predict/Guess the future Data.

Computer is good at Calculations not on prediction.

From above Dataset:

* If we want to find marks of King who studied 7 hrs duration, Computer Can't predict it.

* If we want to find Duration of Queen who got 90 marks, Computer Can't predict it.

Human Perspective:

Human can do data analysis with this Known data.

Also, Human has the ability to Predict/Guess the Future data o/p with Unknown/Valid data.

No alt text provided for this image

From above Dataset:

* If we want to find marks of King who studied 7 hrs duration, Human Can predict it.

* If we want to find Duration of Queen who got 90 marks, Human Can predict it.

Summary:

  • Human has this God Gift(Technically Intelligence) to predict the Future data. It is

called " Human Intelligence ".

  • For machines, to have this intelligence we have to train the machine, this is Called

" Machine Learning ".

Let's dive into M.L:

To make the Machine Intelligent, we have to make the machine to train same as Human though process. As below shown,

No alt text provided for this image

Pre-Requisites, Basics of each Stage:

Data Set:

No alt text provided for this image

for an Requirement, we should know about X and Y variables from Dataset.

We should know the relation between X and Y and this relation is called " Correlation ".

Machine:

In Machine, we should define the mind by creating the Model as per requirement by training it.

The Mind will have multiple number of Model's. One Model for one kind.

Then we should train the model as per requirement.

With python program, we create Model.

Predication:

By model creation and training the mind, we should best fit the relation to Predict/Guess the future results.

M.L has various approaches to Predict the Future result's.

No alt text provided for this image
One of the Continuous Model is Regression Model

for our example, it is Linear regression model as data is Linear in nature.

Supervised Learning:

In this, as we keep on hearing a thing we can visualize that in our Mind it is called Supervised Learning.

It will have Data(" X ") and Label(" Y ") in dataset.

Example:

If we hear a word(calling your name) from our Mom. we can Grasp the person of calling. This is by Supervised learning.

  • Calling your name(myself Gaffoor) is X
  • Mom is Y here

Note:

If We want a work to do by a device we need Program, it can be done by python by writing code.

The specific work can be done by " Function ".

  • Function will be in Module, which is available from Library.

Ex:

While doing Image processing:

imread(Function) from cv2(Modules) from opencv(Library)

* By downloading Library, we can do anything programming.

Libraries are multiple and difficult to download each, so we use Anaconda(Distributor--> Pre-Installed Library)

to see library list, just type ' conda list ' in CMD prompt.

Linear Regression Model:

Example:

Will practice in stage-wise.

(1). Data set Stage:

No alt text provided for this image

(2). Model Training stage:

No alt text provided for this image

(3). Predicting Stage:

No alt text provided for this image





(4). Visualization:

No alt text provided for this image

* We have created a model which Continuous linear model. We can use(saving it) it for future usage by calling. This is called Training on a model.

For saving a model, In Skilearn module we have a function, lets do it and it will be like

No alt text provided for this image

Thus " mymarkmodel.pk1 ", became a Pre-Trained Model.

Image processing

let's continue our journey in Image processing:

Example: Cropping

(1.1) List:

No alt text provided for this image

Same analogy of cropping is used, some imp cases are also included in above pic.

(1.2) Cropping the pic:

No alt text provided for this image

(1.3) Green Remove

No alt text provided for this image

(1.4) Blue Removing

No alt text provided for this image

1.5) Red Removing

No alt text provided for this image

(1.6) Pure Red

No alt text provided for this image

(1.7) Pure Blue

No alt text provided for this image

(1.8) Pure Green

No alt text provided for this image

(1.9) Splitting BGR data from photo be like,

No alt text provided for this image

(1.10) Merging BGR data be like

No alt text provided for this image

(1.11) Let'splay with splitted cells to make our pic to Remove Red color

No alt text provided for this image

Note:

(1). When storing a program in python, we have to be careful in bracing them i.e.,

No alt text provided for this image






(2). Fullform of " uint8 " is

No alt text provided for this image





(3). Basics of merging assignment is done depending in simple python logic. i.e.,

No alt text provided for this image


This is called Multi-Assignment.



(4). += is Uniary Operator

(5). Photos is stored in binary form, when opening an image by imread(in cv2 module), it converts it into numpy array to understand.





To view or add a comment, sign in

More articles by Abdul G.

  • Advance CNN

    In general, Model creation needs a dataset, hardware resource, time, and money. Data collection for a requirement is a…

  • CNN example and Standard Architecture

    CNN Example: Let's apply our previous article analogy and do an example by constructing 2 C.L, 2 P.

  • CNN Architecture

    In the last article, we had found the important features of the image. Let's discuss the convolution process in-depth…

    4 Comments
  • Feature Extraction

    In MNIST dataset, we have images of size 28*28 b/w (0-9), even without Feature extraction, we can predict the output…

  • Convolutional Neural Network(CNN)

    If we have a dataset with a limited no. of Rows and Columns, we use Traditional M.

  • Multi-Classification Model

    In N.N, we know info.

  • Activation Function and Deep Learning example

    Activation Function: Let's discuss Activation function, where, when, and how it is used. For this example, We can do…

  • Deep Neural Networks

    The brain has lots of Neurons, data from the outside world makes brian to learn, and brain gest experience, the output…

  • Interactive Graph

    If we want to analyze, features selection, or finding the correlation or visual model of the mind for the future of…

  • Day-2

    In this article, Let's discuss a Use case followed in back old days. Use Case: Let's take a client ABC requires a…

Others also viewed

Explore content categories