• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer

DRH

My site

Uncategorized

Tomato Deases Prediction Using Deep Learning(CNN Algorithm) With Data Set(Complete Project).

February 21, 2020 by Dilip Leave a Comment

Short Introduction
Here, Python programming language, Keras library is used to manipulate raw input image. To train on CNN architecture and creating a machine learning model that can predict the type of diseases, image data is collected from ourselves and the authenticated online source. As the result, few diseases that usually occurs in tomato plants such as Late blight (training 100, test 21), Gray spot (training 95, test 18) and bacterial canker (training 90, test 21) are detected. So, basically this project is a way to digitize the information in an image for the purpose of convenient retrieval and efficient processing of data. Dataset Preparation, Image processing of a certain level and a Convolutional Neural Network as a classifier are the three main areas, in which this project is completely relying on. The prime focus of this project is firstly to design a convolutional neural network with suitable parameters and train it with a dataset of our own. Finally, predicting the classes in an input image by processing the image into a desired format and then feeding it into the trained neural network.

Dataset For the Tomato Deases Prediction:
https://drive.google.com/open?id=1e43UolvmfnPvbTXKcbexDEgdqQT8y7dQ

Code for this project:

import numpy as np  import keras from keras import backend as K from keras.models import Sequential from keras.layers import Activation  from keras.layers.core import Dense,Flatten from keras.optimizers import Adam from keras.metrics import categorical_crossentropy from keras.preprocessing.image import ImageDataGenerator from keras.layers.normalization import BatchNormalization from keras.layers.convolutional import * from matplotlib import pyplot as plt from sklearn.metrics import confusion_matrix import itertools import matplotlib.pyplot as plt %matplotlib inline  

from keras.applications import VGG16#Load the VGG modelvgg_conv = VGG16(weights='imagenet', include_top=False, input_shape=(224, 224, 3)) 
 # Freeze the layers except the last 6 layers
for layer in vgg_conv.layers[:-7]:
    layer.trainable = False
 
# Check the trainable status of the individual layers
for layer in vgg_conv.layers:
    print(layer, layer.trainable) 
vgg_conv.summary() 
from keras import models
from keras import layers
from keras import optimizers
from keras.regularizers import l2
 
# Create the model
model = models.Sequential()
 
# Add the vgg convolutional base model
model.add(vgg_conv)

# Add new layers

model.add(layers.Dropout(0.25))
model.add(layers.Flatten())
model.add(layers.Dropout(0.4))
model.add(layers.Dense(512,kernel_regularizer=l2(0.01), bias_regularizer=l2(0.01),activation='relu'))
model.add(layers.Dense(8,kernel_regularizer=l2(0.01), bias_regularizer=l2(0.01),activation='softmax'))
 
# "Show a summary of the model. Check the number of trainable parameters"
model.summary() 
import tensorflow as tf
tf.test.gpu_device_name() 
# this code to is to connect the google drive with google #colab
from google.colab import drive 
drive.mount('/content/drive') 
import tarfile #importing tarfile to extract the tarfile where dataset is located
 train_path='proj/train'
test_path='proj/test'
valid_path='proj/valid' 
 train_generator=ImageDataGenerator().flow_from_directory(train_path,target_size=(224,224),classes=['anthracnose','calciumdefficiency','healthy','lateblight','bacterialSpot','tomatomosaic','yellowcurved','septorailleafspot'],batch_size=10)
validation_generator=ImageDataGenerator().flow_from_directory(valid_path,target_size=(224,224),classes=['anthracnose','calciumdefficiency','healthy','lateblight','bacterialSpot','tomatomosaic','yellowcurved','septorailleafspot'],batch_size=10)
test_batches=ImageDataGenerator().flow_from_directory(test_path,target_size=(224,224),classes=['anthracnose','calciumdefficiency','healthy','lateblight','bacterialSpot','tomatomosaic','yellowcurved','septorailleafspot'],batch_size=10) 

 from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True 

 train_datagen = ImageDataGenerator(
      rescale=1./255,
      rotation_range=20,
      width_shift_range=0.2,
      height_shift_range=0.2,
      horizontal_flip=True,
      fill_mode='nearest')
 
validation_datagen = ImageDataGenerator(rescale=1./255)
 
# Change the batchsize according to your system RAM
train_batchsize = 62
val_batchsize = 10
  
 # Compile the model
model.compile(loss='categorical_crossentropy',
              optimizer=optimizers.RMSprop(lr=1e-5),
              metrics=['acc'])
# Train the model
history = model.fit_generator(
      train_generator,
      steps_per_epoch=train_generator.samples/train_generator.batch_size ,
      epochs=25,
      validation_data=validation_generator,
      validation_steps=validation_generator.samples/validation_generator.batch_size,
      verbose=1)
 
# Save the model
model.save('trainedmodel_10.h5') 
 test_eval = model.evaluate(test_batches, verbose=0) 

print("Test Loss:",test_eval[0])
print("Test Accuracy:",test_eval[1])

print("Test Loss:",test_eval[0])
print("Test Accuracy:",test_eval[1])

 


Filed Under: Uncategorized

Roadmap To Become a Complete Professional web Developer

January 20, 2020 by Dilip 2 Comments

First Step

Fig: Learning Flow Chart for frontend Development

At first to become a web developer we should know about the Html

What is Html ?

  • It is the language used to display the content in websites
  • Html stands for Hypertext markup language

If you are completely beginner the above two lines also be the confusing but dont worry you understand when you do

You Can start by watching video below
href=”https://www.youtube.com/watch?v=GEfuOMzRgXo And then look at this
href=”https://www.youtube.com/watch?v=NAEHbzXMNpA

Learning CSS(Cascading Style Sheet)


It is the styling language, that is it gives the style to the websites.with combination with the html it makes the uglier websites with only html gives beautiful looks.

Best one Tutorial From Youtube

Filed Under: Uncategorized

Securing The API in dotnet core

January 9, 2020 by Dilip 2 Comments

User should be able to log in
User should be able to register
User should be able to see a list of users
User should be able to message another user

Everything starts with the user..

In this module we know
How we store the password in the Database;
creating the User Model
the repository Pattern
Creating the Authentication Controller
Data Transfer Objects
Token Authentication
Authentication Middleware

Filed Under: Uncategorized

error: No such host is known. While installing Dot net packages

January 8, 2020 by Dilip 3 Comments

This is the error due to not specifying package version while installing package so specify the version of package you want to install..write command like below in dotnet cli or in package manager console

dotnet add package Microsoft.EntityFrameworkCore.SqlServer –version 3.1.0

visit this site :https://www.nuget.org/packages

Filed Under: Uncategorized

how to read sent or received mail in nepali

January 8, 2020 by Dilip 11 Comments

Dheraii laii nepali ma aayeko gmail read garda aaudaina so nepali ma kasari gmail laii read garne vanne xa. plz follow the following step:
1. Sabai vanda pahile aafnow kunaipani internet browser kholnu hos (opera or google chrome..)
2.type “nepali unicoder extension” search barma type garera herne
3. talako border gariyeko 2 ota ma kunai aeuta click garnuhos

4.Teshpaxi add to chrome vanne option aauxa tesma click garnu hos ani adi opera chalairanu vako xa vane add to opera aauxa.

5. Aba tapai mail nepali ma pathauna ra receive garna saknuhune xa.

kei nabujeko xa vane comment garnuhos, ma help garda khusi hune xu

Tapailai computer sambandhii ke bujnu vaena vane wa science ma career banauna chahanu hunxa tara esko barema tha xaena vane contact garnuhos hami aabsyak jankari dine xau…

Filed Under: Education, Uncategorized

  • « Previous Page
  • Page 1
  • Page 2

Primary Sidebar

Recent Posts

  • TypeScript common Syntax
  • Setting Up Ngrx store with the Ngrx schematics
  • AngularPipe
  • To create repository in github
  • Adding Bootstrap and JQuery in angular

Recent Comments

  • Dilip on Understanding Angular Versioning
  • Dilip on Understanding Angular Versioning
  • Sagar on error: No such host is known. While installing Dot net packages
  • Sagar on Digitalization Program in Province no. 1 Nepal
  • Dilip on error: No such host is known. While installing Dot net packages

Archives

  • June 2020
  • May 2020
  • April 2020
  • February 2020
  • January 2020

Footer

Artificial Intelligence And Machine Learning

Artificial intelligence is the Huge interdisplinery field which includes the social science,psychology and all in cognitive with the computer.Artificial intelligence means human like intelligence wich can think and process logic and gives decision.

Web Application Development

Web applications are those like websites wich is opend by browsers. Nowadays more than desktop application web application is growing because of internet available in all the remote places and data is managed easily.

Internet of things(IOT)

Internet of things is the technology wich are main technolgy to make smart home,smart city,and smart profession.You can make your work comfortable with remote sensors internet and many networking interface.like microcontroller,bluetooth module ethernet module internt,web technology

Copyright © 2021 · Genesis Sample on Genesis Framework · WordPress · Log in

  • Education
  • Computer Technology