Code for paper entitled "Improving Novelty Detection using the Reconstructions of Nearest Neighbours"

Related tags

Deep LearningNLN
Overview

NLN: Nearest-Latent-Neighbours

A repository containing the implementation of the paper entitled Improving Novelty Detection using the Reconstructions of Nearest Neighbours

Installation

Install conda environment by:

    conda create --name nln python=3.7

Run conda environment by:

    conda activate nln

Install dependancies by running:

    pip install -r dependancies

Additionally for training on a GPU run:

    conda install -c anaconda tensorflow-gpu=2.2.0

Replication of results in paper

Run the following to replicate the results for MNIST, CIFAR-10, Fashion-MNIST and MVTec-AD respectively

    sh experiments/run_mnist.sh
    sh experiments/run_cifar.sh
    sh experiments/run_fmnist.sh
    sh experiments/run_mvtec.sh

Or to execute all experiments sequentially the following script can be run:

    sh experiments/run_all.sh

MVTec-AD usage

You will need to download the MVTec anomaly detection dataset and specify the its path using -mvtec_path command line option.

Training

Run the following:

    python main.py -anomaly_class <0,1,2,3,4,5,6,7,8,9,bottle,cable,...> \
                   -percentage_anomaly <float> \
                   -limit <int> \
                   -epochs <int> \
                   -latent_dim <int> \
                   -data <MNIST,FASHION_MNIST,CIFAR10,MVTEC> \
                   -mvtec_path <str>\
                   -neighbors <int(s)> \
                   -algorithm <knn> \
		   -patches <True, False> \
		   -crop <True, False> \
		   -rotate <True, False> \
		   -patch_x <int> \    
		   -patch_y <int> \    
		   -patch_x_stride <int> \    
		   -patch_y_stride <int> \    
		   -crop_x <int> \    
		   -crop_y <int> \    

Reporting Results

Run the following given the correctly generated results files:

    python report.py -data <MNIST,CIFAR10,FASHION_MNIST,MVTEC> -seed <filepath-seed>

Licensing

Source code of NLN is licensed under the MIT License.

Owner
Michael (Misha) Mesarcik
Electrical and Computer Engineer
Michael (Misha) Mesarcik
Multiple Object Tracking with Yolov5!

Tracking with yolov5 This implementation is for who need to tracking multi-object only with detector. You can easily track mult-object with your well

9 Nov 08, 2022
Diffusion Normalizing Flow (DiffFlow) Neurips2021

Diffusion Normalizing Flow (DiffFlow) Reproduce setup environment The repo heavily depends on jam, a personal toolbox developed by Qsh.zh. The API may

76 Jan 01, 2023
A set of tests for evaluating large-scale algorithms for Wasserstein-2 transport maps computation.

Continuous Wasserstein-2 Benchmark This is the official Python implementation of the NeurIPS 2021 paper Do Neural Optimal Transport Solvers Work? A Co

Alexander 22 Dec 12, 2022
Implementation of Change-Based Exploration Transfer (C-BET)

Implementation of Change-Based Exploration Transfer (C-BET), as presented in Interesting Object, Curious Agent: Learning Task-Agnostic Exploration.

Simone Parisi 29 Dec 04, 2022
Animate molecular orbital transitions using Psi4 and Blender

Molecular Orbital Transitions (MOT) Animate molecular orbital transitions using Psi4 and Blender Author: Maximilian Paradiz Dominguez, University of A

3 Feb 01, 2022
Reinforcement learning framework and algorithms implemented in PyTorch.

Reinforcement learning framework and algorithms implemented in PyTorch.

Robotic AI & Learning Lab Berkeley 2.1k Jan 04, 2023
Translation-equivariant Image Quantizer for Bi-directional Image-Text Generation

Translation-equivariant Image Quantizer for Bi-directional Image-Text Generation Woncheol Shin1, Gyubok Lee1, Jiyoung Lee1, Joonseok Lee2,3, Edward Ch

Woncheol Shin 7 Sep 26, 2022
Lua-parser-lark - An out-of-box Lua parser written in Lark

An out-of-box Lua parser written in Lark Such parser handles a relaxed version o

Taine Zhao 2 Jul 19, 2022
Hummingbird compiles trained ML models into tensor computation for faster inference.

Hummingbird Introduction Hummingbird is a library for compiling trained traditional ML models into tensor computations. Hummingbird allows users to se

Microsoft 3.1k Dec 30, 2022
Active window border replacement for window managers.

xborder Active window border replacement for window managers. Usage git clone https://github.com/deter0/xborder cd xborder chmod +x xborders ./xborder

deter 250 Dec 30, 2022
Official implementation of our CVPR2021 paper "OTA: Optimal Transport Assignment for Object Detection" in Pytorch.

OTA: Optimal Transport Assignment for Object Detection This project provides an implementation for our CVPR2021 paper "OTA: Optimal Transport Assignme

217 Jan 03, 2023
This toolkit provides codes to download and pre-process the SLUE datasets, train the baseline models, and evaluate SLUE tasks.

slue-toolkit We introduce Spoken Language Understanding Evaluation (SLUE) benchmark. This toolkit provides codes to download and pre-process the SLUE

ASAPP Research 39 Sep 21, 2022
Label Hallucination for Few-Shot Classification

Label Hallucination for Few-Shot Classification This repo covers the implementation of the following paper: Label Hallucination for Few-Shot Classific

Yiren Jian 13 Nov 13, 2022
Using deep learning model to detect breast cancer.

Breast-Cancer-Detection Breast cancer is the most frequent cancer among women, with around one in every 19 women at risk. The number of cases of breas

1 Feb 13, 2022
Rule-based Customer Segmentation

Rule-based Customer Segmentation Business Problem A game company wants to create level-based new customer definitions (personas) by using some feature

Cem Çaluk 2 Jan 03, 2022
Fog Simulation on Real LiDAR Point Clouds for 3D Object Detection in Adverse Weather

LiDAR fog simulation Created by Martin Hahner at the Computer Vision Lab of ETH Zurich. This is the official code release of the paper Fog Simulation

Martin Hahner 110 Dec 30, 2022
A2LP for short, ECCV2020 spotlight, Investigating SSL principles for UDA problems

Label-Propagation-with-Augmented-Anchors (A2LP) Official codes of the ECCV2020 spotlight (label propagation with augmented anchors: a simple semi-supe

20 Oct 27, 2022
Code for Transformer Hawkes Process, ICML 2020.

Transformer Hawkes Process Source code for Transformer Hawkes Process (ICML 2020). Run the code Dependencies Python 3.7. Anaconda contains all the req

Simiao Zuo 111 Dec 26, 2022
The Python code for the paper A Hybrid Quantum-Classical Algorithm for Robust Fitting

About The Python code for the paper A Hybrid Quantum-Classical Algorithm for Robust Fitting The demo program was only tested under Conda in a standard

Anh-Dzung Doan 5 Nov 28, 2022
Official NumPy Implementation of Deep Networks from the Principle of Rate Reduction (2021)

Deep Networks from the Principle of Rate Reduction This repository is the official NumPy implementation of the paper Deep Networks from the Principle

Ryan Chan 49 Dec 16, 2022