CNN example and Standard Architecture
#MLOps.org

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.L, 1 Flatten layer, and 2 dense o/p layer's with 32 filters in each C.L and P.L

No alt text provided for this image

I am taking an example(Example of using .flow_from_directory(directory):) from Keras (https://keras.io/api/preprocessing/image/) of image data processing: For this example am taking cat or dog test image for prediction.

No alt text provided for this image
No alt text provided for this image

As Keras accepts only 4D data, I transferred my 3D data into 4D.

The CNN dataset given has 2 folders test and train sets with 8000 samples(cat and dog) for the train set and 2000(cat and dog) samples for the test set.

As Keras internally use, Pillow module for image processing, we should install it.



Standard Nets:

Normally Convolution layer with activation function and pooling layer is done for feature extraction is called CRP layer(convolution, Relu, and pooling). pooling is also called sub-sampling. No. of CRP and FCL layers defines the accuracy of the CNN model. By this we have many models available, we are discussing LeNet and AlexNet as these are building blocks for many upcoming and past models.

LeNet:

CNN architecture was found in 1988 by Yann LeCun is called LeNet. This is a base network architecture for N.N. This LeNet has 2 CRP layers and 2 fully connected layers

No alt text provided for this image

Reference: https://medium.com/@pechyonkin/key-deep-learning-architectures-lenet-5-6fc3c59e6f4

I am taking MNIST dataset as an example for LeNet architecture explanation,

No alt text provided for this image

The test accuracy for the MNIST dataset for LeNet is 99.14%, such an accurate architecture.

AlexNet:

After 5 years of Lenet, Alex Krizhevsky is a computer scientist most noted for his work on artificial neural networks and deep learning. Shortly after having won the ImageNet challenge 2012 through AlexNet. AlexNet contained eight layers; the first five were CRP layers, and the last three were fully connected layers.

No alt text provided for this image

Reference: https://towardsdatascience.com/alexnet-the-architecture-that-challenged-cnns-e406d5297951.

I am taking the CIFAR-10 dataset as an example for AlexNet Explanation, the CIFAR-10 dataset is used for object detection.

No alt text provided for this image

In CRP layers, we use R--> Relu as an activation function(A.F) for better results, if our requirement changes we can vary the A.F.

Day-27:

On Day-27: A task for MLOps was explained and some intro next-day article was given, ie.,

If wan can observe the LeNet and Alexnet models CRP Layers are increased for Better accuracy. But the Con here is resource handling, if we have many CRP layers then we need more CPU/Memory and Time. For example in Day-26, i.e, in the above example of LeNet,

No alt text provided for this image

we can clearly observe that for a single Epoch, we need approx, 12hrs for model training for my Laptop(low configured one).

To avoid, this we have some Advance CNN models where some data scientists built a model on some categories and made available for the market.

Note: I will add the task in the upcoming article by completing it.

要查看或添加评论,请登录

Abdul G.的更多文章

  • Advance CNN

    Advance CNN

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

  • CNN Architecture

    CNN Architecture

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

    4 条评论
  • Feature Extraction

    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)

    Convolutional Neural Network(CNN)

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

  • Multi-Classification Model

    Multi-Classification Model

    In N.N, we know info.

  • Activation Function and Deep Learning example

    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

    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

    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

    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.

    Binary Classification cont.

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

社区洞察

其他会员也浏览了