Skip to content

JonatasMSS/Metric_learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Metric Learning - Study and Application

This repository contains a study on Metric Learning and Siamese Networks, with a small application to put the learned concepts into practice.

Table of Contents

Repository Structure

  • model_training/: Contains the Jupyter notebook for studying and training the model.
  • app/: Simple desktop application to compare images using the trained model.

Setup Instructions

  1. Create a virtual environment in the app folder:

    cd app
    python -m venv .venv
    .\.venv\Scripts\Activate.ps1  # Windows
    source .venv/bin/activate       # Linux/macOS
  2. Install dependencies:

    pip install -r requirements.txt
  3. Ensure the Keras model is saved:

    • The trained model should be located in app/model/embedding_network.keras.
    • If the model is not available, run the Metric_learning.ipynb notebook in the model_training/ folder to train and save the model.

How to Use

  • To explore the study, open the Metric_learning.ipynb notebook.
  • To use the application, run app/main.py.

Objective

The objective of this project is to understand the concepts of Metric Learning and Similarity Learning using Siamese Networks.

Challenges

During the development of this project, I faced the following challenges:

  • Scoring Metrics: Achieving a satisfactory scoring metric for the model was difficult. This led me to study more about metrics and neural network architectures.
  • Output Usage: Understanding how to use the model outputs was challenging. I opted to use the distance between embeddings for the loss calculation, but there is still room for improvement.
  • Inconsistent Results: The model results were not as good as expected, motivating me to investigate possible errors and optimizations.
  • Graphical Visualizations: I struggled to create graphical visualizations that helped understand the model's successes and failures.

These challenges were important for my learning and helped me identify areas for improvement in future projects.

Pre-trained Model

To facilitate the use of the project, I have made a pre-trained model available based on the Metric_learning.ipynb notebook. You can download it using the link below:

Download Pre-trained Model

Make sure to save the model in the app/model/ folder with the name embedding_network.keras so that the application can use it correctly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published