A Project Report On: Landmark Detection Tool
A Project Report On: Landmark Detection Tool
A Project Report On: Landmark Detection Tool
For
By
Meenakshi Kalimuthu
[UNIVERSITY OF MUMBAI]
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
1
Certification from College:
DATE: 31-1-2024
(2023-2024)
Certificate of Approval
This is to certify that the project work entitled "Landmark Detection Tool”
is prepared by 050-Meenakshi Kalimuthu a student of “Third Year
Bachelor of Science (Computer Science)” course of University of Mumbai,
which is conducted by our college. This is the original study work and
important sources used have been duly acknowledged in the report. The
report is submitted in partial fulfillment of B.Sc. (Computer Science)
course as per rules of University of Mumbai.
_____________________
External Examiner
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
2
Index:
Sr.No Index Topic
Page
Acknowledgement 1-4
I. Preliminary Investigation
(ii) Abstract 6
(iii) Motivation 8
(v) Objectives 11
(viii) Timeline 15
(IX) Workflow 17
II System Analysis
IV System Code 29
VI Future Enhancement 32
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
3
VII References and Bibliography 34
ACKNOWLEDGEMENT
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
4
Organizational Overview
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
5
Description of the System:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
6
Abstract:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
7
Motivation:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
8
Literature review:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
9
importance using non- parametric density estimation [13], spatial pyramid
kernel- based BoW approaches (SPK-BoW) [14,15], and scalable
vocabulary trees [16]
Problem Statement:
Existing System
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
10
Objectives:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
11
Hardware Requirements:-
Software Requirements:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
12
TensorFlow: Install TensorFlow, a popular deep learning framework,
preferably through pip or Anaconda, to leverage its functionalities for
training and inference tasks.
TensorFlow Hub: Install TensorFlow Hub to access pre-trained models
and embeddings from TensorFlow Hub's repository, enabling easy
integration of state-of-the-art models into the project. Additional Python
Libraries: Install other required Python libraries such as NumPy, OpenCV,
Matplotlib, and scikit-learn for data manipulation, image processing,
visualization, and evaluation tasks. Development Environment: Use an
integrated development environment (IDE) such as PyCharm, Visual
Studio Code, or Jupyter Notebook for coding, debugging, and
experimentation.
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
13
Limitation of present system
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
14
Timelines
Timeline: 8 weeks
Tasks: Duration Dependencies
Data Acquisition and Preprocessing |2| |Task 1 |
* Gather diverse landmark datasets representing the target regions and
landmark types.
* Preprocess the data, including cleaning, labeling, and formatting for
model training.
| Model Selection and Evaluation |2| |Task 1 |
(using TensorFlow Hub)
* Explore available pre-trained models on TensorFlow Hub based on
functionalities and compatibility. * Evaluate potential models on a smaller
portion of the preprocessed data, considering accuracy and resource
requirements.
| Select and Fine-tune a TensorFlow Hub Model |3| |Task 3 |
* Based on evaluation results, select the best performing model. *
Fine-tune the model on the entire preprocessed dataset
| System Integration and Development |2| |Task 4 |
* Integrate the trained model into the system architecture.
| Testing and Deployment |1| |Task 5 |
* Performed comprehensive testing to ensure system functionality,
accuracy, and robustness.
* Deployed the system to the target environment, considering scalability
and security.
| Documentation and Maintenance |1| |All Tasks |
* Created comprehensive documentation for system usage and
maintenance.
* Established a maintenance plan to address future issues and potential
updates.
Dependencies: Most tasks depend on the completion of the previous
task(s). Tasks 1 and 2 can potentially proceed partially in parallel.
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
15
Activity process:
This activity diagram outlines the high-level processes involved in
enhancing a landmark detection system using pre-trained models from
TensorFlow Hub:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
16
Workflow diagram:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
17
Overview of Technologies Used:
Python:
● Overview:
Python is a high-level, versatile programming language known for its
readability and ease of
use. It supports multiple programming paradigms and has a vast
ecosystem of libraries and
frameworks.
● Usage in the Project:
Python serves as the primary programming language for developing the
Landmark Detection tool . Its simplicity and extensive libraries make it an
ideal choice for integrating various components of the system seamlessly.
Python enables quick development, easy integration of modules, and
provides a straightforward syntax that contributes to the project's
accessibility and maintainability.
● Label Map:
A CSV file containing a mapping between numerical labels and their
corresponding human-readable names for the landmarks. Used to
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
18
interpret the model's predictions and provide meaningful output to the
user.
● Additional Libraries:
Depending on the project's specific features, additional libraries like:
Matplotlib: For creating visualizations (e.g., plotting confidence scores).
Gradio: For building interactive web interfaces for user interaction.
Overall, this project combines Python's versatility with the power of
TensorFlow and pre-trained models to achieve real-time landmark
detection from user-provided images.
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
19
TensorFlow Hub: This platform serves as the arsenal, offering a vast
repository of pre-trained models, including the one specifically designed
for landmark classification in this project.
By leveraging this pre-trained model, the project benefits from:
Reduced development time: No need to train a model from scratch,
saving significant time and resources. .
Specialization: The pre-trained model is specifically tailored for landmark
classification, leading to potentially higher accuracy compared to generic
models.
3. The Machine Learning Model: The Specialist:
The pre-trained convolutional neural network (CNN) acts as the expert,
specifically trained to identify landmarks within images. Its intricate
architecture, honed through extensive training data, allows it to:
Extract features: The CNN automatically learns to identify patterns and
features within images that are relevant to different landmarks. Classify
images: Based on the extracted features, the model assigns probabilities
to different landmark categories, enabling the system to predict the most
likely landmark present in the image.
4. The Label Map: The Translator:
The label map acts as the translator, bridging the gap between the
model's numerical predictions and human-understandable labels. It maps
the numerical codes generated by the model to their corresponding
landmark names, allowing the system to: Interpret results: The system
can translate the model's predictions into meaningful labels, such as
"mountain," "building," or "temple," for user comprehension.
Display results: The translated labels can be displayed alongside the
image, providing clear information about the detected landmarks.
5. The Synergy Effect:
Python seamlessly integrates the functionalities of various libraries,
enabling a smooth workflow. TensorFlow and TensorFlow Hub provide the
foundation and expertise for leveraging the pre-trained model's
capabilities. The model's specialized skills in landmark classification are
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
20
harnessed to achieve accurate predictions. The label map translates the
model's predictions into human-readable labels, enhancing user
experience. This harmonious blend of technologies empowers the project
to efficiently and accurately detect landmarks within user-provided
images, showcasing the true potential of technological synergy in driving
innovation and solving real-world problems.
System Analysis:
Defining the System and its Scope: This system detects landmarks in
images. It utilizes pre-trained models from TensorFlow Hub for landmark
recognition and focuses on static images at this stage.
Model Loading: The code specifies the URL for the pre-trained landmark
detection model hosted on TensorFlow Hub. This model is then loaded
using hub.KerasLayer.
Data Loading and Preparation: It loads a CSV file containing the label
map for the model predictions. This map translates the numerical
predictions into human-readable labels. The image shape is also defined.
Image Processing: An image (presumably in JPEG format) is loaded from
a local file location using PIL (Python Imaging Library). It is then resized to
match the required input shape for the model.
Normalization: The image is normalized by dividing each pixel value by
255.0 to bring them into the range [0, 1], which is a common
preprocessing step for neural networks.
Model Prediction: The preprocessed image is fed into the loaded model
for prediction. The output is a set of predictions represented as logits,
which are converted into human-readable labels using the label map.
Prediction Function Definition: A function classify_image is defined to
encapsulate the prediction process. It takes an image as input,
preprocesses it, predicts the landmark using the loaded model, and
returns the predicted label.
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
21
Dataset
About My Dataset
Dataset Used in the Pre-trained Model (TensorFlow Hub)
Since we’re using a pre-trained model from TensorFlow Hub, the specific
details about the dataset used to train the model might not be readily
available.
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
22
Fact Finding Techniques:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
23
Working:
1. Importing Libraries:
numpy: Used for numerical operations and array manipulation.
pandas: Used for data analysis and manipulation (specifically reading the
label map).
matplotlib.pylab: Used for plotting visualizations (not directly used in this
code).
gradio: Used for creating interactive interfaces (not directly used in this
code).
PIL.Image: Used for image processing tasks like opening and resizing
images.
tensorflow: The core library for building and running machine learning
models. tensorflow_hub: Provides access to pre-trained models hosted on
TensorFlow Hub.
2. Defining Constants:
TF_MODEL_URL: Specifies the URL of the pre-trained model for
landmark classification in Asia.
LABEL_MAP_URL: Specifies the URL of the CSV file containing labels
corresponding to the model's predictions.
IMAGE_SHAPE: Defines the expected input image size for the model
(321x321 pixels).
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
24
The pandas.read_csv function reads the label map from the specified
URL. A dictionary named label_map is created, mapping each label ID to
its corresponding name.
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
25
Developing scalable algorithms that can handle the volume and
complexity of such datasets is essential.
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
26
rights. Implementing privacy-preserving measures and adhering to
ethical guidelines are paramount when deploying automated
landmark detection systems in real-world scenarios.
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
27
Thakur college of science and commerce
Department Of Computer Science
Science 2023-2024
Preliminary
Investigation
System Analysis
System Designing
System Coding
System
Implementation
Report
Submission
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
28
Code:
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
import gradio as gr
import PIL.Image as Image
import tensorflow as tf
import tensorflow_hub as hub
TF_MODEL_URL =
'https://tfhub.dev/google/on_device_vision/classifier/landmarks_classifier_
asia_V1/1'
LABEL_MAP_URL =
'https://www.gstatic.com/aihub/tfhub/labelmaps/landmarks_classifier_asia
_V1_label_map.csv'
IMAGE_SHAPE = (321, 321)
classifier = tf.keras.Sequential([hub.KerasLayer(TF_MODEL_URL,
input_shape=IMAGE_SHAPE+(3,), output_key="predictions:logits")])
df = pd.read_csv(LABEL_MAP_URL)
label_map = dict(zip(df.id, df.name))
img_loc = "image1.jpg"
img = Image.open(img_loc).resize(IMAGE_SHAPE)
img
img = np.array(img)/255.0
img.shape
img = img[np.newaxis, ...]
img.shape
result = classifier.predict(img)
result label_map[np.argmax(result)]
class_names=list(label_map.values())
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
29
Use case diagram:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
30
Output:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
31
Future Enchantments:
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
32
images or videos. This could involve developing algorithms to pinpoint
specific features or architectural details, enabling more accurate mapping
and annotation of identified landmarks. Semantic Understanding:
Augment the system's understanding of landmark context and
significance by integrating semantic analysis techniques. By incorporating
information about the historical, cultural, and social importance of
recognized landmarks, the tool can provide richer contextual information
and enhance its value for educational, tourism, and cultural heritage
preservation purposes. User-Driven Contributions: Implement
mechanisms for user-driven contributions to continuously update and
expand the landmark database. This could involve crowdsourcing efforts
to collect images and information about lesser-known landmarks,
ensuring that the system remains up-to-date and relevant as new
landmarks emerge or gain prominence. Cross-Domain Applications:
Explore applications beyond traditional landmark recognition, such as
urban planning, environmental monitoring, or virtual tourism.
CONCLUSION:
In conclusion, the development of the landmark detection tool
represents a significant advancement in automated image analysis,
addressing the inefficiencies and limitations of manual landmark
identification methods. By leveraging machine learning techniques,
particularly with TensorFlow Hub integration, this project has achieved its
objectives of creating a robust, accurate, and efficient system for
detecting landmarks within images or videos. The system's high accuracy,
scalability, and real-time capabilities offer numerous benefits across
various domains, including urban planning, healthcare, robotics, and
more. Furthermore, its user-friendly interfaces and accessibility
enhancements ensure that it can be readily adopted by researchers,
industries, and individuals alike. With the potential to streamline
processes, enhance decision-making, and unlock new insights, the
landmark detection tool stands poised to make a significant impact in
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
33
diverse applications. Moving forward, continued refinement, validation,
and integration efforts will further solidify its position as a valuable asset in
the realm of computer vision and image analysis
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
34
Meenakshi Kalimuthu
Landmark Detection System
050, TYCS [A]
35