Feature Extraction
#MLOp.org

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.

In the real world, the data will be 2k, 4k video; 1024*1024 images, and much more high-resolution videos and images. In such cases, every pixel information is important. If an image is 1024*1024 size, it will have 10+ million features, these are a huge number and required a high amount of computational capacity. We have to minimize these many features by feature Elimination, which is followed in N.N. Feature elimination should be in such a way, that we don't lose any important information from the observation. Even though we might lose important feature information as shown below,

No alt text provided for this image

In the process of Feature elimination, my observation lost its important feature(his ear gone).

So before future elimination, we should do Feature extraction to overcome this type of challenge. this technique is called Convolution.


In general, Human eyes used Convolution in preserving any important information like below,

No alt text provided for this image

if we have pic A in the scenery, human convolutes(preserves) the pic B. Huan eye will take every granular information in any scenery which is imp. The human mind has this intelligence to filter important information.

Human uses Edge detection for detecting anything


No alt text provided for this image

Initially, we were taking every pixel of an image as a feature, like the boxes in the below image.





No alt text provided for this image

In Feature Extraction, we get the information, combine them, and use it as a Feature. In this pic, we combined some features(correlated features) of the nose, lips, eye, and ear as X1, X2, X3, AND X4 features. By this, we don't lose any imp. info and we can eliminate the necessary features.

Conclusion:

No alt text provided for this image

For feature extraction in getting correlation features we use Convolution, these correlated boxes(all features in box) are given to N.N to eliminate the unnecessary features(boxes), this is how CNN works.



A feature defined in the Convolution is the group of individual features, that makes one important feature. Those individual features are correlated to each other for an imp. feature of the observation.

A human eye can detect the object by color variance, data type, and lots of constraints. The computer also uses the same technique of color variance for detection, such a process is called Edge detection.

No alt text provided for this image

Humans use the above process of object detection in finding imp features, where these are RGB variance in flow, we detect there is an object between.

Computer used Convolution to detect objects

Compter also uses the same way in detecting an object by a filter/kernel/feature detector. Arranging boxes in total image. Box size depends on the feature of the image.

  • If the box size is small, our features/Granular content increases.
  • If the box size is huge, we might miss some imp content.

Typically the box Size is 3 * 3.

https://en.wikipedia.org/wiki/Kernel_(image_processing)

No alt text provided for this image

let's make some boxes for the pic,

In the above, we selected some of the features A - E; Here, we find some challenges about this process of detection.

In E, there is a drop of RGB, and the computer can find/detect the object. same in D and C.

In A, B features, there is no RBG variance and our N.N may delete these features. Without these A and B, image data is not complete. So to avoid this kind of Challenge, we arrange boxes in a jumping manner with values, this value or jumping is called Stride. Shown above pic with box jumping and boxes are 1, 2, and 3. By this stride, we won't lose any imp. feature of the image. Standard stride values are 1 or 2.

Convolution uses this Stride and Edge detection concept in feature extraction, but this is not an exact convolution.

[ Note: From this article, I will use google Colab in place of jupyter, as both are the same. Google collab is easy to use, share, and text between the commands]

Let's understand the Exact meaning of convolution with an example;

1D array dataset: Click the link

for 1d array example, an analogy also used in the example.

2D array dataset:

Click the link

for a 2D array example, an analogy also explained.

Summary:

In both example's we made edge detection by convolving the base image or dataset with a random variable of 1d or 2d array to define the place of object detection place.

This random variable is called Kernel or filter or feature detector.

By this the convolution we get imp feature from the image as shown below

No alt text provided for this image

we still have feature elimination for an image, will discuss that in the next article.

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
  • 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…

  • Binary Classification cont.

    In the last article, We have selected features for model creation. Before model creation from the dataset, we can…

Explore content categories