TechieYan Technologies

Classifying the type of Flowers using Convolutional Neural Networks


Convolutional Neural Networks are being increasingly used to perform classification. Here we used dataset available on kaggle containing images of different dog flowers, train the model using CNN and get good accuracy. The model performs well on the data and can be expanded further to classify more things.

Classifying the type of Flowers

Code Description & Execution

Algorithm Description

So, we have used *Convolutional neural networks* to identify whether a person is drowsy or not, as we all know, how sophisticated CNNs are and how they can learn almost anything like a brain does, this can help us save a lot of time and also giving almost accurate predictions for the disease. As we discussed convolutional neural networks are very sophisticated and more advanced version of neural networks, these are very superior to other neural networks which works better with images and audio/speech input signal. A CNN network comprises of 3 important layers such as a convolutional layer, pooling layer and fully connected layer. we can have as many layers as possible depending on the domain and project we are working on.


Convolutional neural networks

How to Execute?


So, before execution we have some pre-requisites that we need to download or install i.e., anaconda environment, python and a code editor.

Anaconda: Anaconda is like a package of libraries and offers a great deal of information which allows a data engineer to create multiple environments and install required libraries easy and neat.

Refer to this link, if you are just starting and want to know how to install anaconda.

If you already have anaconda and want to check on how to create anaconda environment, refer to this article set up jupyter notebook. You can skip the article if you have knowledge of installing anaconda, setting up environment and installing requirements.txt


1. Install necessary libraries from requirements.txt file provided.

Install necessary libraries

2. Go to the directory where your requirement.txt file is present.

CD<>. E.g, If my file is in d drive, then 

  1. CD D:
  2. CD D:\License-Plate-Recognition-main    #CHANGE PATH AS PER YOUR PROJECT, THIS IS JUST AN EXAMPLE

If your project is in c drive, you can ignore step 1 and go with step 2.

Eg. cd C:\Users\Hi\License-Plate-Recognition-main #CHANGE PATH AS PER YOUR PROJECT, THIS IS JUST AN EXAMPLE

command pomp

3. Run command  pip install -r requirements.txt or conda install requirements.txt 

(Requirements.txt is a text file consisting of all the necessary libraries required for executing this python file. If it gives any error while installing libraries, you might need to install them individually.)

All the necessary files will get downloaded. To run the Classifying the type of Flowers code, open anaconda prompt. Go to virtual environment if created or operate from the base itself and start jupyter notebook, open folder where your code is present.


Open “flower_prediction.ipynb” to get the results.

If you want to build your own model for detection, you can go through “flower_classification_model_build.ipynb”

Data Description

The dataset was downloaded from the internet. Link to the dataset

 After going through them, we see that there are a total of 5 categories.

  1. Daisy 2. Dandelion3. Roses 4. Sunflowers 5. Tulips

All the work of forming folders, unzipping the file has been done in the code. The link is just for reference

folders of code
flower categories


Classifying the type of Flowers result
Classifying the type of Flowers result 2

Issues Faced

  1. Ensure you have all libraries installed.
  2. Give correct paths wherever necessary.
  3. Make sure you have the appropriate versions of tensorflow and keras.

Click Here To Download This Code And Associated File.


+91 7075575787