GithubHelp home page GithubHelp logo

semask-fpn-contrast's Introduction

Contrastive SeMask FPN

Background

This repo includes modifications to the SeMask-FPN repository to implement a variation of Regional Contrastive Loss. It's part of a Visual Learning and Recognition (16-824) final project at Carnegie Mellon University.

The original project focuses on self-supervised multimodality cost-learning for autonomous robotic navigation through rough terrain, but uses a patch-based vision system with high latency. Sensor measurements are associated with the visual region which the robot is actively traversing. Cost is inferred from sensor feedback and a network is trained offline to regress cost from the region's appearance (further details are on hold due to pending publication). However, dense, per-pixel embeddings from images can be used to propagate costs based on visual similarity in an online fashion.

Cost assigned to an image patch can be related to the full image through similarity of dense embeddings. While the pre-class layer features of any off-the-shelf pre-trained segmentation model will be fairly discriminative, recent work has shown contrastive loss in segmentation models can disentangle and regularize the embedding space - additionally, explicitly L2-normalized features provide a bounded metric. The contrastive SeMask model is trained over the YCOR dataset to learn task-specific discriminative features.

Training Setup

  • Install the requirements as stated in the original SeMask-FPN repo and run pip install -e . from the top level directory.
  • Download the YCOR dataset to data/yamaha.
  • Run python convert_labels.py from the data directory (the paths are hardcoded for simplicity). This converts the YCOR dataset into an ADE20K format.
  • Download pre-trained SeMask-S FPN weights from here.

After the set up, you can run

python train.py configs/semask_swin/custom/semfpn_semask_swin_small_yamaha.py —load-from <path/to/pretrained/ade20k/weights>

to train the vanilla SeMask-S FPN on YCOR, or

python train.py configs/semask_swin/custom/contrastive_semfpn_semask_swin_small_yamaha.py —load-from <path/to/pretrained/ade20k/weights>

to run the contrastive model.

The core code of the contrastive model (that's new to SeMask) is located under mmseg/models/decode_heads/ as contrastive_semask_decode_head.py and contrastive_branch_fpn_head.py.

semask-fpn-contrast's People

Contributors

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