Uploaded by khushal.kce21

Identification Of Indian Monuments

Identification of Indian Monument
Krishkumar Viramgama
CSE department
Pandit Deendayal Energy University
Gandhinagar, India
krish.vce21@sot.pdpu.ac.in
Monil Desai
CSE department
Pandit Deendayal Energy University
Gandhinagar, India
monil.dce21@sot.pdpu.ac.in
Jainil Doshi
CSE department
Pandit Deendayal Energy University
Gandhinagar, India
jainil.dce21@sot.pdpu.ac.in
Khushal Kathad
CSE department
Pandit Deendayal Energy University
Gandhinagar, India
khushal.kce21@sot.pdpu.ac.in
Abstract—This report presents an innovative approach to
addressing challenges faced by tourists exploring India's
cultural heritage through the integration of machine learning
and web development. The project involves a TensorFlowbased model for monument identification, offering
recommendations for nearby attractions and providing an
enriched user experience. The technological fusion of
machine learning and JavaScript, specifically Leaflet for map
visualization, offers a seamless and interactive exploration of
historical sites. Future enhancements include advanced
algorithms and the convergence of artificial intelligence and
augmented reality. In essence, this project aims to redefine
the tourist experience, leveraging technology to provide a
comprehensive solution for understanding, exploring, and
planning visits to historical landmarks in India, fostering a
deeper appreciation for history and encouraging the
exploration of new cultural horizons.
Keywords—Machine Learning, Monument Identification,
Cultural Heritage, TensorFlow, Leaflet, Web Development,
Tourism, Augmented Reality, Blockchain, Convolutional
Neural Networks (CNN), K-Nearest Neighbors (KNN).
I. INTRODUCTION
India is a land adorned with a wealth of magnificent historic
structures and sites that narrate compelling tales of our past
and culture. In this report, we will delve into India's rich
history, the significance of these unique places, the thriving
tourism industry, and the challenges encountered by those
who embark on journeys to explore them.
India is a land full of incredible buildings that tell stories
about its history and culture. There are beautiful old temples
that are not just religious but also showcase amazing art and
beliefs. Then, there are grand Mughal monuments like the
famous Taj Mahal, which blend different architectural styles
and show the Mughal way of life. And do not forget the
British-made India Gate, which reminds us of the colonial
era.
But India's cultural heritage is not just about buildings. It is
also in our traditional dances, art, and the many languages we
speak. All of this makes India unique and special.
We have a rich history with diverse languages, festivals, and
customs. Whether you are admiring the stunning temples or
XXX-X-XXXX-XXXX-X/XX/$XX.00 ©20XX IEEE
Jugal Chhatriwala
CSE department
Pandit Deendayal Energy University
Gandhinagar, India
jugal.cce21@sot.pdpu.ac.in
joining in the lively celebrations of festivals like Diwali and
Holi, India's history and culture are fascinating for people
from all over the world. India is a place where the past and
present come together, and every corner has a story to share.
These extraordinary landmarks draw visitors from around the
world who seek to learn about India's history and marvel at
its architectural gems. India is a great place for travelers. You
can see amazing things like the famous Taj Mahal or relax by
the peaceful backwaters in Kerala. Whether you want to visit
old temples, enjoy tasty food, or go on a safari to see animals,
India has something for everyone. It is a place where you can
make wonderful memories and experience different
traditions and beautiful places. Come and explore all the
exciting things India has to offer!
When tourists set out to explore these historical sites, they
encounter certain challenges:
- Local Guides and Language Barrier: Language differences
can hinder effective communication with local guides,
leaving tourists without valuable insights.
- Access to Information: Accessing accurate and
comprehensive information about these places is often a
challenge, which can impact the visitor experience.
- Finding Nearby Attractions: Travelers often aspire to visit
multiple sites in a day, making trip planning challenging
without the right resources.
This report will explore how technology can address these
challenges and enhance the experience of exploring India's
cultural heritage. We will delve into potential solutions that
can make it easier for people to understand and enjoy these
sites to the fullest.
In this project, our goal is to develop a solution that utilizes
machine learning to predict the identity of a monument based
on a provided photo. Additionally, our system will offer
recommendations for nearby monuments, facilitating visitors'
exploration of the surrounding area. Furthermore, we will
provide concise and informative descriptions of the identified
monument, enhancing the overall visitor experience.
II. BACKGROUND
A. Technological Stack Overview
Our project presents a web-based application designed for the
identification of monuments from uploaded images. It relies
on a range of technologies and libraries to deliver its
functionality. The essential technologies and tools employed
in the project are detailed below:
displays information about the identified monument,
including its name, city, coordinates, and other monuments
within the same city.
Programming Language - Python: Python was chosen as
the primary programming language for its versatility and rich
library ecosystem, making it a well-suited choice for this
project. Python as well provides the Machine Learning
libraries, web-frameworks, and image processing.
Furthermore, it likewise handles the operating system
interactions.
It is essential to note that the successful execution of the
project code requires additional dependencies and files, such
as the pre-trained TensorFlow model and HTML templates.
Web Framework - Flask: The web application is built using
Flask, a lightweight Python micro web framework. Flask
streamlines web development tasks such as routing, request
handling, and HTML template rendering. Flask is easy to
implement and also provides the robust functionalities.
Numerical Processing - NumPy (import numpy as np):
NumPy is a fundamental package for scientific computing in
Python. It plays a critical role in numerical operations and
array manipulation, ensuring efficient image processing.
Numpy arrays are much faster compared to the Python lists,
this speed is essential for the large computation.
Image Processing - Pillow (import from PIL): The project
leverages the Python Imaging Library (PIL), specifically its
modern version, Pillow, for image processing. This library
simplifies the handling and manipulation of uploaded image
files.
Machine Learning Framework - TensorFlow (import
tensorflow as tf): TensorFlow, an open-source machine
learning framework, is integrated into the project. A pretrained deep learning model is loaded to enable monument
identification.
WSGI Utility Library - Werkzeug (from werkzeug.utils):
Werkzeug, a Web Server Gateway Interface (WSGI) utility
library for Python, is used to enhance the security of uploaded
image filenames, ensuring system reliability.
Operating System Interaction - OS (import os): The OS
module provides support for operating system-specific
functionalities, primarily focused on file operations. It
ensures the proper management of image files and
directories.
Frontend Technologies - HTML and CSS: The user
interface of the web application is developed using HTML
for content structuring and CSS for styling. These
technologies contribute to an appealing and user-friendly
interface.
Template Engine: The Flask framework incorporates the
template engine for dynamic content rendering within HTML
templates. This dynamic content includes details about the
recognized monument.
The project functions by presenting a web page that features
an image upload form. Upon image submission, the Flask
application processes it using the pre-trained TensorFlow
model for monument identification. Afterward, the web page
B. Machine Learning Model:Behind the scenes
Let's delve into a detailed explanation of each section of the
Jupyter code, highlighting the steps involved in building and
training an image classification model using the TensorFlow
and Keras libraries. The code focuses on leveraging a
downloaded dataset named "images" for the purpose of
building the model for our website.
1. Initializing and Downloading the Dataset:
The code commences with the necessary setup, including the
installation of required packages. It then proceeds to initialize
the environment to download the dataset. In this case, the
dataset is denoted as "images." The code encapsulates the
process of interfacing with an external source, fetching both
images and corresponding annotations. The annotations play
a crucial role in organizing the data, attributing labels to
images.
2. Model Architecture:
The architectural design of the image classification model
takes center stage in the subsequent section. The chosen
architecture employs MobileNetV2 as a feature extractor.
This pre-existing architecture has already been trained on the
ImageNet dataset and serves as a robust foundation. The code
unfolds with the instantiation of MobileNetV2, excluding the
final classification layer. Following this, additional dense
layers are appended to the model, culminating in a softmax
layer for classification. Importantly, the MobileNetV2
backbone is intentionally frozen, preserving the prelearned
features, while only the newly introduced layers are marked
as trainable.
3. Training the Model:
With the model architecture in place, the code proceeds to the
training phase. The model is compiled using the Adam
optimizer and categorical cross entropy loss, essential
components for the supervised learning task at hand. To
facilitate effective training, a data generator is implemented
using the ImageDataGenerator from Keras. This generator
preprocesses and augments the images, enhancing the
model's ability to generalise.
saved model file is uploaded, completing the cycle of model
training and storage.
In essence, this detailed code meticulously guides through the
entire process of image classification, starting from the
initialization and download of the dataset to the construction,
training, and evaluation of a sophisticated deep learning
model. Each section of the code is elucidated, ensuring clarity
and comprehensibility, while also fostering replicability and
understanding for users engaging with the code.
C. Functionalities: A Deeper Dive
Now, let us understand the core functionalities with the help
of flowchart. In this section, we will understand the soul
functionalities which are, Monument Identification, placing
monument on map, Providing Information of that particular
monument and locating nearest monuments.
4. Model Performance Visualisation:
Step 1: User Input Processing and Identification of monument
In this step, users provide images of monuments through the
website.
Explanation with Code:
Visualising the performance of the trained model is crucial
for understanding its learning dynamics. This section
incorporates a visualisation component that plots the
accuracy and loss metrics across epochs. The resulting graph
offers a tangible representation of the model's progression
over the training duration.
5. Reporting Results:
Following the training phase, the code reports key results
back, encapsulating crucial information such as the start and
end times of training, the number of epochs, and the step size
during training. Additionally, accuracy and loss metrics are
recorded for a comprehensive overview of the model's
performance.
6. Saving and Uploading the Model:
The final stages of the code involve saving the trained model
to a file, denoted as "my_model.h5." This step ensures that
the model's architecture, weights, and configuration are
preserved for future use or deployment. Subsequently, the
a.
Loading the Pre-trained Model:
• loaded_model=tf.keras.models.load_model("D://Ad
vance Python Project//website//updated_model.h5"):
The pre-trained machine learning model is loaded
from a file. This model has been trained to recognize
specific monuments.
b.
Label Mapping:
• label_map: A dictionary associating numerical labels
with corresponding monument names. This mapping
is crucial for interpreting the model's predictions in
human-readable form.
c.
Prediction Function:
• The prediction function takes an image path and the
loaded model as input.
• The image is loaded, preprocessed, and fed into the
model.
• The model predicts the class of the monument in the
image.
• The predicted class is then mapped back to the
monument name using the label_map.
•
The function returns the identified monument name
and the predicted class.
d. Example Prediction:
• monument_name,predicted_class=prediction(image
_path, loaded_model): The prediction function is
applied to a specific image (image_path), and the
identified monument name and predicted class are
obtained.
Step 2: Parallel Processes
In this step, three processes will the done parallelly
a. plotting on map : identified monuments will be plotted
on map.
b. nearby monument identification : based on identified
monument, we'll identify the city from predefined database.
and based on the city, we'll identify the other nearby
monuments in the given city. then all the nearby monuments
will also be plotted on map.
c. monument information : information of identified
monument will be displayed from wikipedia with iframe tag
on the website
and this whole output will be displayed on the website.
Step 2a: Plotting Identified Monument on Map
In the provided code snippets, the objective is to plot the
identified monument on a map, enriching the user experience
with a visual representation. Let's relate this to the flowchart
and provide an explanation:
➢
Step 2b: Nearby Monument Identification and Mapping
In the provided code snippets, the goal is to identify the city
associated with the recognized monument and retrieve other
nearby monuments in the same city. Let's relate this to the
flowchart and provide an explanation:
Explanation with Code:
i.
➢
HTML and Conditional Check:
{% if monument_name and monument_coordinates
%}: Checks if there is information available about the
identified monument's name and coordinates.
ii.
➢
HTML Structure for Map Display:
<div id="map_div">: Represents the container for the
map on the web page.
<div id="heading_map">: Contains the heading and
the main map.
• <h2>Predicted
Monument:
{{
monument_name }}</h2>: Displays the
heading with the predicted monument's name.
• <div id="main-map"></div>: Creates a div
element for the main map.
➢
iii.
➢
➢
➢
JavaScript for Map Initialization:
var
monumentCoordinates
=
{{
monument_coordinates | tojson | safe }};: Retrieves the
monument coordinates from the backend and stores
them in the monumentCoordinates variable.
var
mainMap
=
L.map('mainmap').setView(monumentCoordinates, 13);: Initializes
the main map using Leaflet, setting the view based on
the monument's coordinates.
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}
/{y}.png', {...}).addTo(mainMap);: Adds a tile layer
from OpenStreetMap to the main map for the base
layer.
City Identification:
city,coordinates=get_city_and_coordinates(monument_
name): The function get_city_and_coordinates is called
with the identified monument name, returning the city
and coordinates associated with that monument.
ii.
Fetching Nearby Monuments:
➢ other_monuments = []: Initializes an empty list to store
information about other monuments in the same city.
➢
➢
Explanation with Code:
i.
➢
L.marker(monumentCoordinates).addTo(mainMap).bi
ndPopup('{{ monument_name }}');: Places a marker
on the map at the coordinates of the identified
monument and adds a popup displaying the
monument's name.
➢
for monument, info in city_coordinates.items():: Iterates
through the predefined city_coordinates dictionary,
which contains information about various monuments in
different cities.
if info['city'] == city and monument !=
monument_name:: Checks if the city of the current
monument matches the identified city and ensures the
current monument is not the same as the recognized one.
other_monuments.append({'name':
monument,
'coordinates': info['coordinates']}): If the conditions are
met, the information (name and coordinates) of the other
monument is appended to the other_monuments list.
iii.
Rendering Template:
➢ return
render_template('index.html',
monument_name=monument_name,
monument_coordinates=coordinates,
city=city,
other_monuments=other_monuments): The function
returns a rendered HTML template (index.html) with
essential information, including the identified
monument's name, coordinates, city, and the list of
related monuments.
Step 2c: Monument Information Retrieval
In the provided code snippets, the goal is to retrieve
information about the identified monument from Wikipedia
and display it on the website. Let's relate this to the flowchart
and provide an explanation:
Explanation with Code:
a. HTML and Conditional Check:
➢ {% if monument_name and monument_coordinates %}:
Checks if there is information available about the
identified monument's name and coordinates.
b. HTML Structure for Information Display:
➢ <div id="div2">: Represents the container for additional
information about the monument on the web page.
• <div id="info"></div>: Creates a div element to
hold the monument information.
c. JavaScript for Information Retrieval:
➢ var monument_name = '{{monument_name}}':
Retrieves the monument name from the backend and
stores it in the monument_name variable.
➢ var infotag = document.getElementById('info'):
Retrieves the div element where the information will be
displayed.
➢ var
iframe_tag
=
'<iframe
src="https://en.wikipedia.org/wiki/{{monument_name}
}"></iframe>': Generates an iframe tag with a source
link to the Wikipedia page corresponding to the
identified monument.
➢ infotag.innerHTML = iframe_tag: Sets the inner HTML
of the information div to the generated iframe tag,
effectively embedding the Wikipedia page.
III. FUTURE SCOPE
The integration of machine learning (ML) and artificial
intelligence (AI) in our web application marks a
revolutionary approach to monument identification. Our
advanced algorithms, including Convolutional Neural
Networks (CNN) and K-Nearest Neighbors (KNN), enable
accurate prediction of monuments from various file formats
such as JPEG, AVIF, and sketches. The inclusion of
confidence percentages adds a valuable dimension, providing
users with a clear indication of prediction reliability.
while significantly increasing the dataset size reflects a
meticulous approach to harnessing the synergistic benefits of
both data quantity and model complexity.
These iterative upgrades underscore our unwavering
commitment to refining and expanding the model's
capabilities. The incorporation of larger datasets and deeper
architectures is a testament to our dedication to pushing the
boundaries of image classification, continually striving for
enhanced accuracy, and ensuring the adaptability of our
model to diverse and evolving datasets.
One standout feature is the interactive map and plotting
functionality. Users not only receive accurate monument
predictions but also gain insights into the geographical
locations of these landmarks. This innovative combination of
technology and geographical representation offers users a
comprehensive experience, allowing them to plan visits with
ease.
Looking ahead, the convergence of machine learning,
artificial intelligence, and augmented reality holds immense
potential. Augmented reality features enhance the
educational and cultural value of landmarks by providing
real-time information and interactive elements, transforming
how users perceive and engage with historical places.
Furthermore, our team recognizes the significance of
preserving historical data and ensuring ethical considerations.
The incorporation of blockchain technology facilitates the
creation of a secure and transparent database, addressing
concerns related to data ownership and privacy. This not only
guarantees the accuracy of historical information but also
contributes to the responsible preservation of cultural
heritage.
IV. CONCLUSION
The evolutionary journey of our image classification model
has been characterised by deliberate and strategic upgrades,
each aimed at bolstering its capacity for nuanced learning and
improved performance. In the initial Beta 1 version, the
model was trained on a dataset comprising 1048 images,
featuring a relatively modest architecture equipped with two
dense layers. This foundational version provided valuable
insights and laid the groundwork for subsequent
enhancements.
Building upon Beta 1, the Beta 2 version introduced a pivotal
upgrade by doubling the number of dense layers to four. This
architectural adjustment was a conscious effort to empower
the model with a more sophisticated understanding of the
underlying patterns within the dataset. The incorporation of
additional dense layers sought to capture and represent
intricate features, fostering a deeper and more nuanced
comprehension of the image data.
The evolution did not halt there. In the Draft version, a
substantial leap was made by expanding the dataset to a
formidable 3856 images, four times the size of the Beta 2
dataset. This augmentation in data volume was accompanied
by the retention of the four dense layers, striking a balance
between model complexity and the richness of the dataset.
The strategic decision to maintain the architectural depth
Our initiative goes beyond individual monument
identification; it aims to facilitate a broader understanding of
historical sites. Users can explore additional functionalities,
such as discovering nearby attractions when searching for a
specific monument. For example, searching for the India Gate
reveals related landmarks like Humayun's Tomb, Lotus
Temple, and Alai Minar. This enriches the user experience by
providing a holistic view of the historical and cultural
landscape surrounding a particular monument.
In essence, our web application addresses the practical needs
of tourists, offering a comprehensive solution for exploring,
understanding, and planning visits to historical landmarks.
By combining technology, geographical information, and
additional functionalities, we aim to simplify the process for
newcomers, fostering a deeper appreciation for history and
encouraging exploration of new places.
V. ACKNOWLEDGMENT
I would like to express my sincere gratitude to the following
individuals whose unwavering support and guidance were
instrumental in the successful completion of my project titled
"Identification of Indian Monuments."
I extend my heartfelt thanks to our esteemed faculty, Dr.
Vipul Mishra, whose profound knowledge, and unwavering
dedication have been a constant source of inspiration
throughout this project. Their invaluable feedback,
encouragement, and willingness to share their expertise
played a pivotal role in shaping this research.
I am deeply thankful to our Head of Department, Dr. Shakti
Mishra, for providing an environment conducive to learning
and research. Their vision and leadership have been crucial
in fostering an atmosphere of academic excellence that
encouraged us to strive for the best.
I would like to extend my appreciation to the Director of
SOT, Dhaval Pujara sir, whose vision and support for
academic pursuits have been instrumental in shaping my
educational journey. Their leadership has made it possible for
students to engage in innovative and challenging projects like
this one.
I would also like to thank Pandit Deendayal Energy
University for providing us with the necessary resources and
infrastructure that made this project possible. The conducive
learning environment and access to a diverse range of
resources have been essential in the pursuit of knowledge and
research.
Finally, I am grateful to all my peers and mentors who have
offered their insights, suggestions, and encouragement
throughout this project. Your support has been invaluable,
and I am deeply appreciative of the collaborative spirit that
defines our academic community.
This project would not have been possible without the
collective effort, support, and mentorship of these individuals
and institutions. Thank you for being an integral part of my
academic journey.
REFERENCES
[1]
[2]
[3]
https://www.ibm.com/topics/machine-learning
https://en.wikipedia.org/wiki/Monuments_of_National_Importance_(I
ndia)
https://leafletjs.com/