Tensorflow 2: We Have Three Directories: Train, Test, Validation

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

We have three directories: train, test , validation

Train - for storing the files by which we will train the model.
Test - for storing the files we are gonna predict that it will be a medicinal plant or not.
Validation - for storing the binary dataset from the training dataset.

Now we are basically going to use Tensorflow and keras  in this project.
Note : About Tensorflow and Keras
TensorFlow 2 is an end-to-end, open-source machine learning platform. We
can think of it as an infrastructure layer for differentiable programming. It
combines four key abilities:
 Efficiently executing low-level tensor operations on CPU, GPU, or TPU.
 Computing the gradient of arbitrary differentiable expressions.
 Scaling computation to many devices, such as clusters of hundreds of
GPUs.
 Exporting programs ("graphs") to external runtimes such as servers,
browsers, mobile and embedded devices.
Keras is the high-level API of TensorFlow 2: an approachable, highly-
productive interface for solving machine learning problems, with a focus on
modern deep learning. It provides essential abstractions and building blocks
for developing and shipping machine learning solutions with high iteration
velocity.
Keras empowers engineers and researchers to take full advantage of the
scalability and cross-platform capabilities of TensorFlow 2: you can run Keras
on TPU or on large clusters of GPUs, and you can export your Keras models
to run in the browser or on a mobile device.
 

So 1st we have created the binary dataset by classifying using Keras from respective
directories and then we saved the training dataset into training_dataset.npy where 0
means the the leaf is a medical plant leaf and 1 means the leaf is not the medicinal
plant.Then we have created the training model after this we have compiled and fitted the
model.

Now after the model has been ready to predict, we have tested the testing data files with
the model one by one. If it is a medicinal plant then it will return 0 and if it is not a
medicinal plant then it will return 1 .  Then by 0 or 1 we can print the result.
 

After prediction we have calculated the accuracy of the prediction :


Accuracy= {  ( n + m ) / T }
Where,

 n= Total number of medicinal plants.

m= Total number of non medicinal plants.


T= Total number of test data.
Then we have put it in the graph  (X,Y)

 
 
 
 
 

You might also like