Pest Detection and Prediction
DATA SCIENCE PROJECT REPORT SUBMITTED IN PARTIAL
DATA FULFILLMENT OF THE REQUIREMENTS FOR THE
AWARD OF THE DEGREE OF BACHELOR OF
SCIECNCE
TECHNOLOGY
PROJECT
IN ARTIFICIAL INTELLIGENCE AND DATA SCIENCE
NOVEMBER 2025
OF THE ANNA UNIVERSITY
PROJECT
WORK
Submitted by
V I G N E S H WA R A P - 722824243246
BATCH
2024 – 2028
Under the Guidance of
Ms.S .Rajalakshmi.,M.E.,Ph.D
Assistant Professor
Department of Artificial Intelligence and Data Science
Sri Eshwar College of Engineering
(An Autonomous Institution – Affiliated to Anna University)
COIMBATORE – 641 202
Sri Eshwar College of Engineering
(An Autonomous Institution – Affiliated to Anna University)
COIMBATORE – 641 202
BONAFIDE CERTIFICATE
Certified that this Report titled “Pest detection and Prediction” is the bonafide
work of VIGNESHWARA P- 722824243246 who carried out the project work under my
supervision.
SIGNATURE SIGNATURE
Dr. M. MOHAMMED MUSTAFA M.E, MBA, Ph.D [Link]., M.E.,(Ph.D)
HEAD OF THE DEPARTMENT SUPERVISOR
Associate Professor, Assistant Professor,
Department of Artificial Intelligence and Department of Artificial Intelligence and
Data Science, Data Science,
Sri Eshwar College of Engineering, Sri Eshwar College of Engineering,
Coimbatore – 641 202. Coimbatore – 641 202.
Submitted for the Autonomous Semester End Project Viva-Voce held on
INTERNAL EXAMINER EXTERNAL EXAMINER
DECLARATION
VIGNESHWARA P [722824243246]
To declare that the project entitled “Pest detection and prediction” submitted in
partial fulfilment to the University as the project work of Bachelor of Technology
(Artificial Intelligence and Data Science) Degree, is a record of original work done
by me under the supervision and guidance of [Link].,M.E.,(Ph.D)
Assistant Professor, Department of Artificial Intelligence and Data Science, Sri
Eshwar College of Engineering, Coimbatore.
Place: Coimbatore
Date: VIGNESHWARA P
Project Guided by,
[Link].M.E.,Ph.D.,
Assistant Professor / AI-DS
ACKNOWLEDGEMENT
The success of a work depends on a team and cooperation. I take this opportunity
to express my gratitude and thanks to everyone who helped me with my project. I
would like to thank the management for the constant support provided by them to
complete this project.
It is indeed our great honor bounded duty to thank our beloved Chairman, Mr. R.
Mohanram, for his academic interest shown towards the students.
We are indebted to our Director, Mr. R. Rajaram for motivating and providing
us with all facilities.
I wish to express my sincere regards and deep sense of gratitude to [Link]
Mohanram, M.E, PhD. Principal for the excellent facilities and encouragement
provided during the course of the study and project.
We are indebted to Dr. M. Mohammed Mustafa, M.E., MBA.,(PhD) Associate
Professor and Head of the Artificial Intelligence and Data Science Department, for
having permitted us to carry out this project and giving the complete freedom to
utilize the department's resources.
I express my sincere thanks to my guide [Link].,M.E.,(PhD)
Assistant Professor of Artificial Intelligence and Data Science Department for the
valuable guidance and encouragement given to me for completing this project.
I solemnly express our thanks to all the teaching and nonteaching staff of the
Artificial Intelligence and Data Science Department, family and friends for their
valuable support, which inspired me to work on this project.
TABLE OF CONTENTS
PAGE
CHAPTER CONTENT
NO
LIST OF FIGURES 1
ABSTRACT 2
1 INTRODUCTON
1.1 PROBLEM STATEMENT AND MOTIVATION 3
1.2 PROJECT OBJECTIVES AND SCOPE 3
2 SYSTEM REQUIREMENTS & SPECIFICATION
4
2.1 TECHNICAL ENVIRONMENT
5
FUNCTIONAL & NON-FUNCTIONAL REQUIREMENTS
2.2
3
LOW-LEVEL DESIGN (LLD)
6
3.1 MODULE/COMPONENT OVERVIEW
7
3.2 CLASS DESIGN AND RELATIONSHIPS
4
DATABASE DESIGN
11
4.1 ENTITY-RELATIONSHIP MODEL
12
4.2 SCHEMA DETAILS
5
IMPLEMENTATION AND RESULT
16
5.1 SYSTEM IMPLEMENTATION
34
5.2 TESTING AND OUTPUT
6
CONCLUSION AND FUTURE SCOPE
35
FUTURE ENHANCEMENTS AND MAINTENANCE
6.1
7
APPENDICES AND REFERENCES
36
7.1 REFERENCES
37
7.2 APPENDIX A
LIST OF FIGURES
FIGURE NO PAGE NO
LIST OF FIGURES
3.1 FLOWCHART 8
3.2 CLASS DIAGRAM 9
3.3 ER DIAGRAM 9
3.4 USE CASE DIAGRAM 10
HOME PAGE 32
5.1
5.2 DONARS PAGE 32
1
ABSTRACT
Agricultural productivity is greatly impacted by pest infestations, which
often go unnoticed until significant crop damage has occurred. Traditional
methods of pest monitoring rely heavily on manual inspection and
government advisories, which are time-consuming, inconsistent, and
inefficient. The Pest Detection and Prediction system aims to provide an
intelligent and automated solution to this problem by leveraging modern
technologies such as image processing and machine learning. The system is
designed to detect pest presence from crop images and predict potential
pest outbreaks based on environmental and historical data. This proactive
approach assists farmers in making timely decisions, reducing crop losses,
optimizing pesticide usage, and promoting sustainable farming practices.
By integrating early detection and predictive analytics, the project
contributes to improved agricultural management and increased farm
productivity.
2
INTRODUCTION
1.1 Background and Motivation
In Agriculture is one of the most crucial sectors for human survival, providing
the primary source of food and raw materials. However, pest infestations have
become a major challenge in modern farming, significantly affecting crop yield
and quality. Farmers often depend on manual inspection methods or delayed
government advisories to identify pest outbreaks, which are time-consuming,
inaccurate, and inefficient.
With the increasing adoption of advanced technologies like Artificial
Intelligence (AI), Machine Learning (ML), and Image Processing, there is a
great opportunity to automate pest detection and predict outbreaks before they
cause severe damage. Early identification enables farmers to take preventive
measures, optimize pesticide use, and reduce environmental impact.
1.2 Problem Statement and Objectives
The Pest infestations cause a considerable decline in agricultural productivity.
Traditional pest control relies on manual inspection, which is time-consuming
and prone to inaccuracy. Moreover, farmers often lack real-time insights into
potential pest outbreaks influenced by environmental changes. Hence, there is a
need for an automated system that can detect and predict pest infestations
accurately and efficiently.
3
SYSTEM ANALYSIS AND DESIGN
2.1. Technical Environment
The AI driven personalized learning and mental health assistant for students
by sentiment and predictive analysis system has been developed using
modern web technologies, backend frameworks, and database management
tools to ensure scalability, reliability, and efficiency. The application is
designed to provide a secure online examination platform that integrates
monitoring and proctoring functionalities.
Hardware Requirements:
Processor Intel Core i5
RAM 8 GB
Storage 500 GB HDD or SSD
Display 1366 × 768 resolution
Webcam 1080p HD webcam
Internet Connection 10 Mbps
Software/OS Prerequisites:
Category Name / Tool
Operating System Windows / Linux / macOS
Programming Language Python
Database MySQL / MongoDB
IDE / Development Tools Visual Studio Code
4
Browser or Device Compatibility:
The system is web-based and accessible through all major browsers, including
Google Chrome, Mozilla Firefox, Microsoft Edge, and Safari. Its user interface
is responsive and optimized for both desktop and tablet devices, ensuring a
smooth experience across different screen sizes. While it also functions on
mobile browsers.
2.2. Functional & Non-Functional Requirements
• Users, Roles, and Permissions:
AI driven personalized learning and mental health assistant for students
by sentiment and predictive analysis supports multiple user types to
ensure secure and organized access. Guests can explore the platform and
test basic features, while registered users (entrepreneurs) gain full access
to AI-generated business reports, market analysis, and success
predictions.
• Performance:
The application ensures high performance and quick response times,
efficiently handling multiple user requests simultaneously. All operations
such as request submission, approval, and refund processing are
optimized for real-time performance and reliability.
• Security:
The system ensures data security through encrypted passwords, secure
login mechanisms, and session management. Role-based access prevents
unauthorized operations, while backend validation and sanitization
techniques protect against SQL injection and data breaches, maintaining
data integrity and confidentiality.
5
LOW-LEVEL DESIGN (LLD)
3.1 Module/Component Overview:
• Controller Layer:
AI driven personalized learning and mental health assistant for students by
sentiment and predictive analysis is built using a modular architecture that
separates the system into independent yet interconnected components. The
frontend module ([Link]) handles user interaction, idea submission, and report
visualization. The backend module (RestAPI) manages business logic, API
integrations, and data processing. Core AI service modules perform key tasks
such as idea validation, market analysis, competitor assessment, report
generation, and roadmap creation.
• Service Layer:
Implements core business logic such as return validation, refund calculation, and
transaction management. Example services include ReturnService,
RefundService, and UserService.
• Repository Layer:
Implements core business logic such as return validation, refund calculation, and
transaction management. Example services include ReturnService,
RefundService, and UserService.
• Model Layer:
Defines primary entities - User, Product, ReturnRequest, and Refund, along with
their attributes and relationships, ensuring proper data mapping and consistency.
• View Layer:
Developed using Thymeleaf templates (e.g., [Link], [Link],
[Link]) for displaying return details, refund statuses
6
3.2 Class Design and Relationships
PestDetectionModel:
Handles model loading, training, and evaluation.
Controller Layer:
Handles user requests and routes APIs for users, orders, and return requests.
Example: UserController, OrderController, ReturnRequestController.
Service Layer
Contains business logic for processing returns, validating requests, managing
refunds. Example: UserService, OrderService, ReturnRequestService,
PredictiveModel:
Uses regression or time-series forecasting to predict outbreaks..
AlertSystem:
Generates notifications for users
UserInterface:
Displays results and analytics..
7
FLOW CHART
Fig:[Link]
8
SYSTEM IMPLEMENTATION
[Link]
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Return Manager</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link
href="[Link]
rel="stylesheet">
<link href="[Link]
icons@1.11.3/font/bootstrap- [Link]" rel="stylesheet">
<link href="/css/[Link]" rel="stylesheet">
<style>
/* quick inline safety styles to ensure no flash of unstyled content */ body {
transition: background-color .25s ease; }
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark sticky-top nav-glass">
<div class="container">
<a class="navbar-brand fw-bold d-flex align-items-center" href="/">
<i class="bi bi-arrow-counterclockwise me-2 fs-4"></i> Return Manager
</a>
<button class="navbar-toggler" type="button" aria-controls="navMain"
aria- expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navMain">
<ul class="navbar-nav ms-auto align-items-center">
9
<li class="nav-item"><a class="nav-link active" href="/">Home</a></li>
<li class="nav-item"><a class="nav-link" href="/ui/returns">Returns</a></li>
<li class="nav-item d-flex align-items-center ms-3">
<span id="dbStatus" class="badge bg-secondary me-3">DB:
unknown</span>
</li>
<li class="nav-item ms-3">
<button id="themeToggle" class="btn btn-sm btn-outline-light">
<i class="bi bi-sun-fill"></i>
</button>
</li>
</ul>
</div>
</div>
</nav>
<header class="hero bg-hero text-white py-6">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-7">
<h1 class="display-4 fw-bold">E-Commerce Returns & Refunds</h1>
< p class="lead mb-4">A small demo app to submit, review </p>
<div class="d-flex gap-2">
<a class="btn btn-lg btn-primary btn-glow" href="/ui/returns">View
Retur
ns</a <!-- H2 console removed; using PostgreSQL --
> ><button id="quickHelp" class="btn btn-lg btn-light
text-dark ms-2" data-bs-
toggle="modal" data-bs-target="#helpModal">Quick Help</button>
</div>
</div>
<div class="col-lg-5 d-none d-lg-block">
<div class="card shadow-lg feature-card">
<div class="card-body text-dark">
<h5 class="card-title">Live stats</h5>
10
<p class="card-text small">Sample data from the connected </p>
<div class="d-flex gap-3">
<div class="stat text-center">
<div class="stat-number" data-target="12">0</div>
<div class="stat-label">Returns</div>
</div>
<div class="stat text-center">
<div class="stat-number" data-target="48">0</div>
<div class="stat-label">Orders</div>
</div>
<div class="stat text-center">
<div class="stat-number" data-target="2">0</div>
<div class="stat-label">Agents</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<main class="container my-5">
<div class="row g-4">
<div class="col-md-6">
<div class="card p-4 shadow-sm h-100 hover-lift">
<h3 class="h6">Easy Return Flow</h3>
<p class="mb-2">Submit returns with a few clicks. The flow simple
so you can focus on rules and review.</p>
<a class="stretched-link text-decoration-none"
href="/ui/returns">Browse returns</a>
</div>
</div>
<div class="col-md-6">
<div class="card p-4 shadow-sm h-100 hover-lift">
11
<h3 class="h6">Admin Tools</h3>
<p class="mb-2">Inspect application data via your database tools. The app
is connected to PostgreSQL.</p>
<div class="text-muted small">(Database access is for administrators
only)</div>
</div>
</div>
<div class="col-12">
<div class="card p-4 shadow-sm">
<h4 class="h6">Notes</h4>
<ul>
<li>This UI is a demo. Data is stored in PostgreSQL (configured for
this environment) and persists between restarts.</li>
<li>Use the theme toggle to preview light/dark vibes.</li>
</ul>
</div>
</div>
</div>
</main>
<footer class="py-4 bg-light">
<div class="container text-center small text-muted">Return Manager •
lightweight demo • no backend changes made</div>
</footer>
<!-- Help Modal -->
<div class="modal fade" id="helpModal" tabindex="-1" aria-
labelledby="helpModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="helpModalLabel">Quick Help</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-
label="Close"></button>
</div>
12
<div class="modal-body">
<p>Click "View Returns" to explore demo return requests. Use the H2
console to inspect tables. Theme toggle switches UI colors.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-
dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script
src="[Link]
></script>
<script src="/js/[Link]"></script>
</body>
</html>
idea_service.py
# Simple example service that simulates analyzing a startup idea
def analyze_idea(idea_text: str) -> dict: """
Mock AI analysis function.
In a real project, this would call Groq API or another AI model. """
# Example simulated logic
if "AI" in idea_text or "artificial intelligence" in idea_text.lower(): industry =
"Artificial Intelligence"
score = 85
13
elif "food" in idea_text.lower():
industry = "Food & Beverage"
score = 72
else:
industry = "General Business"
score = 65
return {
"idea": idea_text,
"predicted_industry": industry,
"success_score": score,
"summary": f"This startup idea shows a {score}% potential for success in
the {industry} sector.",
[Link]
from fastapi import FastAPI
from pydantic import BaseModel
from [Link].idea_service import analyze_idea
app = FastAPI(title="StartupMind API", version="1.0")
# Pydantic model for request
class IdeaInput(BaseModel):
idea_text: str
14
@[Link]("/")
def root():
return {"message": "Welcome to StartupMind API"}
@[Link]("/api/analyze")
def analyze_idea_endpoint(input_data: IdeaInput):
"""Endpoint to analyze startup idea"""
result = analyze_idea(input_data.idea_text)
return {"status": "success", "data": result}
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];
@RestController
@RequestMapping("/api/returns")
public class ReturnController {
private final ReturnService returnService;
public ReturnController(ReturnService returnService) {
[Link] = returnService;
15
@PostMapping
public ResponseEntity<ReturnRequest> submit
(@RequestBody ReturnRequestDto dto) {
return [Link]([Link](dto));
@GetMapping("/user/{userId}")
public ResponseEntity<List<ReturnRequest>> byUser(@PathVariable Long
userId) {
return [Link]([Link](userId));
@GetMapping("/{id}")
public ResponseEntity<ReturnRequest> get(@PathVariable Long id) {
return [Link]([Link](id));
@PutMapping("/{id}/approve")
public ResponseEntity<ReturnRequest> approve(@PathVariable Long id) {
return [Link]([Link](id));
@PutMapping("/{id}/reject")
public ResponseEntity<ReturnRequest> reject(@PathVariable Long id) {
return [Link]([Link](id));
@GetMapping
public ResponseEntity<List<ReturnRequest>> all() {
16
return [Link]([Link]());
[Link]
package [Link];
import [Link].*;
import [Link];
import [Link];
@Entity
@Table(name = "return_requests")
public class ReturnRequest {
@Id
@GeneratedValue(strategy = [Link])
private Long returnId;
@ManyToOne
@JoinColumn(name = "order_item_id")
private OrderItem orderItem;
@ManyToOne
@JoinColumn(name = "user_id")
private User user;
private String reason;
private LocalDateTime requestDate;
17
5.2 OUTPUT
5.2 Features page
18
CONCLUSION
The development of AI student Assistant – Startup & Business Success Predictor
represents a significant step toward merging artificial intelligence with
entrepreneurial innovation. In an era where startups are rapidly emerging across
industries, the need for reliable, data-driven validation tools has never been
greater. AI student Assistant addresses this gap by offering an intelligent platform
that evaluates business ideas, predicts success potential, and provides a structured
roadmap for execution. By integrating technologies such as FastAPI for backend
processing, [Link] for interactive visualization, and MongoDB for secure data
storage, the system ensures efficiency, scalability, and real-time accessibility.
Its AI-driven modules—covering idea validation, market analysis, competitor
assessment, and execution planning—enable entrepreneurs, students, and
investors to make informed decisions before investing time or resources.
Furthermore, the project highlights the power of Groq AI models, NewsAPI, and
Google Trends in synthesizing global data into actionable insights. Beyond just a
prediction tool, AI student Assistant acts as an intelligent business advisor that
empowers users to transform innovative ideas into viable ventures.
Future Enhancements
While AI student Assistant – Startup & Business Success
Predictor already provides a comprehensive AI-powered
solution for business validation and strategy generation, tare
several areas for future enhancement to make the platform
more
19
REFERENCES
1. FastAPI – [Link]
Comprehensive guide for building modern, high-performance web APIs
with FastAPI, covering routing, models, and async operations.
2. [Link] – [Link]
Detailed documentation for building interactive and component-based user interfaces
using [Link].
3. Bootstrap 5 – [Link]
Official documentation for responsive UI design using Bootstrap 5, including components,
grid system, and utilities.
4. MongoDB – [Link]
Official reference for MongoDB features, CRUD operations, aggregation, and database
management.
5. NewsAPI – [Link]
Reference for fetching real-time news data from various sources to support market and
industry analysis.
6. Uvicorn – [Link]
ASGI web server documentation used to deploy FastAPI applications efficiently
with high concurrency support.
7. Python – [Link]
Comprehensive Python reference covering syntax, standard libraries, and modules
essential for backend development.
8. MDN Web Docs (HTML, CSS, JavaScript) – [Link]
Guides and references for frontend development, including HTML5, CSS3, and JavaScript
essentials for building web interfaces.
9. Stack Overflow – [Link]
Community-driven platform for troubleshooting issues, exploring code examples, and
understanding practical solutions for Spring Boot and web development.
10. GitHub – [Link]
Platform for hosting, collaborating, and managing source code repositories, widely used for
version control and project management.
20
PROJECT TITLE PEST DETECTION AND PREDICTION
PROGRAM [Link]. ARTIFICIAL INTELLIGENCE AND
DATA SCIENCE
PROJECT NUMBER 2
REGISTER NUMBER & NAME 722824243246 VIGNESHWARA P
NAME OF THE SUPERVISOR [Link],M.E.,(Ph.D)
Assistant Professor, AI-DS Department
NAME OF THE SDG GOALS MAPPED Industry, Innovation, and Infrastructure
MENTION THE SDG GOALS NUMBER SDG 9
NAME OF THE TRL LEVEL
Technology Demonstration
TRL 6 – Prototype system demonstrated in a
MENTION THE TRL LEVEL
relevant environment
POs & PSOs Mapping (Put a tick mark in the mapped PO’s & PSO’s):
Program Outcomes Program Specific
Outcomes
PO1 PO 2 PO 3 PO 4 PO 5 PO 6 PO 7 PO 8 PO 9 PO 10 PO 11 PSO 1 PSO 2 PSO 3
Signature of the Supervisor
Ms. S. Rajalakshmi M.E.,(Ph.D)
21
VENUE AND EXPENDITURE STATEMENT FOR THE PROJECT WORK
Laboratory details where
the project is carried out DVA Lab, AIDS
Operating System (Windows / Linux /
Software / Hardware details macOS),Python 3.8+,
Jupyter Notebook / VS Code, Required
Libraries: Pandas,
NumPy, Scikit-Learn, Statsmodels, Matplotlib.
Details of the Component and Expenditure
[Link] Name of the Component Qty Price Amount
NIL
Signature of the student Signature of the Supervisor
Vigneshwara P [Link].,M.E.,(Ph.D)
22