GithubHelp home page GithubHelp logo

dyfine / msa Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.26 MB

official pytorch implementation of "Multi-Scale Similarity Aggregation for Dynamic Metric Learning", MM 2023

License: MIT License

Python 97.93% Shell 2.07%

msa's Introduction

MSA

This repository is the official implementation of Multi-Scale Similarity Aggregation for Dynamic Metric Learning on dynamic metric learning (DyML) task.

๐Ÿ“‹ Our code is based on HAPPIER and we greatly appreciate for their work.

Requirements

This repo was tested with Ubuntu 20.04.1 LTS, Python 3.6, PyTorch 1.8.1, and CUDA 11.1 on one RTX 3090 GPU.

Training

  1. Prepare the DyML datasets (DyML-Vehicle, DyML-Animal, DyML-Product).

    Download datasets from here and modify the data_dir in dyml_vehicle.yaml, dyml_animal.yaml, and dyml_product.yaml in MSA/happier/config/dataset/.

    kwargs:
      data_dir: /path/to/dataset
  2. Download pretrained models from here and put them into MSA/pretrained_model.

  3. To train the model(s) in the paper, run the following commands.

    DyML-Vehicle:

    sh run_vehicle_msa.sh

    DyML-Animal:

    sh run_animal_msa.sh

    DyML-Product:

    sh run_product_msa.sh

    ๐Ÿ“‹ Note that for the DyML-Product dataset, learning a single embedding only for the fine level achieves a better R@1 result (~68%) than that of the complete version of MSA (~66%), and we report the former result. In run_product_msa.sh, we provide the commands to train these two models.

Testing

During testing, we evaluate the performance of both the online network and the momentum network, while the performance of the online network is reported. In TensorBoard, the tag Evaluation_EMA denotes the performance of the momentum network.

Results

Our model achieves the following performance on three DyML datasets:

Citation

If you find this repo useful for your research, please consider citing this paper

@inproceedings{zhang2023msa,
    title = {Multi-Scale Similarity Aggregation for Dynamic Metric Learning},
    author = {Zhang, Dingyi and Li, Yingming and Zhang, Zhongfei},
    booktitle = {Proceedings of the 31st ACM International Conference on Multimedia},
    pages = {125โ€“134},
    year = {2023},
    publisher = {Association for Computing Machinery},
}

msa's People

Contributors

dyfine avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.