MEDIINTE1 Shailesh
MEDIINTE1 Shailesh
Submitted
by
R.shailesh 22841A6698
BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE AND ENGINEERING
DECLARATION
We further declare that this work is original and has not been submitted for the
award of any degree or diploma of this or any other university.
Place: Hyderabad
Date:
R.shailesh 22841A6698
AURORA’S TECHNOLOGICAL AND RESEARCH INSTITUTE
(Affiliated to JNTU, Hyderabad and approved by AICTE, New Delhi)
Parvathapur, Uppal, Hyderabad-500 039
CERTIFICATE
This is to certify that the Industrial Oriented Mini Project Report titled “AI-
Powered Medicine Checker Web Application” is the bonafide work of
“R.shailesh- ( 22841A6698) ”, who carried out the project work under my
supervision.
We sincerely thank our project guide Mr. Manipaul Panem, Department of CSE,
for his constant support, encouragement, and valuable guidance, which greatly
helped us in completing this project successfully.
We express our heartfelt thanks to the Head of the Department and Vice Principal
Mr. Vinod Chavan, for his support, kind attention, and encouragement throughout
this course.
We also wish to express our deep gratitude to Prof. Srikanth Jatla, Principal, for
providing us with a conducive academic environment and continuous motivation.
We are thankful to the Project Review Committee members for their constructive
feedback and suggestions, which improved the quality of our work.
We also extend our thanks to the teaching and non-teaching staff of the department
for their timely assistance and support throughout the project.
Special thanks to our classmates and friends for their cooperation, moral support,
and teamwork during various stages of the project.
Lastly, we are deeply grateful to our families for their patience, understanding, and
emotional support throughout this academic journey.
ABSTRACT
1 INTRODUCTION 1
1.1Motivation 1
1.1Caring AI-Powered Medicine 1
1.1Healthy Mind 3
2 LITERATURE SURVEYS 5
3 SYSTEM ANALYSIS 8
4 SYSTEM STUDY
4.1 Feasibility Study 11
4.2FeasibilityAnalysis 12
5 SYSTEM REQUIREMENTS
5.1 Functional Requirements 14
5.2 Non–Functional Requirements 15
6 SYSTEM DESIGN
6.1 System Architecture 17
6.2 UML Diagrams 18
7 INPUT AND OUTPUT DESGIN
7.1 Input Design 28
7.2 Output Design 29
8 IMPLEMENTATION 30
9 SOFTWARE ENVIRONMENT
9.1 Home Page 33
9.2 checker page 40
9.3 medicine Page 45
9.4 result Page 50
9.5uploadimage Page 56
9.6 train_model.py 61
9.7 app.py 63
9.8ocr_local.py 66
10 RESULT/OUTPUT SCREEN 72
11 FUTURE SCOPE 75
12 CONCLUSION 78
13 REFERENCES 81
LIST OF FIGURES/TABLES
S.No Figures Page
6.1 System Architectural Diagram 16
6.2.1 Class Diagram 19
6.2.2 Use Case Diagram 20
6.2.3 Collaboration Diagram 21
6.2.4 Sequence Diagram 22
6.2.5 Deployment Diagram 23
6.2.6 Statechart Diagram 24
6.2.7 Activity Diagram 25
6.2.8 DataFlow Diagram 26
10.2 Output Screens 66
CHAPTER 1
INTRODUCTION
1.1 MOTIVATION:
1.2CARING AI-POWERED :
1
information
about the drug. It’s particularly helpful for:
The AI-powered app acts as a digital assistant for medicine awareness and
safety, promoting responsible medication use, encouraging health literacy,
and fostering a sense of independence and care for users managing their own
or their family’s health.
By placing the user's well-being at the center this project contributes to a
more inclusive, safe, and informed healthcare experience.
In a world where healthcare systems are often stretched and access to expert
medical advice can be delayed or limited, empowering individuals to
understand and manage their medications is more important than ever. The
AI-Powered Medicine Checker Web Application is developed with a deep
understanding of the real-world challenges faced by patients, caregivers, and
healthcare providers—particularly in underserved communities.
2
• Receive prescriptions with unclear handwriting.
• Forget usage instructions given verbally.
• Have vision impairments or low health literacy.
• Face language barriers when trying to understand English-only labels.
• Be unaware of possible side effects, drug interactions, or precautions.
A healthy body begins with a healthy mind. When individuals are unsure
about the medications they are taking—whether due to confusing
instructions, unfamiliar side effects, or a lack of accessible information—it
can lead to stress, anxiety, and fear. This mental burden can be especially
heavy for the elderly, chronically ill patients, or caregivers responsible for
others’ well-being.
3
compositions leads to more thoughtful, proactive health management.
🌱 Encourages Self-Reliance: Empowering people with knowledge
contributes to a more positive, independent approach to their health.
4
CHAPTER 2
LITERATURE SURVEY
With the rapid evolution of digital health technologies, there has been a
growing interest in using artificial intelligence (AI) and machine learning
(ML) to enhance the accessibility and safety of healthcare. One such area is
medication management, where patients often struggle to access and
understand drug information. Literature shows that poor medication literacy
contributes significantly to non-compliance, side effects, and preventable
hospitalizations.
This survey explores the current body of research and existing systems
related to image-based drug identification, medication information systems,
and AI-driven health support tools.
5
2. Drug Information Systems and Knowledge Bases
AI-based chatbots and healthcare assistants like Ada Health, Babylon, and
Google Health have demonstrated the power of conversational AI for
diagnosis and health queries. While effective, they often require detailed
symptom input and do not focus specifically on medicine information
based on images.
6
4. Gaps Identified in Existing Solutions
• Lack of support for Indian generic medicines and regional
manufacturers.
• Most systems require manual inputs, making them less user-friendly.
• Scarce integration of image-based recognition with direct medical
guidance.
• Limited personalization or explanation of side effects, substitutes,
and precautions in understandable terms.
7
CHAPTER 3
SYSTEM ANALYSIS
1. Problem Definition
Many individuals struggle to understand the medications they consume due to
limited access to reliable information, unclear labels, or lack of healthcare
guidance. This creates risks like improper usage, missed doses, harmful side
effects, or drug interactions. The need for an intelligent, user-friendly solution
to assist users in identifying and understanding their medicines is both urgent
and essential.
2. System Objective
The primary objective of the system is to identify a medicine from an
image and provide comprehensive, trustworthy information such as:
• Drug Name & Description
• Usage Instructions
• Side Effects & Precautions
• Substitutes & Composition
• Price & Manufacturer Details
All this is achieved through a seamless web-based interface powered
by Flask, AI/ML models, and CSV-based databases.
3. System Components
a) User Interface
• Developed using HTML, CSS, and Flask templates.
• Allows image uploads and displays medicine information clearly.
• Designed for simplicity and accessibility.
8
b) Backend (Flask App)
• Handles routing, image processing, and interaction with ML models.
• Loads CSV datasets and filters medicine data based on recognized
name.
c) AI/ML Model
• Trained or pre-built OCR (Optical Character Recognition) or image
classification model.
• Extracts the medicine name from an uploaded photo of a strip, box, or
label.
4. Functional Requirements
• Upload and process medicine images.
• Recognize and extract the medicine name.
• Fetch related data from both CSV files.
• Display medicine information clearly (uses, side effects, etc.).
• Suggest alternatives/substitutes when available.
9
5. Non-Functional Requirements
• Accuracy: High accuracy in name recognition and data matching.
• Usability: Simple, clean UI for all user types.
• Performance: Quick response time for image processing and data
retrieval.
• Scalability: Can be extended to support more file formats and data
sources.
• Security: Safe handling of uploaded images and data.
6. Feasibility Study
• Technical Feasibility: Achievable using Python libraries like
pytesseract, pandas, and Flask. No complex hardware required.
• Operational Feasibility: End users only need to take a photo and
upload it—high usability.
• Economic Feasibility: Low-cost project; datasets are in CSV format
and the tools are open-source.
7. Future Enhancements
• Support for multilingual drug information.
• Voice-based output for visually impaired users.
• Integration with a larger API-based drug database.
• User login to track personal medicine history.
10
CHAPTER 4
SYSTEM STUDY
. Feasibility Study
a) Technical Feasibility
The system is technically feasible using open-source and well-supported
technologies:
• Flask a lightweight Python web framework, will be used to manage
the server-side application and handle HTTP requests and responses
efficiently.
• Pandas will manage the CSV-based datasets, enabling fast,
structured access to the medicine data without requiring a full
database initially.
• Tesseract OCR (Optical Character Recognition) or a simple
AI/ML-based image classifier can be integrated to recognize text
from uploaded medicine images (such as names or compositions).
These technologies are well-documented, cross-platform, and
community-supported, which minimizes technical barriers and
allows easy debugging and updates.
The system is also designed to be scalable and upgradable.
Although it starts with CSV-based data handling, it can be easily
11
migrated to more scalable storage systems like SQLite,
PostgreSQL, or MongoDB in the future to accommodate larger
datasets, better performance, and real-time updates.
Furthermore, the modular architecture allows the AI/ML model to be
upgraded or retrained without disrupting the rest of the system,
providing long-term flexibility.
b) Operational Feasibility
The system is highly operable and user-friendly. It is designed with the end-
user in mind, requiring only basic interactions like:
• Uploading a photo of a medicine label or strip
• Receiving well-structured, easy-to-understand medicine information
This simplicity ensures that the system is usable even by non-technical
users, including:
• Elderly individuals
• Patients in rural areas
• Caregivers
• People with limited digital skills
12
source and do not require any licensing costs.
• The use of CSV files as the initial data source avoids the need for
expensive databases or cloud subscriptions.
• Hosting requirements are minimal, allowing the application to be
deployed on budget-friendly platforms like Heroku, Render, or
Digital Ocean.
There is no dependency on third-party APIs, which eliminates ongoing
usage fees or quota limitations. Additionally, the system does not require
advanced hardware or GPU processing, reducing the need for costly servers.
13
CHAPTER 5
SYSTEM REQUIREMENT
14
6.User Interface
o A responsive and clean interface to guide users through uploading
and viewing results easily.
2. Non-Functional Requirements
These define how the system should behave, rather than what it
should do:
1. Performance
o The system should process and display results within a few
seconds of image upload.
2. Scalability
o Capable of handling larger datasets or switching to a database
backend in the future.
3. Usability
o Interface should be intuitive for users of all technical levels,
including elderly and rural users.
4. Reliability
o The system must consistently recognize and match medicines
under normal conditions.
5. Security
o Uploaded images must not be stored permanently unless
explicitly required.
o The system should not expose sensitive health information.
15
3. Hardware Requirements
For development and deployment (minimum recommendations):
Component Requirement
Processor Intel i5 or equivalent
4 GB (8 GB recommended for
RAM
smoother dev)
Storage 10 GB free space
Internet Required for hosting and access
4. Software Requirements
Software Description
Operating System Windows, macOS, or Linux
Python Version 3.7 or higher
Flask For backend routing
Pandas For CSV data processing
For text recognition from
Tesseract OCR
images
Flask’s template engine for
Jinja2
front-end
Browser (Client- Chrome, Firefox, or any
Side) modern browser
Optional VS Code, PyCharm for
(IDE/Tools) development
16
CHAPTER 6
SYSTEM DESIGN
17
6.2 UML DIAGRAMS
Goals of UML
The primary goals behind the design and use of UML are as follows:
18
Extensibility: To offer mechanisms that allow the core concepts of UML to be
extended and specialized according to specific needs.
Tool Support: To promote and support the development of a broad market for
object-oriented modeling tools.
19
6.2.1 CLASS DIAGRAM:
20
6.2.2 USE CASE DIAGRAM:
21
6.2.3 COLLABORATION DIAGRAM:
22
6.2.4 SEQUENCE DIAGRAM:
23
6.2.5 DEPLOYMENT DIAGRAM:
24
6.2.6 STATECHART DIAGRAM:
25
6.2.7 ACTIVITY DIAGRAM:
26
6.2.8 DATAFLOW DIAGRAM:
27
CHAPTER 7
INPUT AND OUTPUT DESIGN
Objectives:
• To ensure accurate and efficient data capture from users, images,
and datasets.
• To validate and sanitize inputs to prevent errors and ensure
security.
• To provide a user-friendly interface for uploading medicine images
or typing medicine names.
• To support both manual and AI-assisted (image-based) medicine
input methods.
28
7.2 OUTPUT DESIGN
Objectives:
• To display medicine-related information clearly and informatively.
• To provide quick, readable, and structured results based on user
input or AI detection.
• To include warnings, usage instructions, and side effects in a
visually accessible format.
• To support future enhancements such as PDF export or voice
readouts.
29
CHAPTER 8
IMPLEMENTATION
8.1 MODULES
The major modules of the project are :
1. Image Upload Module
2. Image Recognition Module (AI/ML)
3. Medicine Lookup Module
4. Data Processing Module
5. Result Display Module
6. Flask Application Module
30
3. Medicine Lookup Module
• Description: Searches the two CSV datasets for detailed
information related to the recognized medicine name.
• Key Functions:
o Looks up the name in medicine_dataset.csv and
indian_medcine_data.csv.
o Extracts data like uses, side effects, substitutes, price, and
composition.
o Handles case-insensitive and partial matches.
31
routing, data flow, and communication between modules.
• Key Functions:
o Handles routes: / (home), /upload, /result.
o Manages image file uploads and model invocation.
o Passes data to templates for rendering results.
32
CHAPTER 9
SOFTWARE ENVIRONMENT
1. Home page:
INDEX:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0"/>
<title>Mediintell</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootst
rap.min.css" rel="stylesheet"
integrity="sha384-
SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZA
pcHrRKUc4W0kG879m7" crossorigin="anonymous">
<style>
body {
background-color: #e6f0ff;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-
serif;
}
header {
background-color: #007bff;
}
header a span {
color: white;
}
.nav-link {
color: white;
}
.nav-link.active {
background-color: #0056b3;
}
.hero-section {
background-color: white;
border-radius: 12px;
padding: 40px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
33
}
.section-title {
font-weight: 700;
color: #003366;
}
.feature-title {
font-weight: 600;
color: #004080;
}
.alert-warning {
background-color: #fff3cd;
border-color: #ffeeba;
color: #856404;
}
.features-images {
background-color: white;
border-radius: 12px;
padding: 30px;
margin-top: 40px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}
.feature-img {
width: 80%;
height: auto;
display: block;
margin: 0 auto;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.feature-img:hover {
transform: scale(1.03);
.custom-footer {
background-color: #f8f9fa;
border-top: 4px solid #2c3e50;
padding: 50px 30px;
font-family: 'Segoe UI', sans-serif;
}
.custom-footer h5.footer-heading {
font-weight: 600;
color: #2c3e50;
margin-bottom: 15px;
}
.custom-footer .footer-text {
34
color: #6c757d;
font-size: 15px;
line-height: 1.6;
}
.custom-footer .nav-link {
font-size: 15px;
color: #6c757d;
transition: color 0.2s ease-in-out;
}
.custom-footer .nav-link:hover {
color: #3498db;
text-decoration: underline;
}
.custom-footer .text-muted {
font-size: 14px;
}
.custom-footer img {
border-radius: 50%;
}
}
</style>
</head>
<body>
<div class="container py-4">
<!-- Header -->
<header class="d-flex flex-wrap justify-content-between align-
items-center py-3 mb-5 px-3 rounded shadow-sm">
<a href="/" class="d-flex align-items-center text-decoration-
none">
<img src="static/images/logo1.png" alt="Mediintell Logo"
width="80" height="80" class="me-3">
<span class="fs-3 fw-bold">Mediintell</span>
</a>
<ul class="nav nav-pills">
<li class="nav-item"><a href="{{ url_for('home') }}"
class="nav-link active" aria-current="page">Home</a></li>
<li class="nav-item"><a href="{{ url_for('checker') }}"
class="nav-link">MediCheck</a></li>
<li class="nav-item"><a href="{{ url_for('upload') }}"
class="nav-link">Medicine Identifier</a></li>
</ul>
</header>
35
<!-- New Hero Section with Image -->
<div class="row flex-lg-row-reverse align-items-center g-5 py-
5">
<div class="col-10 col-sm-8 col-lg-6">
<img src="static/images/pic1.png" class="d-block mx-lg-
auto img-fluid" alt="Bootstrap Themes" width="700"
height="500" loading="lazy">
</div>
<div class="col-lg-6">
<h1 class="display-5 fw-bold text-body-emphasis lh-1 mb-
3">
Smarter Healthcare Starts with Mediintell
</h1>
<p class="lead">
Discover a new era of intelligent health assistance.
Mediintell combines AI with medical knowledge to help you
check symptoms, analyze medicines, and make informed health
choices — anytime, anywhere.
</p>
<div class="d-grid gap-2 d-md-flex justify-content-md-
start">
<a href="{{ url_for('checker') }}" class="btn btn-primary
btn-lg px-4 me-md-2">Try Symptom Checker</a>
<a href="{{ url_for('upload') }}" class="btn btn-outline-
secondary btn-lg px-4">Explore Medicine Info</a>
</div>
</div>
</div>
<div class="mt-5">
<h4 class="feature-title"> AI-Powered Symptom
Checker</h4>
<p>Interact with our intelligent virtual assistant by entering
symptoms to receive preliminary analysis. Get insights on
potential health conditions, recommended actions, and when it's
crucial to consult a medical professional.</p>
36
<h4 class="feature-title mt-4"> Comprehensive Medicine
Analyzer</h4>
<p>Search and explore detailed information on medications
including usage, dosage guidelines, side effects, and possible
drug interactions — all aimed at promoting safer self-care.</p>
</div>
37
secondary d-inline-flex align-items-center justify-content-center
fs-4 flex-shrink-0 me-3" style="width: 60px; height: 60px;">
<img src="static/images/num1.png" alt="Symptom Icon"
class="img-fluid" style="max-width: 100%; max-height:
100%;">
</div>
<h3 class="fs-2 text-body-emphasis">Enter Your
Symptoms</h3>
<p>Describe your symptoms or take a picture of your
medication.</p>
</div>
<div class="feature col">
<div class="icon-square text-body-emphasis bg-body-
secondary d-inline-flex align-items-center justify-content-center
fs-4 flex-shrink-0 me-3" style="width: 60px; height: 60px;">
<img src="static/images/num2.png" alt="Symptom Icon"
class="img-fluid" style="max-width: 100%; max-height:
100%;">
</div>
<h3 class="fs-2 text-body-emphasis">AI Analysis</h3>
<p>Our AI processes the information to generate
insights</p>
</div>
<div class="feature col">
<div class="icon-square text-body-emphasis bg-body-
secondary d-inline-flex align-items-center justify-content-center
fs-4 flex-shrink-0 me-3" style="width: 60px; height: 60px;">
<img src="static/images/num3.png" alt="Symptom Icon"
class="img-fluid" style="max-width: 100%; max-height:
100%;">
</div>
<h3 class="fs-2 text-body-emphasis">Get Results</h3>
<p>Receive possible diagnoses or medication information
with recommendations.</p>
</div>
</div>
</div>
<!-- Heros -->
<div class="px-4 py-5 my-5 text-center">
<img src="static/images/hospital.png" class="d-block mx-
auto mb-4" alt="Symptom Icon" class="img-fluid" height="300"
width="300">
<h1 class="display-5 fw-bold text-body-emphasis">Your
Health Journey Starts Here</h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">Take the first step towards better
38
understanding your health with CareCompass.</p>
</div>
</div>
<!-- Footer -->
<footer class="custom-footer row row-cols-1 row-cols-sm-2 row-
cols-md-5 py-5 my-5 border-top">
<div class="col mb-3">
<a href="/" class="d-flex align-items-center mb-3 text-
decoration-none" aria-label="Mediintell">
<img src="static/images/logo1.png" alt="Mediintell Logo"
width="40" height="40">
</a>
<p class="text-muted">© 2025 Mediintell</p>
</div>
<div class="col mb-3">
</div>
<div class="col mb-3">
<h5 class="footer-heading">Mediintell</h5>
<p class="footer-text">An AI-powered health assistant to help
you understand your symptoms and identify medications quickly
and accurately.</p>
</div>
<div class="col mb-3">
<h5 class="footer-heading">Quick Links</h5>
<ul class="nav flex-column">
<li class="nav-item mb-2"><a href="{{ url_for('home') }}"
class="nav-link p-0 text-muted">Home</a></li>
<li class="nav-item mb-2"><a href="{{ url_for('checker') }}"
class="nav-link p-0 text-muted">Features</a></li>
<li class="nav-item mb-2"><a href="{{ url_for('upload') }}"
class="nav-link p-0 text-muted">Pricing</a></li>
</ul>
</div>
<div class="col mb-3">
<h5 class="footer-heading">Disclaimer</h5>
<p class="footer-text">This application is for informational
purposes only. Always consult a qualified healthcare professional
for medical advice.</p>
</div>
</footer>
</div>
</body>
</html>
39
CHECKER.HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AI Symptom Checker</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootst
rap.min.css" rel="stylesheet"
integrity="sha384-
SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZA
pcHrRKUc4W0kG879m7" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/[email protected]
rc.0/dist/css/select2.min.css" rel="stylesheet" />
<style>
body {
font-family: 'Segoe UI', sans-serif;
background-color: #f4f6f7;
margin: 0;
padding: 0;
}
.header {
background-color: #2c3e50;
color: white;
padding: 25px 15px;
text-align: center;
border-bottom: 4px solid #2980b9;
}
.header h2 {
margin: 0;
}
.form-box {
background-color: white;
padding: 40px;
margin: 40px auto;
max-width: 750px;
border-radius: 15px;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #2c3e50;
margin-bottom: 30px;
}
40
label {
font-weight: 500;
}
.select2-container--default .select2-selection--multiple {
border-radius: 8px;
padding: 10px;
font-size: 16px;
}
.submit-btn {
display: block;
width: 100%;
margin-top: 30px;
padding: 12px;
font-size: 16px;
background-color: #3498db;
color: white;
border: none;
border-radius: 8px;
transition: background-color 0.3s ease;
}
.submit-btn:hover {
background-color: #2980b9;
}
footer {
background-color: #2c3e50;
padding: 15px;
font-size: 14px;
}
footer p,
footer .footer-text,
footer .footer-heading,
footer .nav-link {
color: white !important;
}
footer .nav-link:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container py-4">
<header class="d-flex flex-wrap justify-content-between align-
items-center py-3 mb-5 px-3 rounded shadow-sm">
41
<a href="/" class="d-flex align-items-center text-decoration-
none">
<img src="static/images/logo1.png" alt="Mediintell Logo"
width="80" height="80" class="me-3">
<span class="fs-3 fw-bold">Mediintell</span>
</a>
<ul class="nav nav-pills">
<li class="nav-item"><a href="{{ url_for('home') }}"
class="nav-link active" aria-current="page">Home</a></li>
<li class="nav-item"><a href="{{ url_for('checker') }}"
class="nav-link">MediCheck</a></li>
<li class="nav-item"><a href="{{ url_for('upload') }}"
class="nav-link">Medicine Identifier</a></li>
</ul>
</header>
<div class="header">
<h2> AI HealthCare Portal</h2>
</div>
<div class="form-box">
<h1> Symptom Checker</h1>
<form method="POST" action="/result">
<div class="col-md-6">
<label for="gender" class="form-
label">Gender</label>
<select class="form-select" id="gender" required>
<option value="">Select gender</option>
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</div>
</div>
<div class="mb-3">
42
<label for="symptoms" class="form-label">Your
Symptoms</label>
<select name="symptoms" id="symptoms"
multiple="multiple" style="width: 100%">
{% for symptom in symptoms %}
<option value="{{ symptom }}">{{
symptom.replace('_', ' ').title() }}</option>
{% endfor %}
</select>
</div>
<div class="mb-4">
<label for="duration" class="form-
label">Duration</label>
<select class="form-select" id="duration" required>
<option value="">How long have you had this
symptom?</option>
<option>Less than 24 hours</option>
<option>1-3 days</option>
<option>4-7 days</option>
<option>1-2 weeks</option>
<option>More than 2 weeks</option>
</select>
</div>
43
quickly and accurately.</p>
</div>
<div class="col mb-3">
<h5 class="footer-heading">Quick Links</h5>
<ul class="nav flex-column">
<li class="nav-item mb-2"><a href="{{ url_for('home') }}"
class="nav-link p-0">Home</a></li>
<li class="nav-item mb-2"><a href="{{ url_for('checker')
}}" class="nav-link p-0">Features</a></li>
<li class="nav-item mb-2"><a href="{{ url_for('upload') }}"
class="nav-link p-0">Pricing</a></li>
</ul>
</div>
<div class="col mb-3">
<h5 class="footer-heading">Disclaimer</h5>
<p class="footer-text">This application is for informational
purposes only. Always consult a qualified healthcare professional
for medical advice.</p>
</div>
</footer>
44
MEDICINE_RESULT:
<!DOCTYPE html>
<html>
<head>
<title>Medicine Details</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootst
rap.min.css" rel="stylesheet"
integrity="sha384-
SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZA
pcHrRKUc4W0kG879m7" crossorigin="anonymous">
<style>
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(to right, #e0f7fa, #f1f8ff);
margin: 0;
padding: 0;
}
.main-content {
max-width: 800px;
margin: 40px auto;
background: #ffffff;
padding: 35px;
border-radius: 14px;
box-shadow: 0 12px 24px rgba(0, 123, 255, 0.1);
}
h2 {
text-align: center;
color: #0d6efd;
font-size: 28px;
margin-bottom: 30px;
}
.section {
margin-bottom: 25px;
}
.section h4 {
color: #1e3a8a;
margin-bottom: 10px;
font-size: 20px;
border-left: 4px solid #0d6efd;
padding-left: 10px;
45
}
ul {
padding-left: 20px;
}
li {
background: #f1f5f9;
padding: 10px 12px;
border-radius: 6px;
margin-bottom: 8px;
list-style: none;
transition: all 0.3s ease;
}
li:hover {
background-color: #dbeafe;
transform: translateX(5px);
}
.info-line {
font-size: 16px;
color: #333;
margin-bottom: 10px;
line-height: 1.6;
}
.info-label {
font-weight: 600;
color: #0d47a1;
}
.no-data {
color: red;
font-weight: 500;
text-align: center;
margin-top: 30px;
}
.full-width-header,
.full-width-footer {
width: 100vw;
margin-left: calc(-50vw + 50%);
background-color: #ffffff;
}
46
.footer-text, .footer-heading {
color: #1e3a8a;
}
</style>
</head>
<body>
{% if basic_info %}
<div class="section">
<h4>Uses:</h4>
<ul>
{% for i in range(4) %}
{% if basic_info['use' + i|string] %}<li>{{ basic_info['use'
+ i|string] }}</li>{% endif %}
{% endfor %}
</ul>
</div>
<div class="section">
47
<h4>Side Effects:</h4>
<ul>
{% for i in range(4) %}
{% if basic_info['sideEffect' + i|string] %}<li>{{
basic_info['sideEffect' + i|string] }}</li>{% endif %}
{% endfor %}
</ul>
</div>
<div class="section">
<h4>Substitutes:</h4>
<ul>
{% for i in range(4) %}
{% if basic_info['substitute' + i|string] %}<li>{{
basic_info['substitute' + i|string] }}</li>{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
{% if extra_info %}
<div class="section info-line"><span class="info-
label">Manufacturer:</span> {{ extra_info.manufacturer_name
}}</div>
<div class="section info-line"><span class="info-label">Salt
Composition:</span> {{ extra_info.salt_composition }}</div>
<div class="section info-line"><span class="info-
label">Description:</span> {{ extra_info.medicine_desc
}}</div>
{% endif %}
48
<p class="text-muted">© 2025 Mediintell</p>
</div>
<div class="col mb-3"></div>
<div class="col mb-3">
<h5 class="footer-heading">Mediintell</h5>
<p class="footer-text">An AI-powered health assistant to
help you understand your symptoms and identify medications
quickly and accurately.</p>
</div>
<div class="col mb-3">
<h5 class="footer-heading">Quick Links</h5>
<ul class="nav flex-column">
<li class="nav-item mb-2"><a href="{{ url_for('home') }}"
class="nav-link p-0 text-muted">Home</a></li>
<li class="nav-item mb-2"><a href="{{ url_for('checker')
}}" class="nav-link p-0 text-muted">Features</a></li>
<li class="nav-item mb-2"><a href="{{ url_for('upload') }}"
class="nav-link p-0 text-muted">Pricing</a></li>
</ul>
</div>
<div class="col mb-3">
<h5 class="footer-heading">Disclaimer</h5>
<p class="footer-text">This application is for informational
purposes only. Always consult a qualified healthcare professional
for medical advice.</p>
</div>
</footer>
</div>
</body>
</html>
49
RESULT.HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Diagnosis Result - Medi-Intel</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootst
rap.min.css" rel="stylesheet"
integrity="sha384-
SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZA
pcHrRKUc4W0kG879m7" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-
[email protected]/font/bootstrap-icons.css" rel="stylesheet">
<style>
body {
font-family: 'Segoe UI', sans-serif;
background-color: #f5f8fa;
margin: 0;
}
.header {
background: linear-gradient(90deg, #0f2027, #203a43,
#2c5364);
color: #ffffff;
padding: 40px 20px;
text-align: center;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.header h2 {
font-weight: 800;
font-size: 32px;
margin: 0;
}
.card {
background-color: white;
border-radius: 20px;
padding: 40px;
margin: 60px auto;
max-width: 850px;
box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
transition: transform 0.2s ease;
50
}
.card:hover {
transform: scale(1.01);
}
.section-title {
color: #2c3e50;
font-size: 22px;
font-weight: 600;
margin-bottom: 15px;
border-left: 4px solid #0d6efd;
padding-left: 10px;
}
ul {
padding-left: 20px;
}
li {
margin-bottom: 10px;
font-size: 16px;
}
p{
font-size: 16px;
line-height: 1.7;
}
.btn-check-again {
margin-top: 35px;
background-color: #0d6efd;
color: white;
padding: 12px 30px;
border-radius: 12px;
font-size: 16px;
font-weight: 600;
border: none;
text-decoration: none;
display: inline-block;
transition: background-color 0.3s ease, box-shadow 0.3s
ease;
}
.btn-check-again:hover {
background-color: #0b5ed7;
51
box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}
footer.custom-footer {
background-color: #2c3e50;
color: white;
}
.custom-footer a,
.custom-footer p,
.custom-footer h5 {
color: white !important;
}
.custom-footer a:hover {
color: #f1f1f1;
text-decoration: underline;
}
.header h2 {
font-size: 24px;
}
}
.result-card {
background-color: #fcfcfc;
max-width: 850px;
margin: auto;
transition: box-shadow 0.3s ease;
}
.section-heading {
margin-left: 10px;
}
.list-group-item {
52
background-color: #f8f9fa;
transition: all 0.2s ease-in-out;
font-size: 1rem;
padding: 12px 16px;
border: 1px solid #e0e0e0;
margin-bottom: 6px;
}
.list-hover:hover {
background-color: #eaf4ff;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(13, 110, 253, 0.1);
}
.description-box {
background-color: #ffffff;
border: 1px solid #dfe6e9;
border-radius: 8px;
padding: 16px;
box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
</style>
</head>
<body>
<div class="container py-4">
<!-- Header -->
<header class="d-flex flex-wrap justify-content-between
align-items-center py-3 mb-5 px-3 rounded shadow-sm">
<a href="/" class="d-flex align-items-center text-
decoration-none">
<img src="static/images/logo1.png" alt="Mediintell
Logo" width="80" height="80" class="me-3">
<span class="fs-3 fw-bold">Mediintell</span>
</a>
<ul class="nav nav-pills">
<li class="nav-item"><a href="{{ url_for('home') }}"
class="nav-link active" aria-current="page">Home</a></li>
<li class="nav-item"><a href="{{ url_for('checker') }}"
class="nav-link">MediCheck</a></li>
<li class="nav-item"><a href="{{ url_for('upload') }}"
class="nav-link">Medicine Identifier</a></li>
</ul>
</header>
<div class="header">
<h2><i class="bi bi-heart-pulse-fill"></i> Medi-Intel – AI
53
Healthcare Portal</h2>
</div>
54
<!-- Footer -->
<footer class="custom-footer row row-cols-1 row-cols-sm-2
row-cols-md-5 py-5 my-5 border-top">
<div class="col mb-3">
<a href="/" class="d-flex align-items-center mb-3 text-
decoration-none" aria-label="Mediintell">
<img src="static/images/logo1.png" alt="Mediintell
Logo" width="40" height="40">
</a>
<p>© 2025 Mediintell</p>
</div>
<div class="col mb-3"></div>
<div class="col mb-3">
<h5 class="footer-heading">Mediintell</h5>
<p class="footer-text">An AI-powered health assistant
to help you understand your symptoms and identify medications
quickly and accurately.</p>
</div>
<div class="col mb-3">
<h5 class="footer-heading">Quick Links</h5>
<ul class="nav flex-column">
<li class="nav-item mb-2"><a href="{{
url_for('home') }}" class="nav-link p-0">Home</a></li>
<li class="nav-item mb-2"><a href="{{
url_for('checker') }}" class="nav-link p-0">Features</a></li>
<li class="nav-item mb-2"><a href="{{
url_for('home') }}" class="nav-link p-0">Pricing</a></li>
</ul>
</div>
<div class="col mb-3">
<h5 class="footer-heading">Disclaimer</h5>
<p class="footer-text">This application is for
informational purposes only. Always consult a qualified
healthcare professional for medical advice.</p>
</div>
</footer>
</div>
</body>
</html>
55
UPLOAD_IMAGE.HTML:
<!DOCTYPE html>
<html>
<head>
<title>Upload Medicine Image</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootst
rap.min.css" rel="stylesheet"
integrity="sha384-
SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZA
pcHrRKUc4W0kG879m7" crossorigin="anonymous">
<style>
:root {
--primary: #4361ee;
--gray: #6c757d;
--transition: all 0.3s ease;
}
body {
font-family: 'Segoe UI', sans-serif;
background-color: #f8f9fa;
}
.upload-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 3rem 2rem;
text-align: center;
}
.upload-icon {
width: 80px;
height: 80px;
margin-bottom: 1.5rem;
color: var(--primary);
}
.upload-instructions {
color: var(--gray);
margin-bottom: 2rem;
max-width: 500px;
}
56
.file-upload-wrapper {
position: relative;
width: 100%;
max-width: 400px;
margin-bottom: 2rem;
}
.file-upload-label {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2.5rem;
border: 2px dashed #d1d5db;
border-radius: 12px;
background-color: #f9fafb;
cursor: pointer;
transition: var(--transition);
}
.file-upload-label:hover {
border-color: var(--primary);
background-color: rgba(67, 97, 238, 0.05);
}
.file-upload-label i {
font-size: 2rem;
color: var(--primary);
margin-bottom: 1rem;
}
.file-upload-label .browse-text {
color: var(--primary);
font-weight: 600;
text-decoration: underline;
}
.file-upload-label .file-types {
color: var(--gray);
font-size: 0.9rem;
margin-top: 0.5rem;
}
button[type="submit"] {
background-color: var(--primary);
color: white;
57
padding: 12px 24px;
border: none;
border-radius: 8px;
font-size: 1rem;
transition: var(--transition);
}
button[type="submit"]:hover {
background-color: #3a4dd8;
}
.footer-heading {
font-size: 16px;
font-weight: bold;
margin-bottom: 10px;
}
.footer-text {
font-size: 14px;
color: #6c757d;
}
</style>
</head>
<body>
<div class="container py-4">
<!-- Header -->
<header class="d-flex flex-wrap justify-content-between align-
items-center py-3 mb-5 px-3 rounded shadow-sm">
<a href="/" class="d-flex align-items-center text-decoration-
none">
<img src="static/images/logo1.png" alt="Mediintell Logo"
width="80" height="80" class="me-3">
<span class="fs-3 fw-bold">Mediintell</span>
</a>
<ul class="nav nav-pills">
<li class="nav-item"><a href="{{ url_for('home') }}"
class="nav-link active" aria-current="page">Home</a></li>
<li class="nav-item"><a href="{{ url_for('checker') }}"
class="nav-link">MediCheck</a></li>
<li class="nav-item"><a href="{{ url_for('upload') }}"
class="nav-link">Medicine Identifier</a></li>
</ul>
</header>
58
<h2> AI Medicine Checker</h2>
<p class="upload-instructions">Upload a photo of a medicine
or its packaging, and our AI will help identify it and provide
useful information.</p>
59
}}" class="nav-link p-0 text-muted">Pricing</a></li>
</ul>
</div>
<div class="col mb-3">
<h5 class="footer-heading">Disclaimer</h5>
<p class="footer-text">This application is for informational
purposes only. Always consult a qualified healthcare professional
for medical advice.</p>
</div>
</footer>
</div>
</body>
</html>
60
TRAIN_MODEL:PY:
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
import joblib
61
y = le.fit_transform(df['Disease'])
62
APP.PY:
from flask import Flask, render_template, request
import os
import pandas as pd
import numpy as np
import joblib
from ocr_local import detect_text_local
from fuzzywuzzy import fuzz
app = Flask(__name__)
UPLOAD_FOLDER = 'uploads'
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
df1 = pd.read_csv('medcine_dataset.csv')
df2 = pd.read_csv('indian_medcine_data.csv')
63
# Handle result
@app.route('/result', methods=['POST'])
def result():
selected_symptoms = request.form.getlist('symptoms')
selected_symptoms = [s.lower() for s in selected_symptoms]
# Encode input symptoms as a weighted vector
input_vector = []
for symptom in symptom_list:
if symptom in selected_symptoms:
input_vector.append(5) # Give a fixed high weight to
selected symptoms
else:
input_vector.append(0)
# Get prediction probabilities for all diseases
probabilities = model.predict_proba([input_vector])[0]
# Get indices of top 3 diseases
top_indices = np.argsort(probabilities)[::-1][:3]
top_diseases = label_encoder.inverse_transform(top_indices)
top_probs = probabilities[top_indices]
match_percentages = [int(prob * 100) for prob in top_probs]
#---------------------------------------------------IMAGE ANALYSIS-
----------------------------#
@app.route('/upload')
def upload():
return render_template('upload_image.html') # Upload image
page
@app.route('/process_upload', methods=['POST'])
def process_upload():
if 'image' not in request.files:
return "No image file"
file = request.files['image']
if file.filename == '':
return "No selected file"
64
filepath = os.path.join(app.config['UPLOAD_FOLDER'],
file.filename)
file.save(filepath)
# Local OCR
detected_text = detect_text_local(filepath)
medicine_names = df1['name'].tolist()
matched_name = match_medicine(detected_text,
medicine_names)
basic_info = df1[df1['name'] ==
matched_name].to_dict(orient='records')[0] if matched_name in
df1['name'].values else {}
extra_info = df2[df2['name'] ==
matched_name].to_dict(orient='records')[0] if matched_name in
df2['name'].values else {}
return render_template("medcine_result.html",
name=matched_name or detected_text,
basic_info=basic_info, extra_info=extra_info)
if __name__ == '__main__':
app.run(debug=True)
65
Ocr_local.py:
import pytesseract
import cv2
import os
import platform
import numpy as np
def set_tesseract_path():
if platform.system() == 'Windows':
default_path = r"C:\Program Files\Tesseract-
OCR\tesseract.exe"
if os.path.exists(default_path):
pytesseract.pytesseract.tesseract_cmd = default_path
else:
print("[⚠] Tesseract not found! Install from:
https://github.com/UB-Mannheim/tesseract")
def preprocess_image(image_path):
image = cv2.imread(image_path)
if image is None:
return None
def detect_text_local(image_path):
set_tesseract_path()
processed = preprocess_image(image_path)
if processed is None:
return ""
text = pytesseract.image_to_string(processed)
print("[ ] OCR Output:", text)
lines = text.split('\n')
clean_lines = [line.strip() for line in lines if line.strip()]
return clean_lines[0] if clean_lines else ""
66
CHAPTER -10
RESULTS
System Testing:
Types of Testing:
1. Unit Testing:
Unit testing involves testing individual components or functions
in isolation.
Applicable To:
• The AI/ML model function that extracts the medicine name from
the image.
• CSV lookup functions that return medicine details based on name.
• Data cleaning/formatting logic (e.g., list of side effects, uses).
67
2. Integration Testing
Integration testing ensures that different modules work together
correctly.
Applicable To:
• Integration between image upload → AI recognition → CSV
lookup → result display.
• Flask routing to confirm data flows from backend to frontend
correctly.
• Substitutes module loading another medicine’s info correctly.
3. Functional Testing
Functional testing checks whether the application performs as
intended.
Applicable To:
• Upload functionality works with valid images.
• The result page shows accurate and complete medicine details.
• Substitutes and drug interaction links are clickable and function
correctly.
• Proper error shown if an unrecognized image is uploaded.
68
loops).
6. Acceptance Testing
Context in Your Project:
Acceptance testing ensures the system meets all user and business
requirements before going live.
Applicable To:
• Ensuring that end users (patients or pharmacists) can reliably get
medicine info from uploaded images.
• Checking that all CSV data fields (price, side effects,
manufacturer) are correctly shown.
• Verifying that the UI is user-friendly and the results are
understandable.
69
10.1.1 TEST CASES
Test cases:
70
4. Data Processing Module
• Ensure that the system formats raw CSV data cleanly,
removing blanks, NaN values, and unnecessary characters.
• Verify that if some fields (like side effects or substitutes) are
missing, the system displays a placeholder such as "No data
available."
71
10.2 OUTPUT SCREENS
Home Page:
72
Image upload page:
Symptom page:
73
Result page:
74
CHAPTER 11
FUTURE SCOPE
2. Multilingual Support
Add support for multiple languages (e.g., Hindi, Tamil, Bengali) to
increase accessibility for users across India and beyond.
75
4. Barcode and QR Code Scanning
Add a barcode/QR scanner to recognize medicines directly from
packaging, enhancing speed and accuracy compared to image recognition
alone.
76
9. AI Model Enhancement
Improve the image recognition model using deep learning, better datasets,
and training with real-world medicine strip images to enhance accuracy.
Expand recognition to include syrups, ointment tubes, and injectable
vials.
77
CHAPTER 12
CONCLUSION
This project combines the power of Flask, Python, and AI/ML models
with practical data extracted from two structured CSV datasets. It
provides a user-friendly interface and bridges the information gap for
individuals who may not have immediate access to a pharmacist or
doctor. The system is also scalable and adaptable, making it suitable for
further improvements such as real-time data integration, mobile app
support, multilingual functionality, and even prescription OCR.
78
Key Achievements
Developed a clean and responsive web interface using Flask, HTML, and
CSS, allowing users to interact with the system easily without technical
expertise.
79
• Modular and Scalable Architecture
Designed the application with modular components (e.g., image
recognition, data processing, result display) that can be individually tested
and enhanced in the future.
80
CHAPTER 13
REFERENCES
81