• Subject Code : EE535
  • Subject Name : Engineering

Introduction

Using a Convolutional Neural Network (i.e. CNN) Model for Binary Classification. In the field of machine learning, binary classification is frequently utilised. It's the quickest and easiest technique to sort input into either of the two classes. Apple-like characteristics could include colour, weight, etc. A binary classification is an approach to supervised learning in machine learning that divides new data points into two groups. The following are some examples of binary classification, where each observation can be placed in one of two categories (represented by the 0 and 1 columns): Application (Altinsoy et al., 2022).

CNN mode;l

Figure 1: CNN model

A Convolutional Neural Network (i.e. CNN) is the type of neural network that takes an image as input and then uses weights and biases to distinguish between similar images. In order to train a neural network, a large number of photos are used, each of which has been labelled to indicate its true nature (cat or dog in this case). The number of photographs in a batch can range from tens to hundreds (Hussain et al., 2020). The network's prediction is compared towards the existing label for each image in the batch, as well as the distance between the two is calculated. The prediction capability of the network is then improved by adjusting the network parameters to reduce the distance. Every new batch undergoes the same training procedure.

The primary objective of this task is to build a system capable of recognising pictures of dogs and cats. Analysis of the input picture will be followed by a prediction of the result. The model which is used can be adapted to work on an internet site or a mobile device (Santoso et al., 2021). Kaggle provides access to the Dogs vs. Cats dataset, which may be downloaded there. Images of both cats and dogs are included in the dataset. Our primary goal is for the representation to acquire knowledge of a variety of cat and dog-specific characteristics. Once the training is complete, the model can tell the difference between a cat and a dog.

Methodology

CNN processes images with the aid of filters, which are weight matrices. They can identify simple characteristics such as straight or curved lines. High-level features are recognised by the filters at each successive layer.

To begin, we initialise with CNN, we are utilising the Adam optimizer to compile the CNN. Adaptive moment estimation (Adam) is a technique for calculating parameter-specific learning rates (Noh et al., 2021). We are evaluating the accuracy of our predictions by comparing the class outcome to each of the anticipated probabilities, a process known as the loss function. The total deviation from the norm is then used to determine the penalty score.

The term "image augmentation" refers to a process whereby the same source image is modified in many ways. The photographs have been shifted, rotated, and flipped, so they are all unique in some way. To improve our pictures, we're employing the Keras ImageDataGenerator class.

For the purposes of training the network, we require a method for converting our photos into memory-based arrays of data. This is a perfect use for ImageDataGenerator. So, we bring in this class and create a new generator instance. Keras' flow_from_directory method on the ImageDataGenerator class is being used to read images from the disc.

dataset

Figure 2: testing and training dataset

  1. Convolution

Convolution refers to a linear procedure in which weights are multiplied by the input. An input data array is multiplied by a weighted filter or kernel array of the same dimension. Input data is always larger than the filter, therefore the dot product of the two arrays is calculated.

  1. Activation

In order to aid ANN in learning intricate data patterns, an activation function is introduced. The activation function's primary role is to make the neural network non-linear.

  1. Pooling

The pooling operation introduces spatial variation, allowing the system to identify objects with a wide range of visual characteristics. One way to summarise features in a feature map is to apply a 2D filter to each channel of the map.

Therefore, pooling aids in decreasing the total amount of network parameters and computations. It regulates overfitting by gradually shrinking the network's spatial size. In this layer, we have both average pooling as well as maximum pooling procedures. Here, we employ max-pooling, which, true to its name, extracts the entire amount from a given pool. To do this, filters will iteratively glide through the input, eliminating the maximum parameter and discarding the remainder.

Unlike the convolution layer, the pooling layer doesn't change the network's depth.

  1. Fully connected

The input of the completely linked layer is the flattened output of the last Pooling layer. This is how the Full Connection procedure actually works: The fully connected layer's neurons pick up on a feature, remember its worth, and pass that information along to the dog and cat classes, which investigate the feature and determine whether or not it is significant to them.

accuracy

Figure 3: Model Accuracy

model loss

Figure 4: Model Loss

prediction

Figure 5: Result of prediction

Conclusion

Our accuracy on the training set is seen to be 0.8115. It uses the model to make predictions about new images by calling the predict image function and passing it the path to the new image as the image path. Unless the odds are less than 0.5, the picture will depict a dog.

To put the model to the test on our own photographs and see if it holds up.

The code is easily extensible into a web-based or mobile-based application, and we can immediately incorporate it into our ongoing work.

Finding an appropriate dataset, modifying the dataset, and training the model to include the new entity is all we need to do to expand the project. We obtain a high-level understanding of how picture classification works. The project's reach can be broadened to include other sectors where automation is feasible by adapting the dataset to address the relevant challenge at hand.

References

Altinsoy, E., Yang, J. and Tu, E., 2022. Improved denoising of G-banding chromosome images using cascaded CNN and binary classification network. The Visual Computer38(6), pp.2139-2152.

Hussain, E., Hasan, M., Hassan, S.Z., Azmi, T.H., Rahman, M.A. and Parvez, M.Z., 2020, November. Deep learning-based binary classification for alzheimer’s disease detection using brain mri images. In 2020 15th IEEE Conference on Industrial Electronics and Applications (ICIEA) (pp. 1115-1120). IEEE.

Noh, E., Yi, S. and Hong, S., 2021. Binary classification of bolts with anti-loosening coating using transfer learning-based CNN. Journal of the Korea Academia-Industrial Cooperation Society22(2), pp.651-658.

Santoso, L.W., Singh, B., Rajest, S.S., Regin, R. and Kadhim, K.H., 2021. A genetic programming approach to the binary classification problem. EAI Endorsed Transactions on Energy Web8(31), pp.e11-e11.

You Might Also Like:-

Engineering Structures Assignment Help

Why is Solid Mechanics Important in Engineering?

MIS604 Requirement Engineering Processes Analysis Assignment Sample

Hey MAS, I need Assignment Sample of

Distinctive Advantage

  • 21 Step Quality Check
  • 24/7 Customer Support
  • Live Expert Sessions
  • 100% Plagiarism Free Content
  • 0% Use Of AI
  • Guaranteed On-Time Delivery
  • Confidential & Secure
  • Free Comprehensive Resources
  • Money Back Guarantee
  • PHD Level Experts

All-Inclusive Success Package

  • Plagiarism Report

    FREE $10.00
  • Non-AI Content Report

    FREE $9.00
  • Expert Session

    FREE $35.00
  • Topic Selection

    FREE $40.00
  • DOI Links

    FREE $25.00
  • Unlimited Revision

    FREE $75.00
  • Editing/Proofreading

    FREE $90.00
  • Bibliography Page

    FREE $25.00
  • Get Instant Quote

Enjoy HD Grade Assignments without overpayingSave More. Score Better. Bless YOU!

Order Now

My Assignment Services- Whatsapp Get 50% + 20% EXTRAAADiscount on WhatsApp