Python DL
Python DL
Regulations : R20
Year & Sem : IV-I
Python:Deep Learning
Lab Manual
To evolve as a Premier Engineering Institution in the Country with its continues strive for excellence in
Education, Research and Technological Services.
Mission
To generate the community of highly learned students with greater acquirement of knowledge and to
apply it professionally with due consideration for ecological, economic and ethical issues.
To provide knowledge-based technological services at the best satisfaction of society and for the
industrial needs.
To foster the research and disseminate research findings.
To build in capabilities for advancing education, technology, values, management and research at
international standards
Vision and Mission of the Department
VISION
To explore innovative approaches to enhance and expand learning opportunities through the
integration of various technologies.
To build a strong research and teaching environment that responds to the real-time challenges of
the industry.
MISSION
To inculcate the blend of competence, aptitude of knowledge and investigate flair through
devising an ambient environment for sustainable learning.
To transform attitude, values, priorities by changing mindset and instill positive outlook for
socially conscious intellectual development.
Incubate, apply and spread innovative ideas to evolve the department as a centre of excellence in
thrust areas.
PROGRAM EDUCATIONAL OBJECTIVES (PEOs)
PEO 1 Provide a strong foundation required to comprehend, analyse, design and develop solutions to
real world computing problems.
PEO 2 Expose the students to industry practices for providing computing solutions using current models
and techniques.
PEO 3 Enable the students to pursue higher studies and active research.
PEO 4 Foster sustained professional development through life-long learning to adapt new computing
technologies.
POs and PSOs
PSO1 Ability to apply their skills in the field of algorithms, networking, web design, cloud computing
and databases.
PSO2 Ability to develop and deploy software solutions for real world problems.
PSO3 Gain knowledge in diverse areas of Computer Science and experience an environment conducive
in cultivating skills for successful career, entrepreneurship, research and higher studies.
Syllabus
List of Experiments
1. Build a Convolution Neural Network for Image Recognition
2. Design Artificial Neural Networks for Identifying and Classifying an actor using Kaggle Dataset.
3. Design a CNN for Image Recognition which includes hyperparameter tuning
4. Implement a Recurrence Neural Network for Predicting Sequential Data
5. Implement Multi-Layer Perceptron algorithm for Image denoising hyperparameter tuning
6. Implement Object Detection Using YOLO
7. Design a Deep learning Network for Robust Bi-Tempered Logistic Loss
8. Build AlexNet using Advanced CNN
9. Demonstration of Application of Autoencoders
10. Demonstration of GAN
11. Capstone project-I
12. Capstone project-II
Reference Books:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
3. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.
No. of
S.No.
Sub Topic Names Teaching Aid Classes
Require
10 Demonstration of GAN
11 Capstone project-I
12 Capstone project-II
Hardware and Software Configuration
Experimental
Configuration Instructions
Environment
Hardware CPU Intel® Core ™ i7-6700 CPU 4GHz
Environment GPU Nvidia GTX 750, 4GB
Memory 8 GB
Software Operating System Ubuntu 14.04, 64 bit
Environmen Programming Tensorflow deep learning framework and
Environment Python language
CNN For Image Recognition
This code builds a simple feedforward neural network using TensorFlow and the
Keras API. The network consists of three fully connected (dense) layers. The Flatten layer
flattens the 28x28 input images into a 1D array, and the subsequent dense layers process the
flattened data. The final output layer has 10 units (equal to the number of classes in Fashion
MNIST) with softmax activation for multi-class classification.
Remember that this is a basic example, and you can further enhance the model by
experimenting with different architectures, activation functions, optimizers, regularization
techniques, and hyperparameters.
RESULT: Thus the given aim of the program is Succefully Completed and the Outs puts are
Verified.
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
Dataset Preparation:
Download the actor dataset from Kaggle and unzip it if necessary.
Organize your dataset into train and test folders, where each actor's images are stored in
separate subfolders named after the actors.
Data Preprocessing:
Load and preprocess the images using libraries like TensorFlow or Keras.
Resize images to a consistent size (e.g., 224x224) to feed into the neural network.
Normalize pixel values to be between 0 and 1.
Data Augmentation:
Use data augmentation techniques to increase the diversity of your training data. This can
help improve the model's generalization.
Techniques may include random rotation, resizing, flipping, and more.
Build the Neural Network Model:
Choose a suitable pre-trained model as the base architecture. Common choices are VGG16,
ResNet, or Inception.
Customize the model's output layer to match the number of actor classes you want to classify.
Freeze the weights of the pre-trained layers to avoid overfitting on limited data.
SOFTWARE REQUIRED:
Ubuntu 14.04, 64 bit
Tensorflow deep learning framework and Python language
GPU: Nvidia GTX 750, 4GB
PROGRAM:
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.applications import VGG16
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Flatten, Dense, Dropout
test_datagen = ImageDataGenerator(rescale=1.0/255.0)
# Data generators
batch_size = 32
train_generator = train_datagen.flow_from_directory(
train_data_dir,
target_size=(224, 224),
batch_size=batch_size,
class_mode='categorical'
)
test_generator = test_datagen.flow_from_directory(
test_data_dir,
target_size=(224, 224),
Dept of IT GIET Engineering College, Rajahmundry
ANN For Identifying And Classifying Actor Using Kaggle Dataset
batch_size=batch_size,
class_mode='categorical'
)
RESULT: Thus the given aim of the program is Succefully Completed and the Outs puts are
Verified.
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
AIM: Design a CNN for Image Recognition which includes hyperparameter tuning
PROBLEM DESCRIPTION:
Designing a Convolutional Neural Network (CNN) for image recognition involves selecting
an appropriate architecture, hyperparameter tuning, and optimizing the model. Here's a step-
by-step guide on designing a CNN for image recognition, including hyperparameter tuning,
using TensorFlow and Keras:
Data Preparation:
Load and preprocess your image dataset. You can use libraries like TensorFlow's
ImageDataGenerator for data augmentation and preprocessing.
Split your dataset into training, validation, and test sets.
Build the CNN Architecture:
Design the architecture of your CNN. A common architecture pattern is: Convolutional layers
→ Pooling layers → Fully connected (Dense) layers.
Experiment with the number of convolutional layers, filter sizes, pooling sizes, and the
number of units in dense layers.
Hyperparameter Tuning:
Define a set of hyperparameters to tune. These may include learning rate, batch size, number
of filters, filter sizes, dropout rates, and more.
Use techniques like grid search or random search to explore different combinations of
hyperparameters.
Model Compilation:
Choose a suitable optimizer (e.g., Adam) and loss function (e.g., categorical crossentropy) for
your image classification task.
Training:
Train your model using the training data and validate it on the validation data.
Monitor metrics like accuracy and loss during training.
Evaluation:
Evaluate your model's performance on the test set to measure its generalization ability.
Dept of IT GIET Engineering College, Rajahmundry
CNN for Image Recognition which includes hyperparameter Tuning
SOFTWARE REQUIRED:
Ubuntu 14.04, 64 bit
Tensorflow deep learning framework and Python language
GPU: Nvidia GTX 750, 4GB
PROGRAM:
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.datasets import cifar10
from sklearn.model_selection import GridSearchCV
from tensorflow.keras.wrappers.scikit_learn import KerasClassifier
metrics=['accuracy'])
return model
Best: 0.700875 using {'batch_size': 128, 'dropout_rate': 0.25, 'epochs': 10, 'filters': 64,
'kernel_size': 5}
Test accuracy: 0.7032
This code demonstrates how to use GridSearchCV for hyperparameter tuning with a simple
CNN architecture on the CIFAR-10 dataset. You can adapt this example to your own dataset
and experiment with different architectures and hyperparameters to find the best
configuration for your image recognition task.
RESULT: Thus the given aim of the program is Succefully Completed and the Outs puts are
Verified.
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
3. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.
SOFTWARE REQUIRED:
Ubuntu 14.04, 64 bit
Tensorflow deep learning framework and Python language
GPU: Nvidia GTX 750, 4GB
PROGRAM:
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import SimpleRNN, Dense
from sklearn.model_selection import train_test_split
RESULT: Thus the given aim of the program is Succefully Completed and the Outs puts are
Verified.
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
TensorFlow allows us to read the MNIST dataset and we can load it directly in the program
as a train and test dataset
Step 3: Now we will convert the pixels into floating-point values
Step 4: Understand the structure of the dataset
Step 5: Visualize the data.
SOFTWARE REQUIRED:
Ubuntu 14.04, 64 bit
Tensorflow deep learning framework and Python language
GPU: Nvidia GTX 750, 4GB
PROGRAM:
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.datasets import mnist
from tensorflow.keras.optimizers import Adam
plt.gray()
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
# Denoised images
ax = plt.subplot(3, n, i + 1 + 2 * n)
plt.imshow(denoised_images[i])
plt.gray()
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
plt.show()
RESULT: Thus the given aim of the program is Succefully Completed and the Outs puts are
Verified.
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
3. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.
Dept of IT GIET Engineering College, Rajahmundry
Object Detection Using YOLO
Object detection is a computer vision task that involves identifying and locating objects in
images or videos. It is an important part of many applications, such as surveillance, self-driving
cars, or robotics. Object detection algorithms can be divided into two main categories: single-shot
detectors and two-stage detectors.
You Only Look Once (YOLO) proposes using an end-to-end neural network that makes
predictions of bounding boxes and class probabilities all at once. It differs from the approach taken
by previous object detection algorithms, which repurposed classifiers to perform detection.
Following a fundamentally different approach to object detection, YOLO achieved state-of-the-art
results, beating other real-time object detection algorithms by a large margin.While algorithms like
Faster RCNN work by detecting possible regions of interest using the Region Proposal Network
and then performing recognition on those regions separately, YOLO performs all of its predictions
with the help of a single fully connected layer.
The first 20 convolution layers of the model are pre-trained using ImageNet by plugging in
a temporary average pooling and fully connected layer. Then, this pre-trained model is converted
to perform detection since previous research showcased that adding convolution and connected
layers to a pre-trained network improves performance. YOLO’s final fully connected layer
predicts both class probabilities and bounding box coordinates.
YOLO divides an input image into an S × S grid. If the center of an object falls into a grid
cell, that grid cell is responsible for detecting that object. Each grid cell predicts B bounding boxes
and confidence scores for those boxes. These confidence scores reflect how confident the model is
that the box contains an object and how accurate it thinks the predicted box is.
YOLO predicts multiple bounding boxes per grid cell. At training time, we only want one
bounding box predictor to be responsible for each object. YOLO assigns one predictor to be
“responsible” for predicting an object based on which prediction has the highest current IOU with
the ground truth. This leads to specialization between the bounding box predictors. Each predictor
gets better at forecasting certain sizes, aspect ratios, or classes of objects, improving the overall
recall score.
SOFTWARE REQUIRED:
Ubuntu 14.04, 64 bit
Tensorflow deep learning framework and Python language
GPU: Nvidia GTX 750, 4GB
PROGRAM:
import cv2
import numpy as np
# Load image
Dept of IT GIET Engineering College, Rajahmundry
Object Detection Using YOLO
image = cv2.imread("image.jpg")
height, width = image.shape[:2]
if confidence >conf_threshold:
center_x = int(detection[0] * width)
center_y = int(detection[1] * height)
w = int(detection[2] * width)
h = int(detection[3] * height)
RESULT: Thus the given aim of the program is Succefully Completed and the Outs puts are
Verified.
RERERENCE BOOKS:
1. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
2. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.
Dept of IT GIET Engineering College, Rajahmundry
A Deep Learning Network For Robust Bi-Tempered Logistic Loss
SOFTWARE REQUIRED:
Ubuntu 14.04, 64 bit
Tensorflow deep learning framework and Python language
GPU: Nvidia GTX 750, 4GB
PROGRAM:
import tensorflow as tf
from tensorflow.keras import layers, models
from bi_tempered_loss import BiTemperedLogisticLoss
# Define the model
model = models.Sequential([
layers.Conv2D(32, (3, 3), activation='relu', input_shape=(64, 64, 3)),
layers.MaxPooling2D((2, 2)),
layers.Conv2D(64, (3, 3), activation='relu'),
layers.MaxPooling2D((2, 2)),
layers.Flatten(),
layers.Dense(128, activation='relu'),
layers.Dense(1, activation='sigmoid') # Binary classification, use sigmoid activation
])
# Compile the model with Bi-Tempered Logistic Loss
Dept of IT GIET Engineering College, Rajahmundry
A Deep Learning Network For Robust Bi-Tempered Logistic Loss
RESULT: Thus the given aim of the program is Succefully Completed and the Outs puts are
Verified.
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
3. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.
Convolutional layer:
A convolution is a mathematical term that describes a dot product multiplication between two
sets of elements. Within deep learning the convolution operation acts on the filters/kernels
and image data array within the convolutional layer. Therefore a convolutional layer is
simply a layer the houses the convolution operation that occurs between the filters and the
images passed through a convolutional neural network.
MaxPooling layer:
Max pooling is a variant of sub-sampling where the maximum pixel value of pixels that fall
within the receptive field of a unit within a sub-sampling layer is taken as the output. The
max-pooling operation below has a window of 2x2 and slides across the input data,
outputting an average of the pixels within the receptive field of the kernel
Flatten layer:
Takes an input shape and flattens the input image data into a one-dimensional array.
Dense Layer:
A dense layer has an embedded number of arbitrary units/neurons within. Each neuron is a
perceptron.
SOFTWARE REQUIRED:
Ubuntu 14.04, 64 bit
Tensorflow deep learning framework and Python language
GPU: Nvidia GTX 750, 4GB
PROGRAM:
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout
# Define the AlexNet model
model = Sequential([
# Layer 1
Conv2D(96, (11, 11), strides=(4, 4), activation='relu', input_shape=(224, 224, 3)),
MaxPooling2D((3, 3), strides=(2, 2)),
# Layer 2
Conv2D(256, (5, 5), padding='same', activation='relu'),
MaxPooling2D((3, 3), strides=(2, 2)),
# Layer 3
Conv2D(384, (3, 3), padding='same', activation='relu'),
# Layer 4
Conv2D(384, (3, 3), padding='same', activation='relu'),
# Layer 5
Conv2D(256, (3, 3), padding='same', activation='relu'),
MaxPooling2D((3, 3), strides=(2, 2)),
# Flatten and fully connected layers
Flatten(),
Dense(4096, activation='relu'),
Dropout(0.5),
Dense(4096, activation='relu'),
Dropout(0.5),
Dense(1000, activation='softmax') # Assuming you have 1000 classes for ImageNet
])
Dept of IT GIET Engineering College, Rajahmundry
AlexNet Using Advanced CNN
RESULT: Thus the given aim of the program is Succefully Completed and the Outs puts are
Verified.
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
Dept of IT GIET Engineering College, Rajahmundry
AlexNet Using Advanced CNN
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
3. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.
Allication of AutoEncoders
Exp. No.:
Date:
AIM:Demonstration of Application of autoencoders.
PROBLEM DESCRIPTION:
Autoencoders are a type of artificial neural network used in unsupervised learning and
dimensionality reduction tasks. They consist of an encoder and a decoder, and their primary
purpose is to learn efficient representations of input data by reducing its dimensionality.
Autoencoders find applications in various domains, including image compression, anomaly
detection, denoising, and feature extraction. Here's a demonstration of some common
applications of autoencoders:
Image Denoising:
Autoencoders can be used to remove noise from images. Here's how you can do it:
Dataset Preparation: Collect a dataset of noisy images and their clean counterparts.
Model Architecture: Create an autoencoder architecture with an encoder to map noisy images
to a lower-dimensional representation and a decoder to reconstruct clean images from the
encoded representations.
Training: Train the autoencoder on the noisy images, minimizing the reconstruction loss,
typically using mean squared error.
Inference: To denoise a new image, feed it through the encoder, obtain the encoded
representation, and then use the decoder to reconstruct the clean image.
Image Compression:
Autoencoders can be used to compress images while retaining essential information:
Dataset Preparation: Gather a dataset of high-resolution images.
Model Architecture: Design an autoencoder to map high-resolution images to a lower-
dimensional latent space and then decode them back to their original resolution.
Training: Train the autoencoder with the aim of minimizing the reconstruction error.
Inference: To compress an image, use the encoder to obtain its latent representation. To
decompress, use the decoder to reconstruct the image from the latent representation.
Anomaly Detection:
Autoencoders can be used for anomaly detection in various domains, such as fraud detection
or network security:
Dataset Preparation: Create a dataset with a majority of normal instances and a smaller set of
anomalous instances.
Model Architecture: Build an autoencoder to learn the normal patterns in the data.
Dept of IT GIET Engineering College, Rajahmundry
Allication of AutoEncoders
Training: Train the autoencoder to minimize the reconstruction loss on the normal instances.
Inference: During inference, pass new data through the autoencoder, and if the reconstruction
error is significantly higher than a predefined threshold, flag it as an anomaly.
Feature Extraction:
Autoencoders can be used to learn compact representations of data for downstream tasks:
Dataset Preparation: Collect a dataset with complex data.
Model Architecture: Create an autoencoder to map the input data to a lower-dimensional
representation.
Training: Train the autoencoder, emphasizing the preservation of important features in the
encoded representations.
Feature Extraction: Use the encoder portion of the trained autoencoder to extract features for
other machine learning tasks, like classification or regression.
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
3. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.
Demonstration of GAN
Exp. No.:
Date:
AIM:Demonstration of GAN.
Program:
A Generative Adversarial Network (GAN) is a type of deep learning model composed of two neural
networks, a generator, and a discriminator, which are trained together in a competitive manner. GANs
are widely used for generating new data that is similar to a given dataset.
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
# Generator model
generator = keras.Sequential([
layers.Input(shape=(100,)),
layers.Dense(7 * 7 * 256, use_bias=False),
layers.BatchNormalization(),
layers.LeakyReLU(alpha=0.2),
layers.Reshape((7, 7, 256)),
layers.LeakyReLU(alpha=0.2),
# Discriminator model
discriminator = keras.Sequential([
layers.Input(shape=(28, 28, 1)),
layers.Conv2D(64, (5, 5), strides=(2, 2), padding='same'),
layers.LeakyReLU(alpha=0.2),
layers.Dropout(0.3),
layers.Flatten(),
layers.Dense(1)
])
# Training loop
batch_size = 64
epochs = 10000
sample_interval = 1000
if epoch % sample_interval == 0:
print(f"Epoch {epoch}, D Loss: {d_loss}, G Loss: {g_loss}")
OUTPUT:
Epoch 0, D Loss: 0.6942, G Loss: 0.6911
Epoch 1000, D Loss: 0.2456, G Loss: 3.7562
Epoch 2000, D Loss: 0.1291, G Loss: 4.7823
...
Epoch 9000, D Loss: 0.3125, G Loss: 2.6117
Epoch 10000, D Loss: 0.2178, G Loss: 3.7489
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
3. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.
Capstone Project-I
Exp. No.:
Date:
OUTPUT:
Epoch 1/10
5/5 [==============================] - 1s 44ms/step - loss: 0.7024 -
accuracy: 0.4583 - val_loss: 0.6628 - val_accuracy: 0.6250 Epoch 2/10
5/5 [==============================] - 0s 9ms/step - loss: 0.6870 -
accuracy: 0.5417 - val_loss: 0.6747 - val_accuracy: 0.6250 Epoch 3/10
5/5 [==============================] - 0s 10ms/step - loss: 0.6687 -
accuracy: 0.5972 - val_loss: 0.6817 - val_accuracy: 0.7500 Epoch 4/10
5/5 [==============================] - 0s 9ms/step - loss: 0.6517 -
accuracy: 0.8194 - val_loss: 0.6709 - val_accuracy: 0.6250 Epoch 5/10
5/5 [==============================] - 0s 9ms/step - loss: 0.6466 -
accuracy: 0.7500 - val_loss: 0.6787 - val_accuracy: 0.6250 Epoch 6/10
5/5 [==============================] - 0s 10ms/step - loss: 0.6297 -
accuracy: 0.8611 - val_loss: 0.6819 - val_accuracy: 0.6250 Epoch 7/10
5/5 [==============================] - 0s 10ms/step - loss: 0.6205 -
accuracy: 0.8333 - val_loss: 0.6861 - val_accuracy: 0.5000 Epoch 8/10
5/5 [==============================] - 0s 9ms/step - loss: 0.5952 -
accuracy: 0.9028 - val_loss: 0.7077 - val_accuracy: 0.3750 Epoch 9/10
5/5 [==============================] - 0s 10ms/step - loss: 0.5900 -
accuracy: 0.7222 - val_loss: 0.7049 - val_accuracy: 0.5000 Epoch 10/10
5/5 [==============================] - 0s 10ms/step - loss: 0.5883 -
accuracy: 0.8056 - val_loss: 0.6637 - val_accuracy: 0.6250 1/1
[==============================] - 0s 69ms/step
precision recall f1-score support
RESULT: The Complete the requirements given in capstone project is successfully complete.
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
3. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.
Capstone Project-II
Exp. No.:
Date:
layers.MaxPooling2D((2, 2)),
layers.MaxPooling2D((2, 2)),
])
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), metrics=['accuracy'])
validation_data=(test_images, test_labels))
new_image_path = 'sample.jpg'
class_index=predict_new_image(new_image_path,model)
l=["airplane","automobile","bird","cat","deer","dog","frog","horse","ship","truck"]
print(l[class_index])
OUTPUT:
Epoch 1/10
1563/1563 [==============================] - 48s 30ms/step - loss: 1.5246 -
accuracy: 0.4450 - val_loss: 1.3093 - val_accuracy: 0.5379 Epoch 2/10
1563/1563 [==============================] - 47s 30ms/step - loss: 1.1922 -
accuracy: 0.5789 - val_loss: 1.0812 - val_accuracy: 0.6116 Epoch 3/10
1563/1563 [==============================] - 45s 29ms/step - loss: 1.0344 -
accuracy: 0.6366 - val_loss: 1.0275 - val_accuracy: 0.6396 Epoch 4/10
1563/1563 [==============================] - 47s 30ms/step - loss: 0.9392 -
accuracy: 0.6707 - val_loss: 0.9740 - val_accuracy: 0.6582 Epoch 5/10
1563/1563 [==============================] - 48s 30ms/step - loss: 0.8719 -
accuracy: 0.6952 - val_loss: 0.9012 - val_accuracy: 0.6892 Epoch 6/10
1563/1563 [==============================] - 51s 32ms/step - loss: 0.8102 -
accuracy: 0.7138 - val_loss: 0.8784 - val_accuracy: 0.7001 Epoch 7/10
RESULT: The Complete the requirements given in capstone project is successfully complete
RERERENCE BOOKS:
1. Goodfellow, I., Bengio,Y., and Courville, A., Deep Learning, MIT Press, 2016.
2. Bishop, C., M., Pattern Recognition and Machine Learning, Springer, 2006.
3. Navin Kumar Manaswi, “Deep Learning with Applications Using Python”, Apress, 2018.