Giter Site home page Giter Site logo

ai3604-final-project's Introduction

GMM4AnomalySeg: A Generative Method based on Constrastive Learning and Edge Post-processing

Abstract

In this paper, we propose a novel method in pursuit of solving the anomaly segmentation task. Based on previous generative approaches to anomaly segmentation, we follow the fashion of modeling likelihood $p(feature | class)$ instead of posterior $p(class | feature)$ as is adopted by discriminative counterparts. We also introduce contrastive learning to our model where we randomly sample from GMMs representing different pixel classes and perform contrastive learning on the sampled feature vectors. One of the most salient differences from previous work is that we continuously finetune the GMM components whether we are simply fitting GMM components to training data or training our feature extraction module discriminatively. We testify our method mainly on Fishyscapes benchmark, and we outperform previous GMM-based approaches to some extent. We believe this work sheds light on GMM-based anomaly segmentation and other relative fields.

Dataset Preparation

We suggest downloading datasets under a new directory data/.

Installation

This implementation is built on MMSegmentation v0.22.1. Many thanks to the contributors for their great efforts.

Please follow the get_started for installation and dataset_prepare for dataset preparation.

Other requirements: pip install timm==0.5.4 einops==0.4.1

Usage

# multi-gpu train
bash tools/dist_train.sh configs/_gmmseg/segformer_mit-b5_gmmseg_1024x2048_160k_cityscapes.py $GPU_NUM

# single-gpu test
python tools/test_fishyscapes.py configs/_gmmseg/segformer_mit-b5_gmmseg_fishyscapes.py /path/to/checkpoint_file

Acknowledgement

Our code implementation is based on GMMSeg, and we would like to thank the authors for their comprehensive work.

ai3604-final-project's People

Contributors

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