Coder Social home page Coder Social logo

farhantandia / person-reid-triplet-loss-project Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 156.7 MB

Simple pipeline of person re-identification task using metric learning via tensorflow api

Jupyter Notebook 100.00%
person-reidentification metric-learning tensorflow-addons triplet-loss

person-reid-triplet-loss-project's Introduction

Person-Reid-Triplet-Loss-Project

Person re-identification is the task of associating images of the same person taken from different cameras or from the same camera in different occasions, the process of person re-identification is shown in figure below, taken from this paper survey.


This repository contains the code of implementation person re-identification using triplet loss and SVM classifier with our custom dataset. The dataset which we are olympic swimmer dataset from YouTube in the top view angle, you can use your own dataset as well.

Dependencies

  • Tensorflow 2.3
  • tensorflow-addons
  • numpy
  • imbalanced-learn (incase the data is imbalanced)
  • scikit-learn 0.23.1

Method


From the detection model, we got a swimmer bounding box and we crop each swimmer image based on the bounding box then use it for the input of our deep learning model. In this case, we designed a compact CNN feature extractor which consist of 6 stacks of CNN with ReLU as activation function, batch normalization and max-pooling as shown in figure 19, the total parameters of the extractor is 166,000. This CNN will act as a feature extractor to get the 128 unique vector embeddings for triplet loss to calculate and optimize the distance of each swimmer embeddings. After getting the features for each swimmer, then we used a clustering model such as support vector machine (SVM) to classify the swimmer embeddings and get the correct ID.

Results

T-SNE visualization


Accuracy comparison

Metric Validation Loss Validation Accuracy
CNN (Cross entropy) 0.7284 80%
CNN (Triplet Loss) + SVM 0.0014 99%

person-reid-triplet-loss-project's People

Contributors

farhantandia avatar

Stargazers

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