Git Product home page Git Product logo

sanf-ad's Introduction

SANF-AD

ICME2023--A Semantic-awareness Normalizing Flow Model for Anomaly Detection.

Paper Introduction

Anomaly detection in computer vision aims to detect outliers from input image data. Examples include texture defect detection and semantic discrepancy detection. However, existing methods are limited in detecting both types of anomalies, especially for the latter. In this work, we propose a novel semantics-aware normalizing flow model to address the above challenges. First, we employ the semantic features extracted from a backbone network as the initial input of the normalizing flow model, which learns the mapping from the normal data to a normal distribution according to semantic attributes, thus enhances the discrimination of semantic anomaly detection. Second, we design a new feature fusion module in the normalizing flow model to integrate texture features and semantic features, which can substantially improve the fitting of the distribution function with input data, thus achieving improved performance for the detection of both types of anomalies. Extensive experiments on five well-known datasets for semantic anomaly detection show that the proposed method outperforms the state-of-the-art baselines.

Installation

  1. First clone the repository
    git clone https://github.com/SYLan2019/SANF-AD.git
    
  2. Create the virtual environment via conda
    conda create -n SANF-AD python=3.8
    
  3. Activate the virtual environment.
    conda activate SANF-AD
    
  4. Install the dependencies.
    pip install --user --requirement requirements.txt
    

Configure and Run

All configurations concerning data, model, training etc, can be found in config.py. The default configuration will run a training with paper-given parameters on the Cifar10 dataset.

To replicate the results in the paper for CIFAR10 dataset, please set the paramater pretrained = False in config.py and run the following commands to extract features:

# CIFAR
python extractor.py

Training on CIFAR10

Then run the following code to train the model on the features of dataset Cifar10

python main.py 

sanf-ad's People

Contributors

sylan2019 avatar mawei12138 avatar

Stargazers

 avatar

Watchers

 avatar

sanf-ad's Issues

requirements.txt

能不能更新下requirements.txt 中的版本吗?并不能很顺畅地安装所有的包,尤其是git下载的

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.