0% found this document useful (0 votes)
12 views89 pages

MEDIINTE1 Shailesh

The document presents a mini project report on the development of an AI-Powered Medicine Checker Web Application aimed at providing users with reliable medication information through image recognition and machine learning. The application is designed to assist individuals, particularly those in underserved communities, in understanding their medications by simply uploading an image of the medicine. The report includes sections on motivation, system analysis, functional requirements, and future enhancements, highlighting the project's significance in improving healthcare accessibility and safety.

Uploaded by

sailesh872004
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)
12 views89 pages

MEDIINTE1 Shailesh

The document presents a mini project report on the development of an AI-Powered Medicine Checker Web Application aimed at providing users with reliable medication information through image recognition and machine learning. The application is designed to assist individuals, particularly those in underserved communities, in understanding their medications by simply uploading an image of the medicine. The report includes sections on motivation, system analysis, functional requirements, and future enhancements, highlighting the project's significance in improving healthcare accessibility and safety.

Uploaded by

sailesh872004
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/ 89

MEDIINTEL

AI-Powered Medicine Checker Web Application


AN INDUSTRIAL ORIENTED MINI PROJECT REPORT

Submitted
by

R.shailesh 22841A6698

in partial fulfillment for the award of the degree


of

BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE AND ENGINEERING

Under the Guidance of


Mr. Manipaul Panem
Asst professor (Dept of CSE)

AURORA’S TECHNOLOGICAL AND RESEARCH INSTITUTE


(Affiliated to JNTU, Hyderabad and approved by AICTE, New Delhi)
Parvathapur, Uppal, Hyderabad-500 039
JUNE 2025
AURORA’S TECHNOLOGICAL AND RESEARCH INSTITUTE
(Affiliated to JNTU, Hyderabad and approved by AICTE, New Delhi)
Parvathapur, Uppal, Hyderabad-500 039

DECLARATION

Powered Medicine Checker Web Application”, which is being


submitted by us in partial fulfilment of the requirements for the award of
the Bachelor of Technology in Computer Science and Engineering to
Aurora’s Technological and Research Institute, is the result of the
investigation carried out by us under the guidance of Mr. Manipaul Panem,
Assistant Professor, Department of CSE.

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.

Mr. Manipaul Panem


Assistant Professor
Department of CSE

Principal External Examin


(Signature with Seal) (Signature)
ACKNOWLEDGEMENT

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

This project aims to develop an AI-Powered Medicine Checker Web


Application is a smart healthcare tool designed to help users gain instant,
reliable insights about their medications using artificial intelligence. By simply
uploading an image of a medicine strip, box, or label, the system leverages
image recognition and machine learning techniques to identify the medicine
name and retrieve detailed information from integrated datasets.
The application is built using Python, Flask, HTML, CSS, and incorporates
two comprehensive CSV datasets—one containing medicine substitutes, uses,
and side effects, and another with detailed information about Indian medicines
including composition, manufacturer details, price, and drug interactions.
CHAPTERS CONTENT page

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:

In today's fast-paced world, patients often struggle to access clear and


immediate information about their prescribed medications. Many rely on
printed labels, verbal instructions, or fragmented internet searches, which can
be confusing or misleading—especially for the elderly, non-English speakers,
or people in rural areas. Moreover, counterfeit medicines and lack of
awareness about side effects or drug interactions can pose serious health risks.
The motivation behind this project is to create an intelligent, accessible tool
that simplifies healthcare by providing instant, accurate, and personalized
medicine information. By leveraging artificial intelligence and machine
learning, users can simply take a photo of any medicine and get trusted
insights—from uses and dosage to side effects and substitutes—within
seconds.

1.2CARING AI-POWERED :

Access to clear and reliable medical information is a fundamental aspect of


quality healthcare, yet many people face challenges when trying to
understand the medicines they are prescribed. In rural areas, under-resourced
clinics, or even urban settings with overburdened systems, patients may not
always receive complete guidance about how to take their medicines safely.
This project is developed with a care-focused mindset, aiming to bridge that
critical gap. By allowing users to simply upload a photo of a medicine strip
or package, the system provides instant, understandable,and accurate

1
information
about the drug. It’s particularly helpful for:

• 👵 Elderly users who may struggle to read small labels or remember


instructions.
• 🌐 Non-technical or non-English-speaking individuals needing
simplified guidance.
• 🏥 People in remote or rural areas without easy access to pharmacists
or doctors.
• 🛑 Anyone worried about counterfeit drugs or side effects.

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.

💬 Understanding the Problem


Many patients do not have the knowledge or resources to interpret complex
medical terms printed on prescription labels or packaging. Some may:

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.

1.3 HEALTHY MINDS:-

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.

The AI-Powered Medicine Checker Web Application is designed not only


to provide medical facts but also to foster peace of mind. By using image
recognition and intelligent data extraction, the app allows users to quickly
and confidently understand their medications. This builds a sense of
control, safety, and trust in the treatment process—critical components of
mental well-being.
🕊️ Reduces Anxiety: Users don’t have to second-guess how or when to
take a medicine.
🔍 Builds Clarity: Clear explanations about side effects, substitutes, and
precautions eliminate confusion.
🤝 Inspires Trust: Reliable data from validated sources gives users
confidence in the information.
💡 Promotes Awareness: Educating users about drug interactions and

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.

1.Medication Identification Technologies

Several existing applications, such as Pill Identifier by Drugs.com and


Medscape's Pill ID, allow users to identify medicines by entering physical
characteristics like shape, color, or imprint. However, these tools require
manual input, which can be inaccurate or inconvenient—especially for
visually impaired or elderly users.
Research papers (e.g., "Deep Learning for Pill Recognition Using
Convolutional Neural Networks," IEEE, 2019) have demonstrated how
CNN-based image processing can achieve high accuracy in pill
identification. However, these systems often rely on large, proprietary
datasets and are limited in terms of public accessibility and regional
medicine coverage.

5
2. Drug Information Systems and Knowledge Bases

There are large-scale drug databases such as RxNorm, DrugBank, and


WebMD, which provide structured drug information. These platforms
primarily serve healthcare professionals and are not optimized for layperson
understanding. Furthermore, they mostly cover U.S. or global drugs, with
limited relevance to Indian medicine brands, which vary in naming,
pricing, and composition.

Your use of the medcine_dataset.csv and indian_medcine_data.csv


addresses this gap by focusing on localized drug data, enhancing the tool’s
practicality for Indian users.

3. AI in Healthcare Support Applications

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.

In contrast, your project combines AI-driven OCR/image recognition with


medicinal data retrieval, making it more targeted and accessible. It's also
aligned with the vision presented in works like “AI for Patient Empowerment
in Healthcare” (Journal of Biomedical Informatics, 2020) which highlight
the importance of user-centered digital health tools.

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.

Contribution of the Proposed System


Your proposed system stands out by:
• Providing a user-friendly interface for non-expert users.
• Using AI/ML models to recognize medicine from images
automatically.
• Fetching real-time insights from Indian-specific medicine datasets.
• Enhancing medication awareness and mental clarity, especially in
low-resource or underserved settings.

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.

d) Databases (CSV Files)


• medcine_dataset.csv: Contains uses, substitutes, and side effects.
• indian_medcine_data.csv: Includes price, manufacturer, salt
composition, and drug interactions.

e) Image Upload & Processing


• Uploaded images are processed for name recognition.
• Uses image preprocessing + OCR/ML for accurate text extraction.

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

The feasibility study evaluates whether the proposed system can be


successfully developed, deployed, and maintained, considering various
practical aspects. It is divided into three main components: Technical,
Operational, and Economic feasibility.

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

No installation is required—users can access the system through a standard


web browser on a desktop, tablet, or smartphone. The front end is clean,
minimalistic, and responsive to work across different devices.
The solution can also be integrated with telemedicine platforms, e-health
kiosks, or hospital information systems, making it a valuable tool in
broader healthcare infrastructure.
c) Economic Feasibility
From a financial perspective, the system is cost-effective and practical to
develop and maintain:
• All major components (Flask, Pandas, Tesseract OCR) are open-

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.

Maintenance and upgrades can be handled by a small development team, and


the architecture allows for incremental enhancements without full system
rework. This makes the system sustainable in the long run, especially for
educational institutions, healthcare NGOs, or startups targeting public health
challenges.

13
CHAPTER 5
SYSTEM REQUIREMENT

5.1 This section outlines the technical and operational


requirements necessary for the successful development and deployment
of the AI-powered medicine checker application.
1. Functional Requirements
These define the core features and operations the system must perform:
1.Image Upload Functionality
o Users should be able to upload images of medicine strips, boxes,
or labels.
2.AI-Based Text Recognition
o The system must use OCR or a machine learning model to extract
the medicine name from the uploaded image.
3.Data Matching & Retrieval
o The extracted name must be matched against the
medcine_dataset.csv and indian_medcine_data.csv files.
4.Information Display
o Once the medicine is identified, the following must be shown:
▪ About the medicine
▪ Usage instructions
▪ Side effects
▪ Substitutes
▪ Price and manufacturer info
▪ Salt composition and drug interactions
5. Error Handling
o The system should gracefully handle issues like unreadable
images, unmatched medicine names, and invalid file uploads.

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

System design is transition from a user oriented document to programmers or


data base personnel. The design is a solution, how to approach to the
creation of a new system. This is composed of several steps. It provides the
understanding and procedural details necessary for implementing the system
recommended in the feasibility study. Designing goes through logical and
physical stages of development, logical design reviews the present physical
system, prepare input and output specification, details of implementation
planned prepare a logical design walkthrough.

6.1 SYSTEM ARCHITECTURAL DIAGRAM

17
6.2 UML DIAGRAMS

Unified Modeling Language (UML) is a standardized, general-purpose


modeling language used extensively in the field of object-oriented software
engineering. It was developed and is currently maintained by the Object
Management Group (OMG). UML serves as a universal language that enables
software developers to visualize, specify, construct, and document the design
of software systems efficiently.

UML is composed of two primary components: a meta-model that defines the


language rules and structure, and a notation system that provides graphical
representations for various elements of a software system. Although UML is
primarily associated with software modeling, it is also used for business
modeling and modeling of non-software systems.

The core objective of UML is to provide a consistent and standard means to


model complex, object-oriented software systems, helping developers
communicate system design clearly and effectively. UML integrates a set of
best practices from the software engineering industry, especially from large-
scale software development projects. It utilizes mostly graphical symbols to
describe system architecture, components, behaviors, and interactions, making
it easier to comprehend and share design insights among development teams.

Goals of UML

The primary goals behind the design and use of UML are as follows:

Expressive Modeling Language: To provide developers with a powerful and


easy-to-use visual modeling language that allows the creation and exchange of
meaningful system models.

18
Extensibility: To offer mechanisms that allow the core concepts of UML to be
extended and specialized according to specific needs.

Language Independence: To remain independent of any specific programming


language or software development process, ensuring wide applicability across
various platforms.

Formal Foundation: To provide a solid theoretical basis for understanding and


interpreting the modeling constructs used within UML.

Tool Support: To promote and support the development of a broad market for
object-oriented modeling tools.

Advanced Development Concepts: To support the modeling of high-level


software development concepts such as design patterns, frameworks,
components, and collaborations.

19
6.2.1 CLASS DIAGRAM:

In software engineering, a class diagram in the Unified Modeling Language


(UML) is a type of static structure diagram that describes the structure of a
system by showing the system's classes, their attributes, operations (or
methods), and the relationships among the classes. It explains which class
contains information.

20
6.2.2 USE CASE DIAGRAM:

A use case diagram in the Unified Modeling Language (UML) is a type of


behavioural diagram defined by and created from a Use-case analysis.
Its purpose is to present a graphical overview of the functionality
provided by a system in terms of actors, their goals (represented as use
cases), and any dependencies between those use cases.

21
6.2.3 COLLABORATION DIAGRAM:

collaboration diagrams represent the same information but differently.


Instead of showing the flow of messages, it depicts the architecture of the
object residing in the system as it is based on object-oriented
programming. An object consists of several features. Multiple objects
present in the system are connected to each other. The collaboration
diagram. The collaboration diagram is used to show the relationship
between the objects in a system. Both the sequence and the, which is also
known as a communication diagram The collaborations are used when it
is essential to depict the relationship between the object.

22
6.2.4 SEQUENCE DIAGRAM:

A sequence diagram in Unified Modeling Language (UML) is a kind of


interaction diagram that shows how processes operate with one another
and in what order. It is a construct of a Message Sequence Chart.
Sequence diagrams are sometimes called event diagrams, event scenarios,
and timing diagrams.

23
6.2.5 DEPLOYMENT DIAGRAM:

The deployment diagram visualizes the physical hardware on which the


software will be deployed. It is the static deployment view of a system. It
involves the nodes and their relationships. It ascertains how software is
deployed on the hardware. It maps the software architecture.

24
6.2.6 STATECHART DIAGRAM:

A State chart Diagram (also known as a State Diagram) is a type of


UML (Unified Modeling Language) behavioral diagram that represents
the states of an object and the transitions between those states in
response to events. It is particularly useful for modeling the dynamic
behavior of a system, especially when the system involves complex state-
dependent logic.

25
6.2.7 ACTIVITY DIAGRAM:

Activity diagrams are graphical representations of workflows of stepwise


activities and actions with support for choice, iteration and concurrency.
In the Unified Modeling Language, activity diagrams can be used to
describe the business and operational step by-step workflows of
components in a system. An activity diagram shows the overall flow of
control.

26
6.2.8 DATAFLOW DIAGRAM:

A Data Flow Diagram (DFD) is a graphical representation that depicts the


flow of data within a system. It shows how data moves from input to
processing and eventually to output through various system =entities
rather than focusing on program logic or control flow.

27
CHAPTER 7
INPUT AND OUTPUT DESIGN

7.1 INPUT DESIGN

Input design is a critical aspect of any system, as it determines how users


provide data and how that data is processed accurately and efficiently. In
the AI-powered medicine checker web application, input design focuses
on enabling users to submit medicine information either manually or
through image-based recognition. The system supports two primary
modes of input: text input and image upload. For manual input, users can
type the name of a medicine into a clearly labeled input field. The system
applies validation rules to ensure correct spelling, avoid special
characters, and prevent empty submissions. This input is then used to
search the internal datasets for relevant medicine details.

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

Output design focuses on how the processed information is presented to


users in a clear, structured, and meaningful way. In the AI-powered
medicine checker web application, the output is generated after a user
inputs a medicine name manually or uploads an image that is processed
by the AI model. Once the system identifies the medicine, it retrieves
relevant data from two CSV datasets—medcine_dataset.csv and
indian_medcine_data.csv. The output includes critical details such as the
medicine's name, uses, dosage instructions, side effects, and manufacturer
information.

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

8.1.1 MODULES DESCRIPTION

1. Image Upload Module


• Description: Enables users to upload an image of a medicine
strip, box, or label through the web interface.
• Key Functions:
o Accepts .jpg, .png, .jpeg files.
o Performs basic validation (file type, size).
o Forwards the image to the backend for processing.

2. Image Recognition Module (AI/ML)


• Description: Processes the uploaded image to detect and extract the
medicine name using AI/ML or OCR techniques.
• Key Functions:
o Preprocesses the image (resize, enhance, grayscale).
o Uses OCR or trained AI model to recognize text.
o Returns the predicted medicine name for lookup

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.

4. Data Processing Module


• Description: Cleans, formats, and combines the data retrieved from
the CSVs for display on the front end.
• Key Functions:
o Handles missing values and duplicates.
o Organizes data into structured format (e.g., JSON or dictionary).
o Prepares sections such as uses, side effects, and drug interactions.

5. Result Display Module


• Description: Renders the processed medicine information in a
clear, user-friendly format on the result page.
• Key Functions:
o Displays sections: About, Usage, Side Effects, Precautions,
Substitutes, etc.
o Uses HTML/CSS templates (via Jinja2) to present content.
o Supports responsive design for all devices.

6. Flask Application Module


• Description: Acts as the core backend logic using Flask, managing

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>

<!-- Original Hero Section -->


<div class="hero-section">
<h1 class="section-title mb-3">Welcome to Mediintell</h1>
<p class="lead">Mediintell is a cutting-edge digital health
assistant built to provide intelligent, accessible, and reliable
medical insights. Our mission is to empower individuals with
personalized tools that enhance healthcare awareness and
decision-making.</p>

<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>

<div class="alert alert-warning mt-4" role="alert">


⚠ <strong>Disclaimer:</strong> Mediintell is intended for
informational purposes only and should not be used as a
substitute for professional medical advice, diagnosis, or
treatment.
</div>

<p class="mt-4 fw-semibold">Experience the future of


healthcare — intelligent, intuitive, and focused on your well-
being.</p>
</div>

<!-- Features Image Section -->


<div class="features-images mt-5">
<h2 class="section-title mb-4">Features</h2>
<div class="row g-4">
<div class="col-md-6 text-center">
<a href="{{ url_for('checker') }}" target="_blank">
<img src="static/images/pic2.png" alt="Symptom
Checker" class="feature-img">
</a>
<p class="mt-2 fw-medium">Symptom Checker</p>
</div>
<div class="col-md-6 text-center">
<a href="{{ url_for('upload') }}" target="_blank">
<img src="static/images/pic3.png" alt="Medicine
Analyzer" class="feature-img">
</a>
<p class="mt-2 fw-medium">Medicine Analyzer</p>
</div>
</div>
</div>
<!-- Features Section -->
<div class="container px-4 py-5" id="featured-3">
<h2 class="pb-2 border-bottom">How It Works</h2>
<div class="row g-4 py-5 row-cols-1 row-cols-lg-3">
<div class="feature col">
<div class="icon-square text-body-emphasis bg-body-

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="row mb-3">


<div class="col-md-6">
<label for="yourage" class="form-
label">Age</label>
<input type="number" class="form-control"
id="yourage" placeholder="Enter your age" min="3" max="90"
required>
</div>

<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>

<button type="submit" class="submit-btn">Check


Diagnosis</button>
</form>
</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>© 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

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>

<!-- JS Libraries -->


<script src="https://code.jquery.com/jquery-
3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]
rc.0/dist/js/select2.min.js"></script>
<script>
$(document).ready(function () {
$('#symptoms').select2({
placeholder: "Search and select your symptoms",
allowClear: true
});
});
</script>
</div>
</body>
</html>

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>

<!-- Header -->


<div class="container py-4">
<header class="full-width-header d-flex flex-wrap justify-
content-between align-items-center py-3 px-5 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>

<!-- Main Content -->


<div class="main-content">
<h2> Medicine Details</h2>
<p class="info-line"><span class="info-label">Detected
Name:</span> {{ name }}</p>

{% 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 %}

{% if not basic_info and not extra_info %}


<p class="no-data"> No data found in the CSV for the
detected text.</p>
{% endif %}
</div>

<!-- Footer -->


<footer class="full-width-footer row row-cols-1 row-cols-sm-2
row-cols-md-5 py-5 mt-5 px-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>

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;
}

@media (max-width: 576px) {


.card {
padding: 25px 20px;
margin: 30px 10px;
}

.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;
}

.icon-blue { color: #0d6efd; }


.icon-green { color: #27ae60; }
.icon-cyan { color: #17a2b8; }

.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>

<div class="result-card card shadow border-0 rounded-4 p-4


mb-5">
<div class="section-title mb-3">
<i class="bi bi-clipboard2-pulse-fill icon-blue"></i>
<span class="section-heading">Top Predicted
Conditions</span>
</div>
<ul class="list-group list-group-flush mb-4">
{% for disease, percentage in results %}
<li class="list-group-item list-hover rounded-2">
<strong class="text-primary">{{ disease }}</strong>
— {{ percentage }}% match
</li>
{% endfor %}
</ul>

<div class="section-title mb-2">


<i class="bi bi-journal-medical icon-green"></i>
<span class="section-heading">Description (Top
Match)</span>
</div>
<div class="description-box">
<p class="text-secondary">{{ description }}</p>
</div>

<div class="section-title mb-2">


<i class="bi bi-shield-check icon-cyan"></i>
<span class="section-heading">Recommended
Precautions</span>
</div>
<ul class="list-group list-group-flush mb-4">
{% for p in precautions %}
<li class="list-group-item list-hover rounded-2"> {{
p }}</li>
{% endfor %}
</ul>

<a href="/checker" class="btn-check-again mt-3">


<i class="bi bi-arrow-left-circle me-2"></i>Check
Another
</a>
</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>

<!-- Upload Section -->


<div class="upload-container">

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>

<form action="/process_upload" method="POST"


enctype="multipart/form-data">
<div class="file-upload-wrapper">
<label for="file-upload" class="file-upload-label">
<i class="bi bi-cloud-upload"></i>
<span class="browse-text">Click to browse</span>
<span class="file-types">Accepted formats: JPG,
PNG</span>
<input id="file-upload" type="file" name="image"
accept="image/*" required style="display: none;">
</label>
</div>
<button type="submit">Check Medicine</button>
</form>
</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')

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>

<!-- Bootstrap Icons CDN (for upload icon) -->


<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap-
[email protected]/font/bootstrap-icons.css">

</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

# Load all CSV files


df = pd.read_csv('dataset.csv')
severity_df = pd.read_csv('Symptom_severity.csv')
description_df = pd.read_csv('Symptom_description.csv')
precaution_df = pd.read_csv('Symptom_precaution.csv')

# Create Symptom → Weight dict


severity_dict = dict(zip(severity_df['Symptom'].str.lower(),
severity_df['weight']))

# Get unique list of symptoms from dataset.csv


symptom_cols = [col for col in df.columns if
col.startswith("Symptom_")]
all_symptoms = set()
for col in symptom_cols:
all_symptoms.update(df[col].dropna().str.lower())
all_symptoms = sorted(all_symptoms)
print(f"Total unique symptoms: {len(all_symptoms)}")

# Create binary feature matrix with severity weight


def encode_symptoms(row):
symptom_vector = []
for symptom in all_symptoms:
if symptom in row.values:
weight = severity_dict.get(symptom, 1)
symptom_vector.append(weight)
else:
symptom_vector.append(0)
return pd.Series(symptom_vector)
X = df[symptom_cols].apply(lambda row: row.str.lower() if
row.notna().any() else row, axis=1)
X_encoded = X.apply(encode_symptoms, axis=1)
X_encoded.columns = all_symptoms

# Encode target labels (diseases)


le = LabelEncoder()

61
y = le.fit_transform(df['Disease'])

# Train the model


X_train, X_test, y_train, y_test = train_test_split(X_encoded, y,
test_size=0.2, random_state=42)
model = RandomForestClassifier()
model.fit(X_train, y_train)

# Save model and encodings


joblib.dump(model, 'model.pkl')
joblib.dump(all_symptoms, 'symptom_list.pkl')
joblib.dump(le, 'label_encoder.pkl') # Save for decoding
predictions

# Prepare precautions and descriptions


precaution_dict = {}
for _, row in precaution_df.iterrows():
disease = row['Disease']
precaution_dict[disease] = [row[f'Precaution_{i}'] for i in
range(1, 5) if pd.notna(row[f'Precaution_{i}'])]
description_dict = dict(zip(description_df['Disease'],
description_df['Description']))
joblib.dump(precaution_dict, 'precautions.pkl')
joblib.dump(description_dict, 'descriptions.pkl')

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

# Load the trained model and supporting files


model = joblib.load('model.pkl')
symptom_list = joblib.load('symptom_list.pkl')
label_encoder = joblib.load('label_encoder.pkl')
precautions_dict = joblib.load('precautions.pkl')
descriptions_dict = joblib.load('descriptions.pkl')

df1 = pd.read_csv('medcine_dataset.csv')
df2 = pd.read_csv('indian_medcine_data.csv')

def match_medicine(ocr_text, med_list):


best_match = ""
best_score = 0
for med in med_list:
score = fuzz.ratio(ocr_text.lower(), med.lower())
if score > best_score:
best_match = med
best_score = score
return best_match if best_score >= 70 else None
# Home page
@app.route('/')
def home():
return render_template('index.html')
# ----------------------------------SYMTOM CHECKER---------------
-----------------------#
# Symptom checker form
@app.route('/checker')
def checker():
# Convert symptom list to title format for UI
symptoms_ui = [s.replace('_', ' ').title() for s in symptom_list]
return render_template('checker.html',
symptoms=symptom_list)

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]

# Prepare results for display


results = zip(top_diseases, match_percentages)
# Use the top disease for additional info
top_disease = top_diseases[0]
description = descriptions_dict.get(top_disease, "No
description available.")
precautions = precautions_dict.get(top_disease, ["No
precautions available."])
return render_template('result.html', results=results,
description=description, precautions=precautions)

#---------------------------------------------------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

gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)


# sharpen
kernel = np.array([[0, -1, 0], [-1, 5,-1], [0, -1, 0]])
sharp = cv2.filter2D(gray, -1, kernel)
# blur to reduce noise
blur = cv2.medianBlur(sharp, 3)
# thresholding
_, thresh = cv2.threshold(blur, 0, 255, cv2.THRESH_BINARY
+ cv2.THRESH_OTSU)
return thresh

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

10.1 SYSTEM TESTING

System Testing:

System Testing is the process of testing the complete and integrated


application to evaluate its compliance with the specified requirements. In
your project, system testing ensures that:
• Users can successfully upload medicine images.
• The AI model correctly recognizes medicine names.
• The system retrieves and displays accurate and complete data.
• All modules (UI, AI/ML, CSV access, Flask backend) work
together as expected.

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.

4.White Box Testing


White box testing involves testing internal logic, code paths,
and algorithms.
Applicable To:
• Validating each conditional path in the image recognition and
CSV processing logic.
• Ensuring that functions for merging datasets handle
empty/null cases correctly.
• Unit testing internal Python functions (logic, error catching,

68
loops).

5. Black Box Testing


Context in Your Project:
Black box testing evaluates the application from the
user's perspective, without looking at the internal code.
Applicable To:
• Uploading images and checking if correct results are
displayed.
• Testing invalid image uploads (wrong format, blurry,
etc.).
• Testing browser-based functionality without accessing
backend code.

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:

1. Image Upload Module


• Verify that the system accepts a valid image of a medicine strip
(e.g., "Dolo 650") and proceeds to processing.
• Check that uploading a file in an unsupported format (e.g., .txt)
shows an error message: "Invalid file type."
• Ensure that uploading an empty or blank file displays the error
message: "No image detected."
• Confirm that uploading an image file larger than the allowed size
(e.g., 5MB) either compresses it or returns an error message.

2. Image Recognition Module (AI/ML)


• Verify that the system accurately extracts the medicine name from
a clear image of a medicine label (e.g., "Paracetamol").
• Test with a blurry image and check that the system displays an
appropriate message such as: "Unable to recognize the image."
• Check if the system can still recognize a medicine name from a
partial label (e.g., half of a "Crocin" strip).

3. Medicine Lookup Module


• Confirm that when a known medicine (e.g., "Dolo 650") is recognized,
the system correctly retrieves and merges details from both CSV files.
• Check that if a medicine is found in only one CSV file, the available
information is displayed with a note indicating incomplete data.
• Verify that when a medicine name is not found in either CSV file, the
system shows the message: "Medicine not found."

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."

5. Result Display Module


• Confirm that all relevant information (uses, side effects, precautions,
manufacturer, etc.) is clearly displayed when a valid medicine is
processed.
• Test that each substitute medicine listed is a clickable link that leads to
its detailed information.
• Verify that the result page is mobile-friendly and all sections are clearly
readable on smaller screens.

6. Flask Application Module


• Check that submitting the image upload form correctly redirects the user
to the result route.
• Verify that the /result route renders the correct output based on the AI-
recognized medicine name.
• Confirm that the Flask server can handle multiple simultaneous image
uploads without performance issues or crashes.

71
10.2 OUTPUT SCREENS

Home Page:

User detail page:

72
Image upload page:

Symptom page:

73
Result page:

74
CHAPTER 11
FUTURE SCOPE

Future Scope of the Project

The AI-Powered Medicine Checker web application has strong potential


for future enhancement and expansion. Here are several key directions in
which the system can evolve:

1. Integration with Real-Time Drug Databases


Connect the app to live APIs like Drugs.com, R x Norm, or Indian FDA
databases to fetch the latest drug updates, availability, or recall
information.

Automatically update discontinued medicines and substitutions without


manual CSV updates.

2. Multilingual Support
Add support for multiple languages (e.g., Hindi, Tamil, Bengali) to
increase accessibility for users across India and beyond.

Translate medicine descriptions, uses, and side effects dynamically using


language libraries or translation APIs.

3. Mobile App Development


Convert the web app into a mobile app (Android/iOS) for ease of access
using native or hybrid frameworks like React Native or Flutter.
• Use phone camera integration for direct medicine scanning and
recognition.

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.

5. Voice Assistance Feature


Enable a voice-controlled interface using speech-to-text and text-to-
speech features for hands-free operation, especially helpful for elderly
or visually impaired users.

6. User Authentication and History Tracking


Allow users to log in and track past queries, save frequently searched
medicines, and build a personal medicine cabinet.
Useful for patients who take multiple medications and want to manage
their prescriptions.

7. Dosage and Interaction Alerts


Add personalized dosage reminders and warnings for drug interactions
based on input from the user or fetched from databases.
Can be extended to detect age-based, allergy-based, or condition-specific
contraindications.

8. Prescription Upload and OCR


Enable users to upload full prescriptions and extract all listed medicines
using OCR (Optical Character Recognition) for bulk medicine lookup.
Helps reduce manual entry and supports pharmacists or clinics.

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.

10. Integration with Pharmacies and E-Commerce


Collaborate with online pharmacies to show stock status and provide
purchase options.

Link substitute medicines to their prices and availability for user


convenience.

77
CHAPTER 12
CONCLUSION

The AI-Powered Medicine Checker Web Application is an innovative


step toward leveraging artificial intelligence and machine learning to
enhance public access to medical information. By allowing users to
simply upload an image of a medicine strip, label, or box, the system
intelligently recognizes the medicine name and provides critical details
such as its uses, side effects, precautions, substitutes, and pricing.

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.

Overall, this application not only simplifies medicine identification and


understanding for everyday users but also promotes safer and more
informed drug usage. It represents a significant step toward making
healthcare more accessible, intelligent, and responsive.

78
Key Achievements

• AI-Based Medicine Recognition


Successfully implemented an AI/ML module capable of recognizing
medicine names from uploaded images of tablet strips, boxes, or labels.
• Automated Data Retrieval from CSV Datasets
Efficiently extracted and displayed medicine-related data—including
uses, side effects, price, manufacturer, and substitutes—from two
structured CSV files.

• User-Friendly Web Interface

Developed a clean and responsive web interface using Flask, HTML, and
CSS, allowing users to interact with the system easily without technical
expertise.

• Data Integration from Multiple Sources


Merged medicine data from two distinct datasets
(medicine_dataset.csv and indian_medicine_data.csv)
to offer a more complete and informative result.

• Dynamic Display of Medicine Information


Dynamically presented important information like precautions, drug
interactions, and alternative medicines in an organized and accessible
format.

• Error Handling and Fail-Safe Mechanisms


Implemented graceful error messages and fallback logic for unrecognized
images, invalid file formats, and missing data.

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.

• Basic Substitute Interaction Feature


Enabled users to click on substitute medicines and fetch their
corresponding data, enhancing exploration and user engagement.

• Strong Foundation for Future Enhancements


Created a strong base that supports future features like real-time database
integration, mobile app development, voice input, and multilingual
support.

80
CHAPTER 13
REFERENCES

The official Flask documentation was extensively referred to for


understanding routing, request handling, and rendering templates, which
played a crucial role in building the backend of the application.

The Pandas library documentation was used to implement data


handling and processing operations, especially for reading, filtering, and
merging the two CSV datasets containing medicine-related information.

The project utilized concepts from the OpenCV documentation for


basic image preprocessing techniques to enhance image quality before
passing it to the AI model for recognition.

The Scikit-learn documentation provided guidance on implementing


machine learning models used in image classification and medicine name
prediction.

The TensorFlow and Keras documentation was referred to while


experimenting with deep learning approaches for more accurate image
recognition.

GitHub repositories and developer blogs, including those from


Towards Data Science, provided practical examples and ideas related to
OCR, AI/ML integration, and full-stack Flask applications.

81

You might also like