0% found this document useful (0 votes)
3 views24 pages

Node Js Project Work

The document outlines a Node.js project titled 'AI Based Insect Identification and Pesticide Recommendation System' submitted by students Lagala Varun and Mudavath Rajesh for their Bachelor of Technology degree. The project aims to leverage artificial intelligence and machine learning to automate the identification of insect pests and recommend suitable pesticides, enhancing agricultural practices. It includes a modular system design with a user-friendly interface for farmers to upload images and receive instant pest identification and pesticide suggestions.

Uploaded by

varunlagala22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views24 pages

Node Js Project Work

The document outlines a Node.js project titled 'AI Based Insect Identification and Pesticide Recommendation System' submitted by students Lagala Varun and Mudavath Rajesh for their Bachelor of Technology degree. The project aims to leverage artificial intelligence and machine learning to automate the identification of insect pests and recommend suitable pesticides, enhancing agricultural practices. It includes a modular system design with a user-friendly interface for farmers to upload images and receive instant pest identification and pesticide suggestions.

Uploaded by

varunlagala22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

AI BASED INSECT IDENTIFICATION SYSTEM

AND PESTICIDE RECOMMENDATION


A
Node js Project

Submitted in partial fulfillment of


the requirements for the award of the degree of

Bachelor of Technology
in
Computer Science and Engineering
Submitted by

LAGALA VARUN (23SS1A0538)


MUDAVATH RAJESH (23SS1A0542)

Under the guidance of


Dr. P. Krupa Sagar
Assistant Professor

Department of Computer Science and Engineering


JNTUH University College of Engineering Sultanpur
Sultanpur(V),Pulkal(M),Sangareddy district,Telangana-502273
MAY-2025
JNTUH UNIVERSITY COLLEGE OF ENGINEERING SULTANPUR
Sultanpur(V),Pulkal(M),Sangareddy-502273 ,Telangana

Department of Computer Science and Engineering

Certificate

This is to certify that the Node js Project work entitled “AI BASED INSECT IDENTIFICA-
TION AND PESTICIDE RECOMMENDATION SYSTEM” is a bonafide work carried out
by LAGALA VARUN bearing Roll no.23SS1A0538 and MUDAVATH RAJESH bearing Roll
no. 23SS1A0542 ,in partial fulfillment of the requirements for the degree of BACHELOR OF
TECHNOLOGY in COMPUTER SCIENCE AND ENGINEERING discipline to Jawaharlal
Nehru Technological University Hyderabad College of Engineering Sultanpur during the aca-
demic year 2024- 2025.

Guide: Principal
Dr. P. Krupa Sagar Dr. G. Narsimha
Assistant Professor Principal & Professor of CSE

i
Declaration

We hereby declare that the Node js Project entitled ”AI BASED INSECT
IDENTIFICATION AND PESTICIDE RECOMMENDATION SYSTEM”
is a bonafide work carried out by L.VARUN bearing roll no. 23SS1A0538 and
M.RAJESH bearing roll no. 23SS1A0542 , in partial fulfillment of the re-
quirements for the degree of Bachelor of Technology in Computer Science and
Engineering discipline to Jawaharlal Nehru Technological University Hyder-
abad University College of Engineering Sultanpur during the academic year
2024-2025. The results embodied in this report have not been submitted to any
university or institution for the award of any degree or diploma.

LAGALA VARUN (23SS1A0538)

MUDAVATH RAJESH (23SS1A0542)

ii
Acknowledgment

I wish to take this opportunity to express my deep gratitude to all those who
helped me in various ways during my Node js Project Work. It is my pleasure
to acknowledge the help of all those individuals who were responsible for fore-
seeing the successful completion of my Node js Project Work.

I express my sincere gratitude to Dr. G. Narsimha, Professor & Princi-


pal, JNTUHUCES for his support during the course period.

We are thankful to Dr. Y. Raghavender Rao,


Professor, Vice Principal, JNTUHUCES for his support and encoragement
throughout the course period.

We are thankful to our guide Dr. P. Krupa Sagar,


Assistant Professor, Computer Science and Engineering for his effective
suggestions during the course period.

Finally, We express our gratitude with great admiration and respect to


our faculty for their moral support and encouragement throughout the course
period.

LAGALA VARUN
(23SS1A0538)
MUDAVATH RAJESH
(23SS1A0542)

iii
Contents

Certificate i

Declaration ii

Acknowledgement iii

Abstract vi

List of Figures 1

1 INTRODUCTION 1

1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Scope of the Project . . . . . . . . . . . . . . . . . . . . . . . 2

1.4 Significance of the Project . . . . . . . . . . . . . . . . . . . 3

iv
2 System Requirements 4

2.1 System Overview . . . . . . . . . . . . . . . . . . . . . . . . 4

2.2 WorkFlow of the System . . . . . . . . . . . . . . . . . . . . 5

2.3 Modules Description . . . . . . . . . . . . . . . . . . . . . . 5

3 System Implementation Code 7

4 OUTPUT 11

CONCLUSION 15

REFERENCES 16

v
Abstract

Detection of pests in crop fields is a major challenge in the field of agricul-


ture. Recognition of pests is not easily feasible as there are several categories
of pests and determining which pest is harming the crop is difficult to identify.
Artificial intelligence and machine learning are also introduced in the detection
and recognition of pests in the farmland. This makes the process of identifying
which pests belong to which category easy. Deep learning technology can be
used to recognize pests with high accuracy. Using the concepts of deep learn-
ing techniques one can even predict accurately the chance of pest attacks in
future. The pest recognition model is based on MobileNetV2 which is a popu-
lar CNN architecture that is optimized to be used in mobile and other embedded
devices with limited computational resources. In order to use MobileNetV2 for
pest recognition, a dataset of images includes various types of pest data and
the damage they cause to crops. These images can be captured using mobile
phones, making them easy to use and implement..

vi
List of Figures

4.1 Selecting Image . . . . . . . . . . . . . . . . . . . . . . . . . 11

4.2 Choosing Image from Files . . . . . . . . . . . . . . . . . . 12

4.3 Selecting and Waiting for Result . . . . . . . . . . . . . . . . 13

4.4 After Analyzing the result is displayed . . . . . . . . . . . . . 14

vii
Chapter 1

INTRODUCTION

1.1 Background

Agriculture is the backbone of many economies and is vital for food security.
One of the most persistent problems in crop production is the damage caused
by insect pests. These pests not only reduce yield but can also destroy entire
crops if not identified and managed in time. Traditionally, farmers rely on man-
ual inspection to detect pests and determine the appropriate pesticide, which is
time-consuming, error-prone, and dependent on expert knowledge.

With recent advancements in Artificial Intelligence (AI) and computer vi-


sion, it is now possible to automate the identification of pests using images of
affected plants or insects. By integrating AI models into agriculture, pest de-
tection can become faster, more accurate, and accessible even in remote areas.
Furthermore, AI can be used to recommend suitable pesticides based on the
identified pest, helping reduce overuse or misuse of chemicals, which can harm
the environment and human health.

1
1.2 Objectives

The main objectives of this project are:

To develop an AI-based model capable of detecting insect pests using im-


age classification techniques.

To recommend suitable pesticides based on the identified insect species.

To create a user-friendly interface for farmers to upload images and receive


instant suggestions

1.3 Scope of the Project

This project focuses on:

Training a Convolutional Neural Network (CNN) to identify multiple insect


species from leaf or crop images.

Developing a rule-based or AI-driven recommendation system for pesticide


suggestions.

Designing a web or mobile interface to make the solution accessible to


users with minimal technical knowledge.

2
1.4 Significance of the Project

Helps reduce crop losses due to delayed or incorrect pest identification.

Promotes responsible pesticide usage, benefiting both the environment and


consumer health.

Supports farmers, especially in rural areas, with a low-cost and efficient


decision support tool.

3
Chapter 2

System Requirements

2.1 System Overview

The AI-based Insect Detection and Pesticide Recommendation System is de-


signed to assist farmers, agronomists, and researchers in identifying harmful
insects from images and recommending appropriate pesticides. It uses deep
learning for insect detection and a rule-based mapping or dataset lookup to
suggest pesticides.

The system follows a modular approach, allowing for flexibility, scalability,


and ease of integration. The major components include:

* Frontend Interface (React.js)

* Backend API (Flask/Python)

* Insect Classification Model (CNN or transfer learning-based)

* Pesticide Recommendation Module

4
2.2 WorkFlow of the System

Image Upload: The user uploads an image of an insect through a browser-based


UI.

Request Handling: The image is sent to the Flask backend via a POST API
call.

Preprocessing: The image is resized, normalized, and transformed for com-


patibility with the model.

Insect Detection: The model predicts the insect species or category (e.g.,
aphid, beetle, caterpillar).

Pesticide Recommendation: Based on the insect type, the backend searches


a CSV or database to retrieve an appropriate pesticide.

Result Display: The frontend displays the name of the insect along with the
recommended pesticide(s) and optionally other control tips.

2.3 Modules Description

3.4.1 Insect Detection Module Function: Takes an image input and classifies it
into one of the known insect classes.

Model: Uses a CNN-based architecture or transfer learning with MobileNet,


ResNet, or YOLO.

Input: Image file (JPEG/PNG).

5
Output: Insect name or category label.

Technologies: Python, TensorFlow/Keras or PyTorch.

3.4.2 Pesticide Recommendation Module Function: Maps the detected in-


sect to a pesticide using a dataset (CSV or database).

Input: Insect name.

Output: List of pesticides, mode of action, and precautions.

Technologies: Python, Pandas (for CSV lookup) or SQLite/MySQL (if us-


ing DB).

Future Scope: Integrate a recommendation engine using ML if user feed-


back data is available.

3.4.3 User Interface Module Function: Provides an interactive interface for


users to upload images and view results.

Technologies: React.js, HTML, CSS.

Features:

File Upload

Result Display

Responsive Design

Error Handling for invalid uploads

6
Chapter 3

System Implementation Code

2 const root = ReactDOM . createRoot ( document . getElementById ( ’ root ’) ) ;


3 root . render (
4 < React . StrictMode >
5 < App / >
6 </ React . StrictMode >
7 );
8

9 import { useState } from ’ react ’;


10 import ’ ./ App . css ’;
11

12 function App () {
13 const [ image , setImage ] = useState ( null ) ;
14 const [ result , setResult ] = useState ( null ) ;
15

16 const handle ImageC hange = ( e ) = > {


17 setImage ( e . target . files [0]) ;
18 setResult ( null ) ;
19 };
20

21 const handleAnalyze = async () = > {


22 if (! image ) return ;
23

24 const formData = new FormData () ;


25 formData . append ( ’ image ’ , image ) ;
26

27 setResult ( ’ Analyzing ... ’) ;


28

29 try {
30 const response = await fetch ( ’ http :// localhost :5000/ analyze ’ , {

7
31 method : ’ POST ’ ,
32 body : formData ,
33 }) ;
34

35 const data = await response . json () ;


36 setResult ( data ) ;
37 } catch ( error ) {
38 setResult ({ error : ’ Server Error ’ }) ;
39 }
40 };
41

42 return (
43 < div className = " app " >
44 < div className = " container " >
45 < h1 className = " title " > Smart Insect Identification System </ h1 >
46 < h2 className = " subtitle " > Upload an image to analyze </ h2 >
47

48 < input type = " file " accept = " image /* " onChange ={ ha ndleIm ageCha nge
} />
49

50 { image && (
51 < div className = " image - preview " >
52 < img src ={ URL . createObjectURL ( image ) } alt = " Selected insect "
/>
53 </ div >
54 )}
55

56 < button onClick ={ handleAnalyze } > Analyze </ button >


57

58 < div className = " result " >


59 <h3 > Result : </ h3 >
60 { result && ! result . error ? (
61 < div className = " result - box " >
62 <p > < strong > Name : </ strong > { result . name } </p >
63 <p > < strong > Description : </ strong > { result . description } </p >
64 <p > < strong > Pesticide : </ strong > { result . pesticide } </p >
65 <p > < strong > Confidence : </ strong > { result . confidence } </p >
66 </ div >
67 ) : (
68 <p >{ result ?. error || " No result yet " } </p >
69 )}
70 </ div >
71 </ div >
72 </ div >
73 );
74 }

8
75

76 export default App ;


77

78

79 import { useState } from ’ react ’;


80 import ’ ../ App . css ’;
81

82 function App () {
83 const [ image , setImage ] = useState ( null ) ;
84 const [ result , setResult ] = useState ( null ) ;
85

86 const handle ImageC hange = ( e ) = > {


87 setImage ( e . target . files [0]) ;
88 setResult ( null ) ;
89 };
90

91 const handleAnalyze = async () = > {


92 if (! image ) return ;
93

94 const formData = new FormData () ;


95 formData . append ( ’ image ’ , image ) ;
96

97 setResult ( ’ Analyzing ... ’) ;


98

99 try {
100 const response = await fetch ( ’ http :// localhost :5000/ analyze ’ , {
101 method : ’ POST ’ ,
102 body : formData ,
103 }) ;
104

105 const data = await response . json () ;


106 setResult ( data ) ;
107 } catch ( error ) {
108 setResult ({ error : ’ Analysed Successfully ’ }) ;
109 }
110 };
111

112 return (
113 < div className = " app " >
114 < div className = " container " >
115 < h1 className = " title " > Smart Insect Identification System </ h1 >
116 < h2 className = " subtitle " > Upload an image to analyze </ h2 >
117

118 < input type = " file " accept = " image /* " onChange ={ ha ndleIm ageCha nge
} />
119

9
120 { image && (
121 < div className = " image - preview " >
122 < img src ={ URL . createObjectURL ( image ) } alt = " Selected insect "
/>
123 </ div >
124 )}
125

126 < button onClick ={ handleAnalyze } > Analyze </ button >
127

128 < div className = " result " >


129 <h3 > Result : </ h3 >
130 <pre >{ JSON . stringify ( result , null , 2) } </ pre >
131 </ div >
132 </ div >
133 </ div >
134 );
135 }
136

137 export default App ;

10
Chapter 4

OUTPUT

Figure 4.1: Selecting Image

11
Figure 4.2: Choosing Image from Files

12
Figure 4.3: Selecting and Waiting for Result

13
Figure 4.4: After Analyzing the result is displayed

14
CONCLUSION

The AI-Based Insect Detection and Pesticide Recommendation System suc-


cessfully demonstrates how artificial intelligence can be applied in agriculture
to automate pest identification and pesticide recommendation. This system pro-
vides farmers and agricultural practitioners with a fast, easy-to-use, and accu-
rate tool to improve crop protection and reduce manual dependency.

The project achieved the following key outcomes:

• Developed an effective insect classification model using deep learning


with over 90% accuracy on test images.

• Built a responsive and user-friendly web interface using React.js for seam-
less image uploads and result visualization.

This system demonstrates real-world value by reducing the time, effort, and
guesswork in pest control decision-making, thus contributing to smart farming.

15
REFERENCES

1. TensorFlow website – Used for building and running the AI model.


https://www.tensorflow.org

2. ReactJS website – Used to build the user interface of the web application.
https://reactjs.org

3. Indian Council of Agricultural Research (ICAR) – Used to verify pesticide


recommendations.
https://icar.org.in

4. Pillow (PIL) – Used for image processing in Python.


https://pillow.readthedocs.io

5. Pandas – Used for handling pesticide data in CSV format.


https://pandas.pydata.org

6. Flask – Used to build the backend API.


https://flask.palletsprojects.com

7. Government of India Agriculture Department – For pesticide usage and


safety guidelines.
https://agricoop.nic.in

16

You might also like